Prevent Repeated Execution on automations

Hey everyone,

I’ve been using Home Assistant for a while now and I’ve been thinking about a feature that could really enhance automation functionality for starters. Currently, I know it’s possible to achieve a cooldown period for automations using templates, but I believe it would be great to have this functionality integrated into the user interface.

What I have in mind is a “Preventive Execution Control” option. Essentially, this feature would allow us to specify a cooldown period for each automation, during which it wouldn’t trigger again after its last execution.

It would be nice if it could be added under the run mode settings,
or maybe just as a automation condition.
I’ve created a concept picture to give you an idea.

It’s even simpler than that, as long as your cool-down time is not too long and you can run the automation in single mode.

- alias: 'Doorbell Alert'
  mode: single  # <- set this mode
  max_exceeded: silent # <- prevent logging warnings if waiting in the delay
  trigger:
    - platform: state
      entity_id: binary_sensor.doorbell_button
      from: 'off'
      to: 'on'
  action:
   - service: button.press
     target:
       entity_id: button.doorbell_buzzer
   - delay: 6 # <--- cool-down time in seconds
1 Like

I was going to say the same. I use single mode and a delay at the end.

Thank you for your reply.

I know some people do it with delays. And that’s fine for a short cooldown Indeed.

But delays suck for this purpose in my opinion.
Because the automation will reset when home assistant restarts.

I’m currently using the template function because I’ve got some automations that only run if it didn’t run for like 6 hours.

I think it would be just nice to see this as a ui feature.

You should vote for your own feature request.