[Automation] Cooldown feature

Hoping it would be possible to add a cooldown timer to automations,

Examples :
I have a few automations that notify me on entry \ exit of zones (which usually only happens once per day, the ability to add a cooldown timeout to atleast the next day would be nice).

There are also automations regarding temperatures in my greenhouses, these can get spammy if the temperature fluxuates up and down, I’m not interested in knowing the temperature is over 30 degrees 5 times within the same hour, but when this is triggered to have a cooldown of atleast 1 hour, because I already have automations that trigger if the temperature exceeds 35 and 40 degrees also.

Hopefully I am not the only one who would enjoy such features

Similar to the below for a 60 minute timeout

- alias: 'Drivhus er over 35 grader'
  trigger:
    platform: numeric_state
    entity_id: sensor.temperature_drivhus
    above: '35'
    for:
      minutes: 3
    cooldown: 60
  action:
    service: notify.we_telegram
    data_template:
      message: >-
        Drivhus er {{ states('sensor.temperature_drivhus') | int }} grader

Just add some kind of last triggered condition.

This is how I prevent my doorbell alert spamming me if some impatient idiot starts hammering on the button:

  condition:
  - condition: template # only notify once every 6 seconds at most
    value_template: "{{ ( as_timestamp(now()) - as_timestamp(state_attr('automation.doorbell_alert', 'last_triggered')) |int(0) ) > 5 }}"
2 Likes