@SteveDinn wrote:
I just want to make sure I’m thinking about this correctly. I want to have an automation run if I turn off a light, but only if it had been previously on for more than 30 seconds. So a quick flip would NOT trigger the automation. Am I correct in thinking that I can do this:
{{ (now() | as _timestamp) - (trigger.from_state.last_changed | as_timestamp) > 30 }}
Will the
from_state
contain the length of time that it remained in the previous state? I’m assuming that since the trigger fired, that now() is the time of the state change.
Posts: 18
Participants: 4