What's happening to Alerts?

I am considering using Alert for my smoke detectors and water sensors. I have the impression that Alerts in HA are not getting any attention from the HA-team, since Alerts don’t have its own setup page in the GUI, still using code in file.

Any thoughts on what to use, alert or notification?

1 Like

You may well be right about Alerts not getting a great deal of attention - but, personally I find them handy especially for repeating notifications or announcements which I need to keep going until something is done in response e.g a reminder to deal with the recycling, or that a window needs closing. It means not having to faff around with repeats, loops and delays in scripts or automations.

I usually have to create an associated template binary sensor to deal with the more complex combination of timings and conditions though, with the alert running when the binary sensor turns on.

Lots of things are YAML only and many are unlikely to change.

Lots of things do what they’re supposed to and don’t need attention.

Alerts are both of those things.

1 Like

There was a bit of discussion during WTH 2022 (467262, 470368), but it seems to have been set aside until there is a fuller evaluation of what actually needs to be updated or changed before making any changes to migrate it to the UI.

1 Like

Thanks for your responding.

One thing keeping me from using Alerts is that you have to make an alert for every sensor. You cant have an alert for more of the same sensors (as you can for notification) like:

# This wont work
  smoke_detected:
    name: Smoke alarm
    entity_id: 
      - sensor.smoke1_detected
      - sensor.smoke2_detected
      - sensor.smoke3_detected
      - sensor.smoke4_detected
    state: "on"
    repeat: 
      - 1
    can_acknowledge: true
    title: "HA - ALARM!" 
    message:  Fire in  {{ area_name(trigger.entity_id) }}!
    data:
      push:
        sound: mixkit-classic-alarm-995-classic.wav
        critical: 1
        volume: 1
    notifiers:
      - me

Yeah, that’s a case where you’d have to make a separate trigger based template binary sensor to control the alert based on the state of your 4 smoke sensors.

And even then I’m not entirely sure how you would turn the binary sensor off unless you coukd also change the state of your smoke sensors once the alert was dealt with.

I was thinking it a step further and creating an alert based on a DEVICE_CLASS… IE: smoke, water…

This template will give you a device class based sensor which you can use in an alert.

template:
  - binary_sensor:
      - name: "Smoke Detected"
        unique_id: smoke_detected
        state: >
          {% set entities = state_attr(this.entity_id,'entity_id')|select('has_value')|list %}
          {{ entities|count > 0 if entities != none else false }}
        attributes:
          entity_id: >
            {{ states.binary_sensor
                |selectattr('attributes.device_class','defined')
                |selectattr('attributes.device_class','eq','smoke')
                |selectattr('state','eq','on')
                |map(attribute='entity_id')|list }}