node-openzwave icon indicating copy to clipboard operation
node-openzwave copied to clipboard

added _instance to SetValue to support multi-instance devices

Open ekarak opened this issue 11 years ago • 4 comments

Hi Jonathan, This patch is to let node-openzwave properly control multi-instance devices such as the Fibaro FGS-221 (double in-wall relay switch). It adds the missing "_instance" part of the OZW ValueId.

zwave.setValue(8, 37, 0, 1, true/false); // control 1st relay of node #8 zwave.setValue(8, 37, 0, 2, true/false); // control 2nd relay of node #8

This patch also tightens the search for ValueIds for switchOn/Off and setLevel so that they only apply affect the valueID with instance and index values of 0. This was necessary as a switchOn command affected both relays.

ekarak avatar Jul 15 '14 18:07 ekarak

Thanks! I don't currently have devices at home I can test this on to ensure it doesn't break existing, will see if I can get some and integrate this.

jperkin avatar Jul 15 '14 18:07 jperkin

ooops seems like I broke the other nodes :) - I have to amend this patch...

ekarak avatar Jul 15 '14 19:07 ekarak

OK, fixed it, the default index value for ValueId's is 1 (its apparently not 0-based). Now I can control both single and multi-instance devices. I've also updated the README.

Cheers!

ekarak avatar Jul 16 '14 17:07 ekarak

KNX+Zwave working together in harmony in Node-Red: https://groups.google.com/forum/#!topic/node-red/LKJEFYZG7MY that's what I like about Open source: Combining the effort!

2014-07-15 21:58 GMT+03:00 Jonathan Perkin [email protected]:

Thanks! I don't currently have devices at home I can test this on to ensure it doesn't break existing, will see if I can get some and integrate this.

— Reply to this email directly or view it on GitHub https://github.com/jperkin/node-openzwave/pull/31#issuecomment-49076927.

Elias Karakoulakis Electrical & Computer Engineer NTUA Athens Msc Information Systems, AUEB Athens KNX Advanced Partner

ekarak avatar Sep 23 '14 18:09 ekarak