Not sure if this is possible. I know when you set up an automation you can set for:
and it will trigger based on being in the new state from the previous state. Is it possible to set for:
for the previous state though? I want an automation to trigger if it goes from on to off but only if it was on for more than 20 seconds, else I don’t want it to trigger and I can’t seem to figure it out. I considered templates, but I couldn’t figure out how to incorporate something similar to for:
into a template either.
Thanks in advance! Bonus if we can set it for the previous state having been active between x amount of time.
Usage:
I am using this for automating the lights based on the state of my firetv. I don’t want it to keep changing the lights between every episode if I’ve changed them and only want it to trigger the lights if it goes from idle for 20 seconds to playing, but any way I set the automation triggers 20 seconds after going from idle to playing, even if it was only idle for 5 seconds.
NOT WORKING:
platform: state
entity_id:
- media_player.firetv_media_room
not_from:
- playing
for:
hours: 0
minutes: 0
seconds: 20
to: playing
1 post - 1 participant