Trying to prevent an automation from running repeatedly by incorporating a delay (5 minutes) between subsequent runs. I’m using the following condition statement which I learned after looking through similar questions.
condition:
- condition: template # only notify once every 5 minutes at most
value_template: "{{ ( as_timestamp(now()) - as_timestamp(state_attr('automation.driveway_notify_on_interest', 'last_triggered')) |int(0) ) > 300}}"
Unfortunately with this condition, my automation never runs stating that the condition failed.
Is it b/c when the automation is first triggered, it updates the last_triggered variable and as such it will always fail? I would think the last_triggered time would be from the previous automation run not the one currently running.
Thanks in advance.