Hey all,
Sharing a quick Node-RED example flow that I use to programmatically set any config parameter needed on my LZW30 & LZW30-SN devices using Home Assistant and zwave_js
:
[{"id":"153f6c24e0560f18","type":"tab","label":"LZW30-SN Config Helper","disabled":false,"info":""},{"id":"2045b06708b89031","type":"api-call-service","z":"153f6c24e0560f18","name":"","server":"c0337d1c.d3c23","version":3,"debugenabled":true,"service_domain":"zwave_js","service":"multicast_set_value","entityId":"{{payload.entity_id}}","data":"{\"command_class\":112,\"endpoint\":0,\"property\":\"5\",\"value\":234}","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1000,"y":400,"wires":[[]]},{"id":"382628cbf3ff6320","type":"ha-get-entities","z":"153f6c24e0560f18","name":"Get Entites (Regex)","server":"c0337d1c.d3c23","version":0,"rules":[{"property":"entity_id","logic":"is","value":"^switch.(?!tv_power)(?!multirelay).+$","valueType":"re"}],"output_type":"split","output_empty_results":false,"output_location_type":"msg","output_location":"devices","output_results_count":1,"x":510,"y":480,"wires":[["9947550571c7aa6d"]]},{"id":"9947550571c7aa6d","type":"join","z":"153f6c24e0560f18","name":"Join Results","mode":"custom","build":"string","property":"payload.entity_id","propertyType":"msg","key":"topic","joiner":", ","joinerType":"str","accumulate":false,"timeout":"2","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":710,"y":480,"wires":[["2045b06708b89031","268f33fbaca56705","f1ca579eb434cb09"]]},{"id":"268f33fbaca56705","type":"api-call-service","z":"153f6c24e0560f18","name":"","server":"c0337d1c.d3c23","version":3,"debugenabled":true,"service_domain":"zwave_js","service":"multicast_set_value","entityId":"{{payload.entity_id}}","data":"{\"command_class\":112,\"endpoint\":0,\"property\":\"6\",\"value\":1}","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1000,"y":480,"wires":[[]]},{"id":"f1ca579eb434cb09","type":"api-call-service","z":"153f6c24e0560f18","name":"","server":"c0337d1c.d3c23","version":3,"debugenabled":true,"service_domain":"zwave_js","service":"multicast_set_value","entityId":"{{payload.entity_id}}","data":"{\"command_class\":112,\"endpoint\":0,\"property\":\"7\",\"value\":5}","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1000,"y":560,"wires":[[]]},{"id":"403334741b0dccf7","type":"inject","z":"153f6c24e0560f18","name":"03:00 Daily","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"00 03 * * *","once":false,"onceDelay":0.1,"topic":"","payloadType":"date","x":310,"y":480,"wires":[["382628cbf3ff6320"]]},{"id":"1ef9cb1cc18319fe","type":"comment","z":"153f6c24e0560f18","name":"LED Color","info":"red=1\norange=21\nyellow=42\ngreen=8\ncyan=127\nblue=170\npink=234\nwhite=255 (Requires Firmware 1.19)","x":1220,"y":400,"wires":[]},{"id":"31aef0461fbf3fce","type":"comment","z":"153f6c24e0560f18","name":"LED Intensity when On","info":"Integer from 0 (off) to 10 (full intensity)","x":1260,"y":480,"wires":[]},{"id":"1b70f0b593499b17","type":"comment","z":"153f6c24e0560f18","name":"LED Intensity when On","info":"Integer from 0 (off) to 10 (full intensity)","x":1260,"y":560,"wires":[]},{"id":"c0337d1c.d3c23","type":"server","name":"Home Assistant","version":1,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]
The flow overview:
- Trigges off a timer (I run it daily or weekly, or even ad-hoc if I add new devices),
- Gets all entities from Home Assistant based on regex name (my switches are ALL LZW30 & LZW30-SN, so this works well for my use case)
- Joins those results to a comma-separated list of
entity_id
values. - Sends
multicast_set_value
calls to set whatever parameters you’d like. Currently configured to send LED Color (parameter 5), LED Intensity while on (parameter 6) and LED Intensity while off (parameter 7).
Hope this helps anyone who’s been interested in zwave multicast