RepositoryC#
genielabs

genielabs/zwave-lib-dotnet

Z-Wave Home Automation library for .NET / Mono

62stars
37forks
7issues
0views

Build status NuGet License

Z-Wave Home Automation library for .NET

Features

  • Works with most Z-Wave serial controllers
  • Event driven
  • Hot plug
  • Automatically restabilish connection on error/disconnect
  • 100% managed code implementation
  • Compatible with Mono

Ask DeepWiki

NuGet Package

ZWaveLib is available as a NuGet package.

Run Install-Package ZWaveLib in the Package Manager Console or search for “ZWaveLib” in your IDE’s package management plug-in.

Example usage


// Initialize the ZWaveController

var controller = new ZWaveController(serialPortName);

// Register the Controller event handlers (see methods example below)

controller.ControllerStatusChanged += Controller_ControllerStatusChanged;;
controller.DiscoveryProgress += Controller_DiscoveryProgress;
controller.NodeOperationProgress += Controller_NodeOperationProgress;
controller.NodeUpdated += Controller_NodeUpdated;

// Open connection
controller.Connect();

// Issue some commands on a dimmer and a thermostat node

var dimmer = controller.GetNode(4);
// Set dimmer level to 50
SwitchMultilevel.Set(dimmer, 50);

var thermostat = controller.GetNode(10);
// Configure the Set Point
ThermostatSetPoint.Set(thermostat, ThermostatSetPoint.Value.Heating, 21);
// Set the Thermostat mode to Heat
ThermostatMode.Set(thermostat, ThermostatMode.Value.Heat);
// Or turn it off
ThermostatMode.Set(thermostat, ThermostatMode.Value.Off);

// Controller event handlers

void Controller_ControllerStatusChanged (object sender, ControllerStatusEventArgs args)
{
    Console.WriteLine("ControllerStatusChange {0}", args.Status);
    var controller = (sender as ZWaveController);
    switch (args.Status)
    {
    case ControllerStatus.Connected:
        // Initialize the controller and get the node list
        controller.Initialize();
        break;
    case ControllerStatus.Disconnected:
        break;
    case ControllerStatus.Initializing:
        break;
    case ControllerStatus.Ready:
        // Query all nodes (Supported Classes, Routing Info, Node Information Frame, Manufacturer Specific)
        controller.Discovery();
        break;
    case ControllerStatus.Error:
        break;
    }
}

void Controller_DiscoveryProgress(object sender, DiscoveryProgressEventArgs args)
{
    Console.WriteLine("DiscoveryProgress {0}", args.Status);
    var controller = (sender as ZWaveController);
    switch (args.Status)
    {
    case DiscoveryStatus.DiscoveryStart:
        break;
    case DiscoveryStatus.DiscoveryEnd:
        break;
    }
}

void Controller_NodeOperationProgress(object sender, NodeOperationProgressEventArgs args)
{
    // this will fire on a node operation such as Add, Remove, Updating Routing, etc..
    Console.WriteLine("NodeOperationProgress {0} {1}", args.NodeId, args.Status);
}

void Controller_NodeUpdated(object sender, NodeUpdatedEventArgs args)
{
    // this will fire when new data is received from a node such as level, temperature, humidity, etc...
    Console.WriteLine("NodeUpdated {0} Event Parameter {1} Value {2}", args.NodeId, args.Event.Parameter, args.Event.Value);
}

Who's using this library?

Similar Projects

Discover other similar projects and AI models.

RepositoryC++
OpenZWave/open-zwave

a C++ library to control Z-Wave Networks via a USB Z-Wave Controller.

1.1k
Mar 26, 2024
RepositoryTypeScript
zwave-js/zwave-js

Modern and standards-compliant Z-Wave device driver that runs almost anywhere

899
Nov 28, 2026
RepositoryJinja
hassio-addons/app-zwave-js-ui

Z-Wave JS UI - Home Assistant Community Apps

173
Nov 27, 2026
Repository
unixorn/home-assistant-compatibility-guide

Equipment and software that works with Home Assistant. And stuff that didn't so we can avoid it.

85
Nov 23, 2026
RepositoryShell
kpine/zwave-js-server-docker

A minimal docker container for zwave-js-server

59
Nov 13, 2026
RepositoryJavaScript
react/react

The library for web and native user interfaces.

253.0k
Nov 30, 2026
RepositoryTypeScript
morluto/rea

Reverse engineer anything with agents, from app behavior down to native binaries.

487.0k
Dec 2, 2026
RepositoryPython
yt-dlp/yt-dlp

A feature-rich command-line audio/video downloader

212.4k
Dec 2, 2026
RepositoryMarkdown
DigitalPlatDev/FreeDomain

Free domain registration and practical DNS learning resources for everyone.

209.9k
Aug 12, 2026