Hi Guys, as the title states, I'm trying to do something very simple, and it's ultimately what my goal is. I created a flow that is very simple for just 2 lights, this would be a pain if I was trying to do this for 3 lights or more. However, I can't even get it working right for 2 lights.
Here's an example of the "sync problem":
I have a button, that toggles a "group.lights", this works well if both lights are in the same state. But if they're not, then one turns on and the other turns off and vice versa.
I created a flow that checks if the first light is OFF, then check if the 2nd is OFF, then turn both ON.
if 1st is OFF but 2nd is ON then turn 2nd OFF.
if 1st is ON and 2nd is ON then turn both OFF
if 1st is ON and 2nd is OFF then turn 1st OFF
The Problem with this flow is that the 1st light never turns OFF.
I'm sure it's something I'm not doing right in node Red, My Flow isn't flowing in the right direction.
See the picture below, (you can see that the "ON" payload gets passed through the OFF, but I just want it to go through the ON instead"
Here are my node:
[{"id":"e4d94fad.c7645","type":"api-call-service","z":"c075f350.79367","name":"Living Room Lamp (Hue Group) turn_on","server":"cd7bc65d.3014a8","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.living_room_lamp_group","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1720,"y":200,"wires":[[]]},{"id":"53d54713.e7d588","type":"api-call-service","z":"c075f350.79367","name":"light.hue_mf_livingroom_tv turn_on","server":"cd7bc65d.3014a8","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.mf_livingroom_tv_hue","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1700,"y":140,"wires":[[]]},{"id":"6b895fc9.ceb7b","type":"api-current-state","z":"c075f350.79367","name":"light.living_room_lamp_group OFF?","server":"cd7bc65d.3014a8","version":1,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"light.living_room_lamp_group","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1340,"y":200,"wires":[["53d54713.e7d588","e4d94fad.c7645"],["ec7b937a.82b8f"]]},{"id":"129b10ac.0a1c8f","type":"api-call-service","z":"c075f350.79367","name":"light.hue_mf_livingroom_tv turn_off","server":"cd7bc65d.3014a8","version":1,"debugenabled":false,"service_domain":"light","service":"turn_off","entityId":"light.mf_livingroom_tv_hue","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1720,"y":280,"wires":[[]]},{"id":"ec7b937a.82b8f","type":"api-call-service","z":"c075f350.79367","name":"Living Room Lamp (Hue Group) turn_off","server":"cd7bc65d.3014a8","version":1,"debugenabled":false,"service_domain":"light","service":"turn_off","entityId":"light.living_room_lamp_group","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1740,"y":340,"wires":[[]]},{"id":"2333401.9c194c","type":"api-current-state","z":"c075f350.79367","name":"light.mf_livingroom_tv_hue OFF?","server":"cd7bc65d.3014a8","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is_not","override_topic":false,"entity_id":"light.mf_livingroom_tv_hue","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":920,"y":220,"wires":[["6b895fc9.ceb7b"],["631eec24.a6ee44"]]},{"id":"631eec24.a6ee44","type":"api-current-state","z":"c075f350.79367","name":"light.living_room_lamp_group OFF?","server":"cd7bc65d.3014a8","version":1,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"light.living_room_lamp_group","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1360,"y":280,"wires":[["129b10ac.0a1c8f"],["129b10ac.0a1c8f","ec7b937a.82b8f"]]},{"id":"cd7bc65d.3014a8","type":"server","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":false}]
so ultimately, I want to know how to solve this problem in a more elegant way (ie. to accommodate more lights) but I also want to know why my flow isn't working the way I'm expecting it to.
Thanks!
Dan