Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A Z-Wave JS wrapper for the .NET Framework. Supporting various targets, and providing a feature rich Z-Wave API.

License

NotificationsYou must be signed in to change notification settings

zwave-js/ZWaveJS.NET

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image

ZWaveJS.NET

NugetNugetDeepScan gradeGitHub issuesGitHub closed issues

ZWaveJS.NET is a class library developed for the .NET framework family, that opens up the zwave-js Driver in .NET, allowing its runtime to be used directly in .NET applications.

Supported Targets

  • NET 4.5
  • NET 4.8
  • NET 5.0
  • NET Standard 2.0
  • NET Standard 2.1
  • NET Core 3.1

The library strictly follows the structure of the zwave-js API.

Examples:

Driver.Controller.BeginHealingNetwork()Driver.Controller.Nodes.Get(4).GetDefinedValueIDs()Driver.Controller.Nodes.Get(4).SetValue(ValueIDValueID,objectValue,SetValueAPIOptionsOptions=null)Driver.Controller.Nodes.Get(4).GetEndpoint(2).InvokeCCAPI(intCommandClass,stringMethod,paramsobject[] Params)

Features

  • Controller

    • Controller Info
    • NVM Restore/Backup
    • Network Statistics
    • Node Inclusion (Unsecured, S0 & S2 Security)
    • Smart Start
    • Smart Start Provisioning entry management
    • Node Exclusion
    • Network Healing
    • Remove Failed Node
    • Replace Failed Node
    • Multicast support
    • Node added/removed events
    • Inclusion/Exclusion started/stopped events
    • Network Heal progress/completed events
    • Network statistics updated events
  • Node

    • Node Info
    • Network Health Checks
    • Network Statistics
    • Updating, Polling & Fetching Values
    • CCAPI Invoke (and its endpoints)
    • Obtain Value IDs
    • Obtain Value Metadata
    • Interview Node
    • Association Management
    • Firmware Updates
    • Node Ready, Asleep, Awake & Dead events
    • Value Updated, Notification & Value Notification events
    • Interview Started, Completed & Failed events
    • Node Network Statistics updated events

Getting Started.

The library can operate in 2 ways: Client or Self Hosted.

Client
The library will connect to an already running instance ofzwave-js-server.

Self Hosted
The library will host its own zwave-js instance.
You might ask, if in this mode,nodejs andnpm is needed on the host system - it is not!

This is all possible with an accompanying file -server.psi. (Platform Support Image)

Its an executable that is running silently/hidden,
and it contains everything necessary for .NET to work with zwave-js.

server.psi files are platform specific, but the assembly isn't - it will run on windows, OSX and Linux, and the platform specifics i.enode are contained inserver.psi.

Prebuilt PSI's

  • Windows x64
  • MacOS x64 (Should support Apple Silicon via Rosetta 2)
  • Ubuntu Linux x64
  • Debian ARM64

Building yor own platform specific binary.

To build an image for your platform:

  • Clone the repo
  • cd to./PSI
  • runyarn install --immutable
  • and finallyyarn run build
  • renamedist/server toserver.psi, and distrubute with your application/dll.

Every release will include a set of PSI images, so download the one for your platform, and rename it toserver.psi, and ensure its in the same location as the dll.

There is also a Helper method that pulls down the correct image if one is neededZWaveJS.NET.Helpers.DownloadPSI()

server.psi is not needed, if using the library in Client Mode.

The class library contains most of the methods you will need, from including a secure device, to removing it.

Installing.

All releases will be published to nuget, so search forZWaveJS.NET and install it, thenupkg file will also be attached to the release here, on Github, along with the platform PSI files.

Brief Example

staticZWaveJS.NET.Driver_Driver;staticvoidMain(string[]args){// Set encryption keys, enable logging, adjust network timeouts so on and so forth.ZWaveJS.NET.ZWaveOptionsOptions=newZWaveJS.NET.ZWaveOptions();// Create Driver Instance_Driver=newDriver("COM7",Options);// Subscribe to driver ready_Driver.DriverReady+=_Driver_DriverReady;_Driver.Start();}privatestaticvoid_Driver_DriverReady(){// Update a valueZWaveJS.NET.ValueIDVID=newZWaveJS.NET.ValueID();VID.commandClass=135;VID.property="value";VID.endpoint=0;// Support for set Value OptionsZWaveJS.NET.SetValueAPIOptionsSVO=newZWaveJS.NET.SetValueAPIOptions();SVO.transitionDuration="2s";SVO.volume=30;// All methods returns a task, as to not block the UI_Driver.Controller.Nodes.Get(4).SetValue(VID,200,SVO).ContinueWith((res)=>{if(res.Result.Success){Console.WriteLine("Value Updated");}});// Listen for Value Updates on a node_Driver.Controller.Nodes.Get(3).ValueUpdated+=Program_ValueUpdated;_Driver.Controller.Nodes.Get(3).Notification+=Program_Notification;// Or All of themZWaveJS.NET.ZWaveNode[]Nodes=_Driver.Controller.Nodes.AsArray();foreach(ZWaveJS.NET.ZWaveNodeNodeinNodes){Node.ValueUpdated+=Program_ValueUpdated;Node.Notification+=Program_Notification;}// Other Node methods_Driver.Controller.Nodes.Get(4).GetDefinedValueIDs().ContinueWith((res)=>{// Do something with Value ID's (res.Result)});}privatestaticvoidProgram_ValueUpdated(ZWaveNodeNode,JObjectArgs){// Do something with Args}privatestaticvoidProgram_Notification(ZWaveNodeNode,intccId,JObjectArgs){// Do something with Args}

Network Toolkit Demo Application.

The Network Toolkit Application (NET 4.5) serves as a reference, in how the library can be used, but at the same time, can be used as a tool to manage your network. You can download the toolkit demo from the Release pages here, on Github - The source code is also available.

Image

License

MIT License

Copyright (c) 2021 Marcus Davies

Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.

About

A Z-Wave JS wrapper for the .NET Framework. Supporting various targets, and providing a feature rich Z-Wave API.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors3

  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp