Source Code for Virtual Device performCommand("update")

Discussions about Z-Way software and Z-Wave technology in general
Post Reply
markolbert
Posts: 64
Joined: 16 Oct 2014 06:09

Source Code for Virtual Device performCommand("update")

Post by markolbert »

I am trying to write a switch-polling routine in nodejs which interfaces with the zway automation engine. I'm doing this because I'm using American switches which do not have a hail controller/notify controller of level change capability built-in.

My first attempt apparently overloaded some part of the zway system, or perhaps the Razberry, because I saw a lot of spurious results in the logging routine I'd written (e.g., multiple consecutive postings, within seconds, of "switch level changed to 255" followed by "switch level changed to 0", when the switch was off the whole time -- and when I was only polling every couple of minutes).

My basic algorithm is to call Get() to have the controller ping the switch for its level (e.g., via doing a POST to /Run/devices[<node#>].instances[0].commandClasses[0x20].Get()) and retrieving the level value (e.g., via a POST to /Run/devices[<node#>].instances[0].commandClasses[0x20].data.level.valueOf()). The second POST only gets submitted after the first POST returns.

I know there's a SwitchPolling module which does pretty much the same thing. What I'd like to do is compare how >>it<< gets the level values to what I'm doing to see if I can figure out where the problems are. Unfortunately, SwitchPolling does all that through a virtual device call to performCommand("update")...and I can't find the source code for that update command.

Can someone either point me to where it is in the zway software? Or share it via a reply here? Thanx!
Post Reply