Notifications and alerts play a key role in the Home Automation space, everyone wants to be kept in the know of whats happening at home. Having to create “automations” for notifications is a bit cumbersome. I checked out the ALERT integration, but it’s to simplistic and there is no GUI.
We need a separate space to create and manage alerts based on state, connectivity, device_class, groups, limits, etc…
Describe how your proposed “separate space” would be less “cumbersome” than creating an automation.
For example how would I instruct it to listen for an event or a state-change?
It would essentially be a GUI for the Alert integration (Alert - Home Assistant) only glorified.
Here would be a very crude mockup:
The main alerts/notifications page would display a list of created alerts much like the automation page, with the name, the last triggered, and enabled/disabled.
New alert page would have the following inputs:
Name of Alert
Select a trigger - entity state / group state / integration state / device_class state
Allowed threshold for the trigger
Type of notification - once / repeat / delayed
Fault message - allow for emojis
Fixed message
Notifiers - what/who gets notified
(Optional) notification actions?
In a nutshell, you’ve described automations.
Specifically constrained automations, whose action
is limited to sending a notification.
swoosh
Perhaps the problem is that the automation-section is a bit of a mess when having lots of automations?
A widely requested feature and then you would be able to group alert-automations together
Although you are absolutely correct, automations and alerts are completely different. Automations have an If-this-than-that design. The automation then is created as a switch which you can enable/disable.
Alerts get locked in WHILE a particular event is occurring. So while the door is open, the alert turns on, re-alerting you every x minutes until either the door closes or you turn off it’s switch acknowledging the alert. I realize something like this can probably be done using an automation and a helper, but it would be extremely cumbersome.
HOWEVER, this is all irrelevant… An Alerts 2.0 is already being worked on!
It’s easy, so if you find it to be “cumbersome” then I suggest it may be due to your lack of familiarity with Home Assistant.
Post a link to the Pull Request. The existence of a PR means it’s being formally implemented.
Amazing! Since it would only take you a minute or two, would you mind helping me create an automation that will alert me every 2 minutes while my freezer is open for more than 2 minutes, unless I acknowledge it? here’s how I did it with notify
kitchen_freezer:
entity_id: binary_sensor.freezer_door
repeat: 2
skip_first: true
message: "freezer door is open"
notifiers: notify
They are probably referring to this (now closed) PR. From the discussion it looks like the core devs prefer refactoring the Alert integration instead of simply adding it to the UI… and it looks like Frenck may be hard at work doing just that.
Do you know which one of the following PRs implements “create and manage alerts based on state, connectivity, device_class, groups, limits, etc…”?
I skimmed them and they appear to be focused on refactoring the codebase in preparation for exposing Alerts as a UI-based Helper. Curious to know which PR provides all the requested new features.
It looks like, at least so far, the goal is more in line with the other Alerts WTH than to to add the requested new features from this one…
one can only hope
The WTH that requests the ability to define Template entities via the UI would also benefit the Alert integration (and address the request made in this WTH).
Alert only supports a binary_sensor. If you need it to monitor a more complex set of conditions, you would create a Template Binary Sensor. The ability to define a Template Binary Sensor via the UI would simplify the use of an Alert.
Ideally the Alert integration would support a template directly but that might represent a breaking change (because it references entity_id
not value_template
).
Is this what you are looking for?
alias: Test Door Open Notify
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.freezer_door
to: "on"
for:
hours: 0
minutes: 2
seconds: 0
condition: []
action:
- repeat:
until:
- condition: state
entity_id: binary_sensor.freezer_door
state: "off"
sequence:
- service: notify.mobile_app
data:
message: Freezer door is open
- delay:
hours: 0
minutes: 2
seconds: 0
milliseconds: 0
mode: single
That’s pretty good, thank you!
That would probably fail on a restart (or a boot up after the freezer is already open) and there is no way to “acknowledge” it unless you create an acknowledgement helper that you would have to reset every time you clear the alert…
Let’s just hope with Frenck on the case, we can get some new functionality out of the Alert integration!