#Run automation only if another hasn't run in the last 120 seconds?

1 messages · Page 1 of 1 (latest)

shut token
#

I thought I could use use the last_triggered attribue with the fixed number above 120 but the last_triggered seems to return an entire date and time?

I did find some others that take the last_triggered and subtract from now() for time since. Is that the only way to solve for this? Can I do that in the "And if" condition or do I need to make a template?

dim pelican
#

You'd need to use a template

shut token
#

I was having trouble understanding where to do that. I kept trying to make a Template Helper not a Template....

#

{{ now() - state_attr('automation.arriving', 'last_triggered') > timedelta(minutes=2) }}

For anyone else confused like I was. Add a condition as Template. The above is what worked.

scenic spade
#

You can use this to refer to the entity that the template is used within.

{{ now() - this.attributes.last_triggered > timedelta(minutes=2) }}

shut token
#

That would reference my Someone Home automation though right? I was trying to trigger off of another one the Arriving automation. Just trying to make sure I understand and follow.