WTH Why are alerts still YAML only?

I voted for this a few years ago on WTH so wanted to make sure it got love this time around.

Alerts are amazing but aren’t hugely known about. Last time this discussion came up I recall a suggestion of the alerts becoming triggers for automations. But for now, being able to set them up via the user interface would be a brilliant step in the right direction.

This came up on Reddit a few months ago and got ~350 upvotes

@frenck discussed this with @teachingbirds on Twitter in 2022

Other mentions during WTH month:
2024 - WTH: are alerts not configurable through the UI? - #7 by redstone99

2022 - Why are alerts not available in the ui and easier to set up?

Alert is frozen, the integration isn’t gettng any more updates. I believe there’s a custom integration called alert2 which is available through HACS (or the marketplace after 2026.11).

That’s weird because there is no alternative.

Alert is part of HA for many years now ( [Alert - Home Assistant](Alert - Home Assistant)). Isn’t it time it gets some love so that it might be used more?

What do I mean with this:

  1. Make it configurable using UI instead of yaml only
  2. Add simplified triggers “alert was initially triggered” (only will trigger ones), “alert was triggered” (for each time the interval has passed.. this will introduce breaking change), “alert was acknowledged”, “alert was turned off”
  3. Add simplified checks “alert is initially triggered”, “alert is on”, “alert is acknowledged”, “alert is turned off”
  4. Make it visible by adding it to a dashboard or the new security dashboard.

Use case scenario which simplifies this for users: Let’s say you want to do some automation each hour as long as a criterium is met.
Currently how to do this: Introduce a while loop and a delay in the end
Other method: use a alert but your logic will be limited to notifications
Example where I would use this: Notify my home the washing machine has not been cleaned out yet for X hours but do not do this notification between 22:00 and 08:00

The alternative is automations, the entire integration can be replaced with a few automations. Integrations like this (that can be replaced with automations or helper entities) are all frozen for new features. It is encouraged to use custom alternatives because these integrations will not receive updates. I suggest you check our alert 2 which I mentioned above

Thanks for the info, I wasn’t aware of this. I can’t spot this noted on the documentation, as a user how would I have discovered this information myself?

I will say it’s definitely a shame but I’ll look into alert2, thanks

I get what you are saying. But out of the box HA (not using HACS and such), how would one do notification after each hour a criteria is matched? (that’s not on a fixed time). Just trying to learn here :slight_smile:

Again I have done this out of the box already by doing a while loop with a delay.. but it’s not fool proof and seems hacky.

It’s only communicated to people who try to contribute to the integration. The integration will continue to work and will be updated if this break, but it will not receive new features.

There are a number of ways to do this with automations. You can use an input datetime to schedule an alert. One automation that sets the initial datetime, and performs an initial alert. Then a second automation that fires exactly 1 hour (or whatever interval) after the datetime occur. This is a simple time trigger, and it allows helpers as a trigger with an offset. It also survives restarts.

Makes sense. Thanks!

This is an example alert automation. Alerts when it goes offline, then once an hour for 3 additional hours.

alias: My alert
triggers:
- trigger_id: offline
  trigger: state
  entity_id: sensor.abc
  to: "unavailable"
- trigger_id: alert
  trigger: time
  at:
  - entity_id: input_datetime.abc_offline
    offset: "01:00:00"
  - entity_id: input_datetime.abc_offline
    offset: "02:00:00"
  - entity_id: input_datetime.abc_offline
    offset: "03:00:00"
actions:
- if:
  - condition: trigger
    id: offline
  then:
  - action: input_datetime.set_datetime
    target:
      entity_id: input_datetime.abc_offline
    data:
      datetime: "{{ now() }}"
- action: ...
  < YOUR NOTIFICATION ACTION >

@petro is right, everything the Alert integration does can be achieved through automations today. But it’s not as clean, and with @petro’s approach, needs a helper.

I guess my question is WTH do we not offer a blueprint for this?

I made a blueprint for Telegram.

The problem with the mobile app integration is that there is no action which can target the notify integration and gives the option to add actionable buttons.
You need to use the notify action for that, but there is no selection to only provide the action itself, without the action data.

So a simple alert blueprint can be created, but it won’t allow you to acknowledge the alert from the notification.

Another issue is that I wanted to support the custom period list the alert integration supports. I chose to do that by letting the automation wait, the downside of that is that it will stop when HA restarts.
To work around that I created a template entity which stores the data of the alert, it allows the alert to resume exactly as it would when there would not have been a restart. (It could be I totally over engineered it :wink: )

I could make this in one template blueprint, but then I’ll loose GUI support to add the blueprint to the HA system.

So I could create a great alert blueprint for the mobile app if:

  • There would be an action to do more advanced notifications which targets the notify entity.
  • There would be GUi support for adding template blueprints.

Presumably if you wanted an alert of the type ‘fire every x minutes until acknowledged’, you’d have to use a template trigger on the datetime that records its initial firing?

And another toggle helper for ‘alert acknowledged/unacknowledged’? (Also used as a condition in the template trigger). Or have I made that too complicated?

You can have the automation update the datetime 5 minutes out indefinitely unless a flag is set. In the example I posted above you’d just have an if statement that checked trigger_id alert and then add 5 minutes to it. Actionable notifications do get a bit hairy because it’ll be for andriod or iphone

I still think alerts are such an important feature that they deserve their own entity and placement in dashboards.

In fact, I would advocate to even have the home dashboard display active alerts at the top out of the box.

Having everyone learning how to use helpers and automations, and figuring out how to place them in the dashboard, is just not reasonable given the importance of this.

If alerts was promoted, I’d love to see integrations shipping them as well. Imagine for example Supervisor or Frigate raising a Disk is almost full alert, or even a weather provider providing a Storm incoming one.

To be clear, repairs are different. Alerts provide insight on something that may need user’s attention but is important to be aware of. Repairs need user attention. Storm incoming would make no sense as a repair, for example.