genielabs / zwave-lib-dotnet Goto Github PK
View Code? Open in Web Editor NEWZ-Wave Home Automation library for .NET / Mono
License: Apache License 2.0
Z-Wave Home Automation library for .NET / Mono
License: Apache License 2.0
I get a 'Method not found' exception if I try to use version1.0.19 with your latest SerialPortLib, also 1.0.19:
Method not found: 'Void SerialPortLib.SerialPortInput.SetPort(System.String, Int32, System.IO.Ports.StopBits, System.IO.Ports.Parity)'. (MissingMethodException)
but not if I go back to SerialPortLib 1.0.18
Using VS2019, building for .NET Framework 4.7.2.
I get a 'Method not found' exception if I try to use version1.0.18 with your latest SerialPortLib, also 1.0.18:
Method not found: 'Void SerialPortLib.SerialPortInput.SetPort(System.String, Int32, System.IO.Ports.StopBits, System.IO.Ports.Parity)'. (MissingMethodException)
but not if I go back to SerialPortLib 1.0.16.
With SerialPortLib 1.0.16, I can connect to my Z-Stick Gen5, but calling Discovery gives:
Could not load file or assembly 'mscorlib.XmlSerializers, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.
which I don't know how to sort out - anyone else getting this?
Using VS2019, building for .NET Framework 4.6.2.
Thanks,
Jim
My Z-stick is assigned COM7 ... I tried "COM7", "com7", "COM7COM", can't get it to work on Windows in C#... am I being dense? It shows 0 nodes and not connected but if I load it in Axial Server I see my irrigation controller.
Sorry for what is probably a silly question. How would one issue a color switch command(to change the color of an Aeotec Gen 6 multi-color bulb)? I see there is not a specific class for it. Any specific suggestions on how to do this? Asking at the front end of my search and tinkering efforts, so I will post back here if I find a route. Otherwise I'd welcome any tips :)
Thanks!
Hello,
Thank you for the project. Something has to be taken into consideration when using the Raspberry PI, the Gen5 stick lights up wildly all the time. After establishing the connection, the connection will break off again. With the Discovery no devices are found, over Windows it runs normally.
Kind regards
Frank Dörsam
This issue crashes the zwave lib:
Parameter name: index
at System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) [0x00029] in <204f770036d441bb8dfd3daba3550e83>:0
at System.ThrowHelper.ThrowArgumentOutOfRangeException () [0x00000] in <204f770036d441bb8dfd3daba3550e83>:0
at System.Collections.Generic.List`1[T].RemoveAt (System.Int32 index) [0x00009] in <204f770036d441bb8dfd3daba3550e83>:0
at ZWaveLib.CommandClasses.WakeUp.ResendOnWakeUp (ZWaveLib.ZWaveNode node, System.Byte[] msg) [0x0008c] in <0bdcd40ad78345dabdc1e0555226f3eb>:0
at ZWaveLib.ZWaveController.QueueMessage (ZWaveLib.ZWaveMessage message) [0x000b0] in <0bdcd40ad78345dabdc1e0555226f3eb>:0
at ZWaveLib.ZWaveNode.SendMessage (System.Byte[] message) [0x0000a] in <0bdcd40ad78345dabdc1e0555226f3eb>:0
at ZWaveLib.ZWaveNode.SendDataRequest (System.Byte[] request) [0x00039] in <0bdcd40ad78345dabdc1e0555226f3eb>:0
at ZWaveLib.CommandClasses.Version.Get (ZWaveLib.ZWaveNode node, ZWaveLib.CommandClass cmdClass) [0x00001] in <0bdcd40ad78345dabdc1e0555226f3eb>:0
at ZWaveLib.ZWaveController.GetNodeCcsVersion (ZWaveLib.ZWaveNode zn) [0x0006c] in <0bdcd40ad78345dabdc1e0555226f3eb>:0
at ZWaveLib.ZWaveController.Discovery () [0x00184] in <0bdcd40ad78345dabdc1e0555226f3eb>:0
at MIG.Interfaces.HomeAutomation.ZWave.Controller_ControllerStatusChanged (System.Object sender, ZWaveLib.ControllerStatusEventArgs args) [0x00072] in <1c438fb48a17499baf12c74b98118c9e>:0
at ZWaveLib.ZWaveController.OnControllerStatusChanged (ZWaveLib.ControllerStatusEventArgs args) [0x00044] in <0bdcd40ad78345dabdc1e0555226f3eb>:0
at ZWaveLib.ZWaveController.Initialize () [0x00052] in <0bdcd40ad78345dabdc1e0555226f3eb>:0
at MIG.Interfaces.HomeAutomation.ZWave.Controller_ControllerStatusChanged (System.Object sender, ZWaveLib.ControllerStatusEventArgs args) [0x0002e] in <1c438fb48a17499baf12c74b98118c9e>:0
at ZWaveLib.ZWaveController.OnControllerStatusChanged (ZWaveLib.ControllerStatusEventArgs args) [0x00044] in <0bdcd40ad78345dabdc1e0555226f3eb>:0
at ZWaveLib.ZWaveController.SerialPort_ConnectionStatusChanged (System.Object sender, SerialPortLib.ConnectionStatusChangedEventArgs args) [0x00033] in <0bdcd40ad78345dabdc1e0555226f3eb>:0
at SerialPortLib.SerialPortInput.OnConnectionStatusChanged (SerialPortLib.ConnectionStatusChangedEventArgs args) [0x0001f] in <fcc2756efd80414a84241ec0b47e73d4>:0
at SerialPortLib.SerialPortInput.Open () [0x0014d] in <fcc2756efd80414a84241ec0b47e73d4>:0
at SerialPortLib.SerialPortInput.Connect () [0x00029] in <fcc2756efd80414a84241ec0b47e73d4>:0
at ZWaveLib.ZWaveController.<Connect>m__0 () [0x00001] in <0bdcd40ad78345dabdc1e0555226f3eb>:0
at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00014] in <204f770036d441bb8dfd3daba3550e83>:0
at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00071] in <204f770036d441bb8dfd3daba3550e83>:0
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <204f770036d441bb8dfd3daba3550e83>:0
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x0002b] in <204f770036d441bb8dfd3daba3550e83>:0
at System.Threading.ThreadHelper.ThreadStart () [0x00008] in <204f770036d441bb8dfd3daba3550e83>:0
When the Aeotec Multisensor 6 submits its UV value, the event is not processed by ZWaveLib.
Its code is 27 and seems to be missing/unhandled in SensorValue.cs.
Most of all I would like to get rid of the message but actually fully supporting this (quite common) device would be nice.
Anyone keen on looking into that or should I go ahead and have a look and create a PR?
Are there any plans for new releases? The NuGet package is quite stale compared to the repo.
Thank you.
I tried the example code from the home page and experienced two issues:
1- There is a typo error in the following code in the line "SwitchMultiLevel.Set(dimmer, 50);". The "L" must be lowercase.
2- The real issue: On my computer the variable "dimmer" (line 14) is not initialized. For some reason it keeps the "null" value. So the next line (SwitchMultilevel.Set(dimmer, 50);) throw a NullReferenceException.
I've double checked my port and node numbers and they are correct.
Hello,
Looking through the source, I see a lot of mention, relating to security, encryption keys and what not.
However, the public methods that are available under the ZWaveController do not reveal any methods to control security.
i.e Starting Secure Include, Setting the encryption key etc etc.
Question.
Does your Lib support Secure include, setting the key, and operating secure devices?
Would appreciate a response.
I was wondering if there is support for COMMAND_CLASS_CENTRAL_SCENE.
I now own a ZRC-90 scene master, but it only uses the Central Scene command class, as it looks now it is not yet supported by this lib...
At the OpenZWave issues I've found the following for implementation: OpenZWave/open-zwave#367 (comment)
I am attempting to add the command class myself, when successful I will create a pull request :)
Hello,
Are the some Examples from get the Motion And battery only to console. To read when a event happens and te state of the battery. I think I am doing too hard myself.
So I hope somebody can give me a good Example
When I dispose the ZWaveController the serial port sometimes stays open / cannot be opened again.
Sometimes a Thread.Sleep helps before opening the port again, but sometimes it doesn't and the port stays open forever.
Is this a known problem / what can I do about it?
Thank you for this library, it’s really jumpstarted my project and saved me a ton of time. I’ve not found a way to individually poll nodes to get their current status. It looks like OpenZWave does support it-is it included in this library? Thank you for your time.
For netcore >= 3 use System.IO.Ports as it works out-of-the box on all platforms.
Hi,
it is possible to license the library unter LGPL license (or another more permissive license like MIT)?
Hi,
for a few years I'm developing my own home automation system (just for me and a few friends, nothing commercial) with my own hardware and own protocol. The central packet routing and logic software is written by me in C#.
For a few devices that I can't build myself (anything switching mains power and anything that must look nice like radiator valves, window sensors, ...) I would now like to include support for Z-Wave devices.
I have come across this library. There are a few more out there but so far I like this one best because it seems to be pure .NET managed code, not just a wrapper around C++ code.
However, what I'm missing is documentation and/or more sample code. The sample on the main page here shows how to set a thermostat setpoint (which is exactly what I'm trying to test first). What I'm currently missing is some sample code showing how to read / Get values. Does anyone have any simple sample code for that, please?
Hello,
I am currently facing issues with motions sensors notifications with a Fibaro FGMS-001 (I did try with another motion sensor with the same result).
How am I supposed to be notified when a motion is detected? I thought it would work with the "NodeUpdated" callback from ZWaveController but it never raises such event.
I dit try to use SensorBinary.Get(node) but as a result I am notifiied that the device is in sleeping mode.
Thank you.
Jérémy
I had posted a bounty on this... I don't see that this is something supported by the library yet?
Are the any plans go for a .Net Core version ?
Hello,
I begin with a huge thanks for this zwave lib project.
I have successfully integrated this into a .net executable, which is actually the bases of a Node-Red node. allowing zwave functionality in Node-Red - it works really really well.
you are of course credited.
I do however have a question:
For battery operated devices - I seem to not be able to get messages out to such device.
looking through the source code, it seems to reference queuing the message, if its not awake.
Later, when such devices wake up - my message does not seem to get sent, so I resort in sending messages, upon receiving the Wake Interval event, as a-posed to the lib queuing a message.
Am I missing something here, or does the lib not actually queue anything?
Many Thanks
I recently upgraded my HomeGenie from a Pi2 to a faster Pi4, while continuing to use an old Aeon stick as the controller. This has resulted in many more fragmented Zwave frames. SOF frames are handled ok, but if an ACK is fragmented, the code incorrectly handles it, as follows. A normal ACK frame is traced as 06-01-04-01-13-01-E8.
2022-12-25 07:59:21.2557 Trace [[[ BEGIN REQUEST ]]]
2022-12-25 07:59:21.2557 Trace WaitAck
2022-12-25 07:59:21.2557 Trace Sending Message (Node=39
2022-12-25 07:59:21.2557 Debug 01-0E-00-13-27-07-60-0D-00-02-25-01-00-05-3B-B7
2022-12-25 07:59:21.2630 Debug 06-01-04 // Start of ACK
2022-12-25 07:59:21.2630 Debug ZWaveMessage (RawData=01-04)
2022-12-25 07:59:21.2630 Debug ZWaveMessage (Direction=Inbound
2022-12-25 07:59:21.2630 Debug 15
2022-12-25 07:59:21.2630 Warn Bad message checksum
2022-12-25 07:59:21.2630 Debug 01-13-01-E8 // Remainder of ACK
2022-12-25 07:59:21.2630 Trace Expected message length is 21
2022-12-25 07:59:21.3637 Debug 01-04-01-13-01-E8
2022-12-25 07:59:21.3637 Trace Merged buffer to message: 01-13-01-E8-01-04-01-13-01-E8
2022-12-25 07:59:21.3637 Trace Expected message length is 21
2022-12-25 07:59:22.7655 Debug 01-04-01-13-01-E8
2022-12-25 07:59:22.7655 Trace Merged buffer to message: 01-13-01-E8-01-04-01-13-01-E8-01-04-01-13-01-E8
In fact the logic in ParseSerialBuffer() looks very strange.
The library does allow the controller to add the Fibaro Dimmer 2 node and lists it as follows:
Node
4
___Manufacturer Specific 010F-0102-1000
___Basic Type None
___Generic Type None
___Specific Type 0
___Secure Info Frame
___Info Frame 04-11-01-5E-86-72-59-73-22-31-32-71-56-98-7A
___Node Version info:
______LibraryType 3
______ProtocolVersion 4
______ProtocolSubVersion 5
______ApplicationVersion 3
______ApplicationSubVersion 4
As you can see Generic Type is set to None stopping me from sending the SwitchMultilevel command. Also the commandclasses are empty. Does this has to do witht he fact the Fibaro's are using encryption? As I also have a normal LED light which works just fine:
Node 2
___Manufacturer Specific --
___Basic Type RoutingSlave
___Generic Type SwitchMultilevel
___Specific Type 1
___Secure Info Frame
___Info Frame
___Routing Info 01
There is reference to SerialPortLib (SerialPortInput class) but it doesn't resolve. Where do I find this library?
Thanks,
Bob
Hi,
first congratulation for your development , i am begining with zwave in c# with usbzwavegateway.
i amb integrating one element but i have one problem :
i amb integrated a qubino flush on/off thermostat, i amb reading the temperature, the status, the energy…… but i can read the two binary sensors it have I2 and I3
Qubino_Flush_on_off_thermostat_user-manual_V1.6_eng.pdf
in the attached file you can find the documentation of the element.
can you help me?
thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.