I have a lights connected to home assistang by wifi . The issue that i have is that when there is a general shutdown, the light being in the off state, when the light comes back it turns on.
Any idea for home assistant to maintain/remain its state before the general shutdown of the light?
@francisp, yes, could be, in fact if you don’t control the light with home assistant you can have a “dumb switch” and on / off the light, as normal light so the behavior is absolutely normal.
the smart here is try to control this normal behavior in home assistant and turn on or off the light in base to the old state after power outage for instance.
Those are not running Tasmota or any other custom firmware, so I think you can’t change their behaviour.
What you can do is configure an automation that turns everything back off when HA starts up, but it may take a while, since WiFi and everything needs to come back first.
@Valentino_Stillhardt yes, this is the only option that i can see, but i have multiple use causes that can do that a simple automation doesnt work well, for instance , at night i have one of this light on and i have in this moment a power outage, when home assistant come back will apply the automation to turn off the light without control that one of this light was in state on after the power outage.
:-/
@otnow
it doesn’t seem to be working. When I switch on a light of my lamp, coming from a normal off state, it is automatically switched off by this automation.
here you have the image:
The automation I proposed automatically turns off the lamp only if it was not turned on by the user using a button in the Home Assisatnt interface ( trigger.event.data.new_state.context.user_id is none ) or if it was not turned on by some other automation ( trigger.event.data.new_state.context.parent_id is none ).
In other words, a lamp that does not remember its last state after a power outage must be constantly connected to the mains and turned on / off only by software, and not using a physical switch, because this de-energizes it when it is turned off, which is tantamount to a general power outage.