Here you go gentlemen. Import this flow and change the details to match your setup and you’re all set.
First you need to create a group of all your lights. I called mine group.goodnight_lights
The get entities node checks every entity in the group to match what state you choose. So in this case, the “on” state.
It then outputs the matching entities into a join node where it creates a string. light.kitchen, light.bedroom, light.living_room etc…
And then it uses that string to send the off commands to the lights.
You can use this for locks, covers, media_players. Essentially any group of entity and only send the command to the ones that need it, drastically reducing traffic on the network and making everything so much faster.
[{"id":"393e066b.78413a","type":"ha-get-entities","z":"a8efc4c6.6fe918","name":"Which Lights?","server":"94fdcfdf.a00b","version":0,"rules":[{"property":"entity_id","logic":"in_group","value":"group.goodnight_lights","valueType":"str"},{"property":"state","logic":"is","value":"on","valueType":"str"}],"output_type":"split","output_empty_results":false,"output_location_type":"msg","output_location":"payload","output_results_count":1,"x":400,"y":260,"wires":[["bef4604a.81564"]]},{"id":"bef4604a.81564","type":"template","z":"a8efc4c6.6fe918","name":"Format Msg","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{payload.entity_id}}","output":"str","x":610,"y":260,"wires":[["46e1c983.10f708"]]},{"id":"46e1c983.10f708","type":"join","z":"a8efc4c6.6fe918","name":"","mode":"custom","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":", ","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":750,"y":260,"wires":[["7d9b910b.9eee2"]]},{"id":"7d9b910b.9eee2","type":"api-call-service","z":"a8efc4c6.6fe918","name":"Turn Off Lights","server":"94fdcfdf.a00b","version":3,"debugenabled":false,"service_domain":"light","service":"turn_off","entityId":"","data":"{\"entity_id\":\"{{payload}}\"}","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":900,"y":260,"wires":[[]]},{"id":"94fdcfdf.a00b","type":"server","name":"Home Assistant","version":1,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]
And if you’re looking to trigger this from an Inovelli device, add this to your pallet in node-red.
node-red-contrib-ha-inovelli-manager (node) - Node-RED (nodered.org)
The scene manager node has all the possible click configurations already setup for you so you just need to run your zwavejs event into it and then select the right output based on how many clicks up or down.