I have an automation that puts my phone on silent when I enter a location. It’s no harm but the automation if I leave the building and come back fires again. Is there a way I can get mode, once to only fire once in a 12 hour period for example. Thanks
under action - turn off the automation.
and make another one that turns it on at night ex.
Doesn’t really help because it comes on numerous time in that twelve hour period as I enter and exit the zone, but thanks for suggestion.
create a template condition that returns true if the automation was last triggered longer than 12 hours ago:
{{ state_attr('automation.your_automation', 'last_triggered')|as_local > (now() - timedelta(hours=12) ) }}
Thank-you that worked a treat
it’s a late reply; I just started looking for this recently. What I’ve done is add a wait action after performing the triggered event and then I set the automation to disabled. I then have a second automation that runs at midnight and re-enables the automations that i want to run only once / day. Checking the last triggered value still has considerable value and I very much appreciate the template example as I use it in multiple places already. Disabling the automation after the first execution (and re-enabling later) works nicely for me.