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" />
<PackageReference Include="AVCoders.Lighting" />
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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#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
#tool nuget:?package=AVCoders.Lighting&version=2026.12.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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-BusCBusSerialInterface.SetupPcithen 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 everyCBusSerialInterface.HealthReadInterval(1 minute). EachSetupPcireplaces 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
0x82reply is always a channel status reply, even from unit 0, never an IDENTIFY reply
DyNet— Philips DynaliteZigbee2MqttLight— Zigbee2MQTT- Publishes
{"state": "", "brightness": ""}tozigbee2mqtt/<topic>/geteach time its MQTT client connects, and once at creation if the client is already connected, so Zigbee2MQTT publishes the light's state onzigbee2mqtt/<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
linkqualityandupdate.statefrom 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
- Publishes
CasambiLight— Casambi, through the Casambi cloud (REST athttps://door.casambi.com, WebSocket atwss://door.casambi.com/v1/bridge/). A Casambi gateway app must be online on siteCasambiNetworkowns the login, the WebSocket wire and the network's units, scenes and groups; eachCasambiLightis 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:
CasambiNetworksets 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,SetCredentialsorSetApiKeycalled 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 afterLoginRetryInterval(30 seconds) raises theloginissue 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
sessionIdfor the network, is tried again afterRejectedLoginRetryInterval(5 minutes). Any other failed reply, or no reply, is tried again afterLoginRetryInterval. Each raises theloginissue, 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
SetCredentialsandSetApiKey. 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
PingIntervaltick while the socket is connected and the wire is not open; onnetworkUpdated; 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 fromopenWireSucceeduntil 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 thanLoginRetryIntervalold, a login is sent at once. Otherwise thesessionissue is raised and a login is sent afterRejectedLoginRetryInterval- The network (
/v1/networks/{id}) is read after each login and onnetworkUpdated. A failed reply, an unreadable body or no reply raises theinventoryissue and the read is sent again everyLoginRetryIntervaluntil 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 momentaryunanswered-pingissue and reconnects the socket; three in a row raise it as an ongoing issue, which the next pong resolves - Gateway: on the first
openWireSucceedafter a connect, the network waitsGatewayWait(30 seconds) for aunitChangedor apeerChangedwithonlinetrue, then raises thegatewayissue. Either event resolves it and sets the network Okay. ApeerChangedwithonlinefalse changes neither - Critical ongoing issues:
login(the email sent, with the HTTP status and body, or "no reply" and the URL),session(theinvalidSessionmessage, or the 410 status and body),api-key(thekeyAuthenticateFailedorkeyAuthorizeFailedmessage),wire(thetooManyWiresmessage) andgateway(the network id and the wait; no reply exists to carry). A successful login resolveslogin;openWireSucceedresolvessession,api-keyandwire; a successful network read also resolvessession - The network's
CommunicationState: Okay once the wire is open and a gateway has been seen on that connection. Error whilelogin,session,api-keyorwireis raised, whether the socket is connected, closed or disconnected by the driver, and from the momentgatewayis 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, oninvalidValueTypeorinvalidData, with the reply and the last command sent) andwire-status(momentary, on awireStatusthe driver does not know) - Details: network id, name, revision, grade, type, timezone and gateway name from the network read; "Wire Status" holds the last
wireStatusmessage about the wire itself and is removed when the socket's connection state changes; "Last Peer Change" holds the lastpeerChangedmessage - Network functions:
RecallScene(sceneId, level),SetGroupLevel(groupId, level),SetNetworkLevel(level)andSetUnitsLevel(unitIds, level), levels 0–100.Scenes,GroupsandUnitshold the network's lists, each with a change handler.PowerOnandPowerOffon 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,PowerOffandRecallPreseton a light record theirLightevent 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
CasambiLighttakesBrightnessfromdimLevel,PowerStatefromon(fromdimLevelwhen the event has noon) andCommunicationStatefromonline. A unit going offline is logged as a warning with the event. The light is Unknown while the socket is not connected.PowerOnsends Dimmer 1 andPowerOffDimmer 0.Presets()lists the network's scenes that hold the unit, andRecallPresettakes the scene id- Colour and other controls:
SetColourTemperature,SetHueSaturation,SetRgb,SetXy(Casambi marks XY as experimental),SetColourBalance,SetSlider,SetOnOffandSetDimmer(index, level).ColourTemperature,ColourSource,Rgb,Xy,HueSaturation,Slider,ColourBalance,OnOffandActiveSceneIdfollow the unit's events, each with a change handler - A unit
statusother thanok, or aconditionother than 0, 128 or 160, raises a Majorunit-statusissue (Minor forconfiguration_failed) until the unit reports okay. A light whose unit id is not in the network raisesunit-not-foundlisting the network's unit ids. Unit identity, status, condition and the event'sdetailsshow as details - A
unitChangedfor 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 | Versions 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.
-
net10.0
- AVCoders.Core (>= 2026.12.2)
-
net8.0
- AVCoders.Core (>= 2026.12.2)
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