I need to create an automation trigger for a scene to be triggered say 90 seconds after an entity has changed state.
The automation template in HA allows for an action to be triggered after a delay but only if the entity has remained in that state for say 90 seconds
To explain the use case further , I live in a semi urban area where brownouts are common.
I have a power backup that kicks in 30 seconds or so after mains power goes down.
However that sets a lot of my devices (lights mostly) to an on state.
I have created a binary sensor (Ping based) that changes state to off when power goes out and on when it resumes.
The way I want to use it is for HA to :
1 - 00:00:00 State changes from on to off (power outage)
2 -approx 00:00:30 - State changes from off to on (backup power kicks in)
3 - approx 00:01:30 - all devices are back online
4 - approx 00:02:00 - trigger scene to set all lights to off (unless it’s between dusk and midnight)
Any thoughts or suggestions?