Node-RED & hass Example: multicast_set_value with LZW30 & LZW30-SN

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 :slight_smile:

4 Likes

Cool! What’s the benefit to multicast in this case? Quicker than iterating over the individual entities?

I’m not too sure I see the point of setting LED color and brightness every day? Are you having an issue where your switches are losing this setting? I set my default LED settings when they’re included and haven’t had to touch them since.

Also, have you seen this set of nodes that can be added to the pallet?
node-red-contrib-ha-inovelli-manager

There’s an LED manager node there for setting default LED settings. Also a scene manager and notification manager node. And the dev added multicast compatibility :slight_smile: What I’m not sure of is if it can accept a comma separated list as a msg, but I’m sure the dev would add it if it’s got a use.

Primarily as right now, my setup is very much in flux and constantly changing. We just built and it seems that I’m putting in new hardware nearly daily. In reality, I’ll move this to weekly or even longer (or ad-hoc) once things are stable. But regardless, with multicast, it’s such an easy and low-overhead operation that even doing it daily or less would be just fine.

Basically zwave multicast sends the same command to multiple or many devices at the exact same time. So instead of “turn on light 1, then turn on light 2, then turn on light 3”, which means there’s a delay between calls - with zwave multicast all three lights turn on at nearly exactly the same time. It just feels a lot faster and cleaner.

I’ve heard that there’s less network overhead with it as well, but that’s beyond my level of understanding :wink: