zwave-js / node-zwave-js

Z-Wave driver written entirely in JavaScript/TypeScript
https://zwave-js.github.io/node-zwave-js/
MIT License
742 stars 593 forks source link

Should valueSize for parameter 13 of LZW31-SN be 2? #1581

Closed bburan closed 3 years ago

bburan commented 3 years ago

This line suggests that parameter 13 should be 1 byte:

https://github.com/zwave-js/node-zwave-js/blob/910155c88ffb2f8ab6ddce6adc2c0dbb57a135f6/packages/config/config/devices/0x031e/lzw31-sn.json#L151

However, if you look at the Inovelli config file, it says it should be 2 bytes:

https://github.com/InovelliUSA/OpenZWave/blob/master/config/inovelli/lzw31-sn.xml#L119

Setting values for all parameters except parameter 13 seem to work. Parameter 13 just refuses to change. When I attempt to set parameter 13, I get the following from the logfile:

2021-02-02 04:28:34.620 INFO APP: Zwave api call: writeValue [ { nodeId: 13, commandClass: 112, property: 13 }, 179, [length]: 2 ]
2021-02-02 04:28:34.620 INFO ZWAVE: Writing 179 to 13-112-0-13
2021-02-02 04:28:34.687 INFO ZWAVE: Success zwave api call writeValue
2021-02-02 04:28:34.840 INFO ZWAVE: Node 13: value updated: 112-0-13 170 => 170

I'm currently using the dev Docker image of zwavejs/zwavejs2mqtt. I see this file is listed in two places on the Docker image (relative to /usr/src/app):

./node_modules/@zwave-js/config/config/devices/0x031e/lzw31-sn.json
./node_modules/@zwave-js/server/node_modules/@zwave-js/config/config/devices/0x031e/lzw31-sn.json

If I edit these files on the Docker image, will this allow me to test whether it should be 1 byte or 2? Or, do I need to recompile the Docker image to test this?

sneelco commented 3 years ago

I noticed this didn't work either on the lzw31-bsd too but didn't have a chance to dig into it until now. I've confirm @bburan suggestion works by overriding those files to set the size to 2 like the openzwave config has, thanks! I'll put a PR together for both switches once i get my setup configured.