Hi,
My lights have this awesome feature where they remember their previous state between power cycles so that they don’t turn on and wake you up when sleeping during a power outage recovery.
I’d like to keep using that feature, but I also have to keep using basic light switches. If a light is set to off, then the switch is physically turned off, I’d like the light to come back on when the switch is turned back on. However, if the light is set to off and we lose power, I’d like the light to stay off when the power comes back on.
I’m part of the way there, but this automation isn’t complete. How can I edit it to do 3 more things?
-
How can I prevent this automation from running when the house recovers from a power outage as opposed to a person turning the physical switch back on? I was thinking of using the HA Trigger but I’m not sure how to use it in this automation or if there’s a better way.
-
How can I replace the
for:
in the trigger ordelay:
in the action (I’ve tried both) with something more closed loop. Without the for/delay, when HA sends thelight.turn_on
command after seeing the unavailable-to-off state trigger, the light must not actually be ready so it doesn’t respond. The for/delay fixes this, but is there a better way? My lights use ZigBee and since I haven’t moved on from my Philips Hue Bridge V2 yet, my diagnostics are limited. -
I’m relying heavily on the light changing state to unavailable which takes a very long time after the physical switch is turned off. I can see why the state change would be designed that way, but is there some other trigger better suited to what I’m trying to do?
Your help would be greatly appreciated
alias: Light 3 Test
description: ""
trigger:
- platform: state
entity_id:
- light.bedroom_3_light_e
from: unavailable
to: "off"
for:
hours: 0
minutes: 0
seconds: 1
condition: []
action:
# - delay:
# hours: 0
# minutes: 0
# seconds: 1
# milliseconds: 0
- service: light.turn_on
data: {}
target:
entity_id: light.bedroom_3_light_e
mode: single
Once this is working, I’m going to turn it into a blueprint and apply it to all lights in my house.