Hi, I noticed HA turned on a light as I’ve scheduled, but did not turn it off after 30min as I have also scheduled (it was temporarily unavailable). This is ok-ish to happen to a light, but could be much worse if it was with a heater, for instance.
I couldn’t find any good way to have reliable state changes other than adding some inline retries or some very complex solutions.
I was thinking perhaps a way to deal with this would be to, instead of doing an action (e.g. “turn on” or “turn off”, I could set a desired_state="on"/"off"
and then have an automation that runs on a time pattern every minute that toggles the switch if current_state != desired_state
.
(One disadvantage about this method is that it would mostly disregard actions done outside HA - e.g. if you press a physical button - or directly call an API - to toggle a switch - HA would toggle it back ~1min later)
Does that pattern sound reasonable? Am I reinventing the wheel?