Best practices for Repeating Alerts until Acknowledged

Been running Home Assistant for a few weeks now. I feel like I have a decent handle on things, and have managed to set up quite a few useful automations, scripts, etc. One thing I’d like to do is set up repeat reminders for specific events until I acknowledge them in some way.

One example (without acknowledgement needed) I have a garage fridge temp sensor. If it goes above 40 degrees, I get an alert. I’d like it to continue to send me alerts every 30 minutes until the temp drops below 40 degrees.

Another example: If my doors are opened or motion is detected while I’m away, I get an alert. I want this to continue to alert me every hour until I acknowledge the alert. Bonus, I might work on turning off the automation for this until the alert is acknowledged. Right now I get repeat alerts every time motion is detected, so it can be like 5 alerts every minute, etc. I just have not gotten around to fine tuning this one for the multiple alerts, but I think the acknowledging would be integral for this.

So what do other people do for this sort of thing?
Thanks

2 Likes

Take a look at the alert component?

2 Likes

So looking at the example, this should work, right?

  garage_door:
    name: Garage is open
    done_message: Garage is closed
    entity_id: cover.garage_door_opener
    state: 'open'
    repeat: 5
    can_acknowledge: True
    skip_first: True
    notifiers:
      - notify.ios_my_iphone

And this for the Garage Fridge temp
This in my configuration.yaml

binary_sensor:
   - platform: template
    sensors:
      garage_fridge_warm:
        value_template: "{{ states('sensor.centralite_3300s_03fed0e3_1_1026_temperature') | float > 40.0 }}"

and this as my alert

  garage_fridge_temp:
    name: Fridge Temp above 40 degreees
    done_message: Fridge temp is now less than 40 degrees
    entity_id: garage_fridge_warm
    state: 'on'
    repeat:
      - 15
      - 30
      - 60
    can_acknowledge: True
    skip_first: True
    notifiers:
      - notify.ios_my_iphone

I am not getting alerts. Tried this one

  garage_fridge_temp:
    name: Fridge Temp above 40 degreees
    done_message: Fridge temp is now less than 40 degrees
    entity_id: binary_sensor.garage_fridge_warm
    state: 'on'
    repeat:
      - 15
      - 30
      - 60
    can_acknowledge: True
    skip_first: True
    notifiers:
      - notify.ios_my_iphone

I get other alerts to ‘notify.ios_my_iphone’

Am I doing something wrong?

Remove ‘notify.’ from the start, so the last line is just

  - ios_my_phone

Awesome. That worked. Now. How do i acknowledge the alert in HA?

In addition to my alert:

alert:
  garage_door_open_long:
    name: Garage Door is still open!
    entity_id: binary_sensor.garage_door_sensor
    state: 'off'   # Optional, 'on' is the default value
    repeat: 5
    can_acknowledge: true  # Optional, default is true
    skip_first: true  # Optional, false is the default
    notifiers:
      - mypushbullet

I have created a group that includes both, the status of the sensor and the alert:

open_close_sensor:
  name: Open / Close Sensor
  entities:
    - binary_sensor.garage_door_sensor
    - alert.garage_door_open_long

The option to dismiss the alert only shows up when the garage door is actually open:
image

If the garage door is closed the option to dismiss the alert is not visible.
This has noting to do with fancy programming; that’s just how it worked for me.

Please notice that I have a Reed Switch as my binary sensor and I configured it as follows:

binary_sensor:
  - platform: rpi_gpio
    ports:
      18: Garage Door Sensor
    invert_logic: true

If you use another kind of sensor you might have to set it up slightly differently.
It might be as simple as changing the state: 'off' shown in my alert to state: 'on'

1 Like

That’s awesome. Thanks!!