If you are using ZWaveJS2MQTT to handle the other side of your ZWaveJS Integration, I found a decent workaround for the lack of ability to send Configuration Commands.
Thanks for this…
I thought I would add, at least in my case, that you can also use the ZWaveJS2MQTT GUI to do configurations. If you have the logs turned on, you can also see what the corresponding api call looks like.
yes! of course! I meant, if you wanted to send configuration commands from an automation or some script, this is the only way I’ve found to be able to do so.
It is communicating with zwavejs2MQTT and these are the log entries when I send the message and when I change the parameter in zwavejs2MQTT itself
------------------ Node-RED -----------------------------
2021-02-24 18:25:22.558 INFO MQTT: Message received on zwavejs2mqtt//_CLIENTS/ZWAVE_GATEWAY-zwavejs2mqtt/api/writeValue/set, ‘{“args”:[{“nodeId”:6,“commandClass”:112,“endPoint”:0,“property”:19},99]}’
----------------- Zwavejs2MQTT ------------------------
2021-02-24 18:25:31.304 INFO ZWAVE: Calling api writeValue with args: [ { nodeId: 6, commandClass: 112, property: 19 }, 99, [length]: 2 ]
2021-02-24 18:25:31.304 INFO ZWAVE: Writing 99 to 6-112-0-19
2021-02-24 18:25:31.335 INFO ZWAVE: Success zwave api call writeValue { success: true, message: ‘Success zwave api call’, result: undefined }
2021-02-24 18:25:32.376 INFO ZWAVE: Node 6: value updated: 112-0-19 99 => 99
I got a Popp Strike Lock and the only way to use the auto-close function is a workaround with a config parameter. I need to set targetMode (red circle) to 1 for the lock to stay open for 4 seconds. The Plan is to map this command to a button, which is useable in the UI or use the command in further automations. The problem is with zwave_js.set_config_parameter youre only able to set the parameters in configuration (blue outline).
Having some issues getting this to work.
So I ran the command in the configuration and this it what it looked like:
2021-03-12 14:11:37.354 INFO ZWAVE: Calling api writeValue with args: [
{ nodeId: 21, commandClass: 121, endpoint: 1, property: ‘toneId’ },
1,
[length]: 2
]
2021-03-12 14:11:37.363 INFO ZWAVE: Writing 1 to 21-121-1-toneId
2021-03-12 14:11:37.491 INFO ZWAVE: Success zwave api call writeValue { success: true, message: ‘Success zwave api call’, result: undefined }
Then I tried to recreate that in scripts and I put this in as the payload:
{args: [ { nodeId: 21, commandClass: 121, endpoint: 1, property: ‘toneId’ }, 1,[length]: 2 ]}
With this as the topic:
zwave/_CLIENTS/ZWAVE_GATEWAY-21/api/writeValue/set
And I get this as the log:
2021-03-12 14:23:27.526 INFO APP: GET /health/zwave 200 1.601 ms - 1875
2021-03-12 14:24:42.496 INFO MQTT: Message received on zwave/_CLIENTS/ZWAVE_GATEWAY-21/api/writeValue/set, “{args: [ { nodeId: 21, commandClass: 121, endpoint: 1, property: ‘toneId’ }, 1,[length]: 2 ]}”
2021-03-12 14:24:42.502 INFO ZWAVE: Calling api writeValue with args: [ [length]: 0 ]
2021-03-12 14:24:42.503 INFO ZWAVE: Cannot read property ‘nodeId’ of undefined writeValue {
success: false,
message: “Cannot read property ‘nodeId’ of undefined”
}
I’m certain it is a formatting error, but not sure what I am doing in correct in the formatting.
I’m not sure why but the trick for me was to remove the length part. Plus, you’ll need to put each key in quotes (I use double-quotes) and wrap the whole thing in another quote (single-quote) (and I also changed your toneId from single to double-quotes):
i.e. '{args: [ { "nodeId": 21, "commandClass": 121, "endpoint": 1, "property": "toneId" }, 1 ] }'
The blue one is not useable and wont react on lock.unlock service.
The red one works but without automatic closing, lock.unlock => stays open forever, lock.lock => buzzer goes off again.
Right now, Im just using a script with lock.unlock, wait 5 seconds and then lock.lock (on the red marked entity). This works but the downside is, that this method is prone to connectivity issues. If the lock.lock command won’t be received from the lock, it will be buzzing forever. The strike lock is operating in my garden door and it is buzzing really loud, plus it is around 60 meters away from my house (front yard), which means that I will not hear it, but my neighbors will