I have created a basic automation with one action:
action: light.toggle
metadata: {}
target:
area_id: bedroom
data: {}
When I run this action, the lights will turn on successfully. However, when I run it again (attempting to turn all the lights OFF), none of the lights turn off if there are any devices are are disconnected or unavailable. I had temporarily unplugged a lamp and was confused why my light remote was no longer working.
I can make my own toggle and run light.turn_off and light.turn_on, but I couldn't figure out a way to straightforwardly check the light on/off state for an Area. I could do it by picking some or all of the lights and checking them manually, but that won't dynamically update when I add lights to the room.
Is there a trick here? How can I robustly toggle my dang lights without making it a custom mess?