AVCoders.Lighting 2026.12.2

Prefix Reserved
dotnet add package AVCoders.Lighting --version 2026.12.2
                    
NuGet\Install-Package AVCoders.Lighting -Version 2026.12.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AVCoders.Lighting" Version="2026.12.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AVCoders.Lighting" Version="2026.12.2" />
                    
Directory.Packages.props
<PackageReference Include="AVCoders.Lighting" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AVCoders.Lighting --version 2026.12.2
                    
#r "nuget: AVCoders.Lighting, 2026.12.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package AVCoders.Lighting@2026.12.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AVCoders.Lighting&version=2026.12.2
                    
Install as a Cake Addin
#tool nuget:?package=AVCoders.Lighting&version=2026.12.2
                    
Install as a Cake Tool

AVCoders.Lighting

Lighting and dimmer drivers for the AV Coders device library. Built on AVCoders.Core. Targets .NET 8.0 and .NET 10.0.

Install

dotnet add package AVCoders.Lighting

Published to nuget.org. See the repository README for details.

Drivers

  • CBusLight — Clipsal C-Bus
    • CBusSerialInterface.SetupPci then reads the PCI's unit type, firmware, network voltage and status with IDENTIFY, and shows them as details. The network voltage and status are read again every CBusSerialInterface.HealthReadInterval (1 minute). Each SetupPci replaces the health-read timer, so overlapping calls still leave one health read per interval
    • A low network voltage raises a Major issue and a marginal one a Minor issue. The PCI's error flags show as a detail; EE errors raise a Major issue and the others, apart from power on reset, a Minor one
    • A read still unanswered at the next health read, or answered with a reply that isn't the length its header gives, isn't text, or isn't a 12-byte status, is asked again then. Three misses in a row raise a Minor issue carrying the last raw reply or "no reply", which the first good reply resolves. An empty text reply shows the raw reply as its detail
    • An 8-byte 0x82 reply is always a channel status reply, even from unit 0, never an IDENTIFY reply
  • DyNet — Philips Dynalite
  • Zigbee2MqttLight — Zigbee2MQTT
    • Publishes {"state": "", "brightness": ""} to zigbee2mqtt/<topic>/get each time its MQTT client connects, and once at creation if the client is already connected, so Zigbee2MQTT publishes the light's state on zigbee2mqtt/<topic>. The request goes out after the light's SUBSCRIBE on that connection. It isn't repeated or retried: a light that doesn't answer stays Unknown until it next publishes
    • Shows linkquality and update.state from each state message as details. An empty or absent value shows the raw JSON with no issue; a value that can't be read shows raw, and the third in a row raises a minor issue that the next readable value resolves
  • CasambiLight — Casambi, through the Casambi cloud (REST at https://door.casambi.com, WebSocket at wss://door.casambi.com/v1/bridge/). A Casambi gateway app must be online on site
    • CasambiNetwork owns the login, the WebSocket wire and the network's units, scenes and groups; each CasambiLight is one unit on it. Each network needs its own REST client and its own WebSocket client:
      var rest = new AvCodersRestClient(CasambiNetwork.Host, CasambiNetwork.Port, CasambiNetwork.RestProtocol, "Casambi REST", allowUntrustedCertificates: false);
      var socket = new AvCodersWebSocketClient(CasambiNetwork.Host, CasambiNetwork.Port, CasambiNetwork.WebSocketProtocol, CasambiNetwork.WebSocketPath, "Casambi WebSocket");
      var network = new CasambiNetwork("Casambi", rest, socket, apiKey, networkId, email, password);
      var downlights = new CasambiLight("Downlights", network, unitId: 12);
      
    • Login: CasambiNetwork sets the API key on both clients and posts the email and password to /v1/networks/{id}/session. One login waits for a reply at a time. Login, SetCredentials or SetApiKey called while a login is waiting send nothing then: the reply to the waiting login is discarded when it arrives and a login with the current values is sent. A login still without a reply after LoginRetryInterval (30 seconds) raises the login issue with "no reply" and the URL, and a new login is sent; a reply to the earlier login that arrives after that is taken as the reply to the new one
    • Login retries: a reply of 401 or 403, or a 200 without a sessionId for the network, is tried again after RejectedLoginRetryInterval (5 minutes). Any other failed reply, or no reply, is tried again after LoginRetryInterval. Each raises the login issue, which the next successful login resolves
    • The driver disconnects the WebSocket client whenever it holds no session: at creation, after a failed login, after a rejected session and in SetCredentials and SetApiKey. It stays disconnected until a login succeeds. The driver connects it then only if the driver was the one that disconnected it; a socket disconnected by anything else stays disconnected
    • The open message is sent, while a session is held: on every connect; on each PingInterval tick while the socket is connected and the wire is not open; on networkUpdated; and when a login succeeds while the socket is connected and the wire is not open. A login that succeeds while the wire is open reconnects the socket, and the open follows on that connect. The wire is open from openWireSucceed until the socket's connection state changes or an API key or session failure arrives
    • invalidSession, or HTTP 410 on a network read, drops the session and disconnects the socket. When the last successful login is more than LoginRetryInterval old, a login is sent at once. Otherwise the session issue is raised and a login is sent after RejectedLoginRetryInterval
    • The network (/v1/networks/{id}) is read after each login and on networkUpdated. A failed reply, an unreadable body or no reply raises the inventory issue and the read is sent again every LoginRetryInterval until one succeeds. A reply to a read that was sent with a session other than the current one, or that arrives while no session is held, is ignored whatever its status
    • A ping is sent every PingInterval (4 minutes) while the wire is open. A ping with no pong by the next tick raises a momentary unanswered-ping issue and reconnects the socket; three in a row raise it as an ongoing issue, which the next pong resolves
    • Gateway: on the first openWireSucceed after a connect, the network waits GatewayWait (30 seconds) for a unitChanged or a peerChanged with online true, then raises the gateway issue. Either event resolves it and sets the network Okay. A peerChanged with online false changes neither
    • Critical ongoing issues: login (the email sent, with the HTTP status and body, or "no reply" and the URL), session (the invalidSession message, or the 410 status and body), api-key (the keyAuthenticateFailed or keyAuthorizeFailed message), wire (the tooManyWires message) and gateway (the network id and the wait; no reply exists to carry). A successful login resolves login; openWireSucceed resolves session, api-key and wire; a successful network read also resolves session
    • The network's CommunicationState: Okay once the wire is open and a gateway has been seen on that connection. Error while login, session, api-key or wire is raised, whether the socket is connected, closed or disconnected by the driver, and from the moment gateway is raised until the socket's connection state next changes. NotAttempted while the socket is disconnected by anything other than the driver. Unknown otherwise, which includes from creation until a gateway is seen and while the driver has the socket disconnected with none of those issues raised
    • Other issues: inventory (ongoing, HTTP status and body or "no reply"), unanswered-ping, rejected-command (momentary, on invalidValueType or invalidData, with the reply and the last command sent) and wire-status (momentary, on a wireStatus the driver does not know)
    • Details: network id, name, revision, grade, type, timezone and gateway name from the network read; "Wire Status" holds the last wireStatus message about the wire itself and is removed when the socket's connection state changes; "Last Peer Change" holds the last peerChanged message
    • Network functions: RecallScene(sceneId, level), SetGroupLevel(groupId, level), SetNetworkLevel(level) and SetUnitsLevel(unitIds, level), levels 0–100. Scenes, Groups and Units hold the network's lists, each with a change handler. PowerOn and PowerOff on the network send nothing
    • A command given while the wire is not open is not sent and not queued. A warning is logged with the command, the socket state, the last wire status and whether there is a session. The "Set …" and "Recalled …" events of the network and of the light's own setters are recorded only when the command was sent. PowerOn, PowerOff and RecallPreset on a light record their Light event either way
    • A command whose socket write fails as the connection drops is kept by the WebSocket client and sent again on a reconnect within the client's queue timeout, ahead of the open message
    • CasambiLight takes Brightness from dimLevel, PowerState from on (from dimLevel when the event has no on) and CommunicationState from online. A unit going offline is logged as a warning with the event. The light is Unknown while the socket is not connected. PowerOn sends Dimmer 1 and PowerOff Dimmer 0. Presets() lists the network's scenes that hold the unit, and RecallPreset takes the scene id
    • Colour and other controls: SetColourTemperature, SetHueSaturation, SetRgb, SetXy (Casambi marks XY as experimental), SetColourBalance, SetSlider, SetOnOff and SetDimmer(index, level). ColourTemperature, ColourSource, Rgb, Xy, HueSaturation, Slider, ColourBalance, OnOff and ActiveSceneId follow the unit's events, each with a change handler
    • A unit status other than ok, or a condition other than 0, 128 or 160, raises a Major unit-status issue (Minor for configuration_failed) until the unit reports okay. A light whose unit id is not in the network raises unit-not-found listing the network's unit ids. Unit identity, status, condition and the event's details show as details
    • A unitChanged for a unit id the network doesn't have is logged as a warning with the event

Usage

Drivers talk to hardware through a transport from AVCoders.CommunicationClients. See the repository README for full wiring, logging and tracing setup.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2026.12.2 74 12/2/2026
2026.12.1 71 12/2/2026
2026.11.4 89 11/30/2026
2026.11.3 88 11/30/2026
2026.11.2 105 11/20/2026
2026.11.1 107 11/12/2026
2026.10.5 123 10/21/2026
2026.10.4 135 10/21/2026
2026.10.3 108 10/14/2026
2026.10.2 110 10/13/2026
2026.10.1 110 10/6/2026
2026.9.8 124 9/29/2026
2026.9.7 133 9/24/2026
2026.9.6 127 9/18/2026
2026.9.5 124 9/17/2026
2026.9.4 120 9/14/2026
2026.9.2 127 9/2/2026
2026.9.1 123 9/2/2026
2026.8.5 132 8/27/2026
2026.8.4 128 8/26/2026
Loading failed