I’m trying to figure out the best way to achieve a kind of “Master alert” sensor (think the Master Caution alarm in old spacecraft as seen in Apollo 13 – if any one of dozens of things happen, that alarm goes off), so I can build an Apple Watch complication that shows something like “1 alert” or “2 alerts” depending on how many things need my attention.
Examples of things that could need attention:
- A garage door is open after a certain time of day
- A window is open while it’s raining or below a certain temperature
- Certain lights are on within certain time ranges
The use case here is that I want to be able to glance at my watch, and at any moment know if there might be things that need my attention (whether or not a push alert was sent, I want this to be independent of notifications). I would like to be able to “acknowledge” or dismiss these alerts so they get removed from the complication count once I take care of or dismiss them.
One kind of brute-force approach might be to define a bunch of binary template sensors that are hardcoded to turn on if my conditions are met (one for each possible thing) and then somehow have another sensor that “counts” how many of these are turned on. But these seems very clumsy, and there wouldn’t be a good way to “clear” or dismiss these messages.
I was looking at the documentation and trying to figure out if the alert integration might be what I need, but I’m not sure. I would still have to define sensors for all the complex detection scenarios I want, which is fine…would the alert integration allow me to dismiss the alert once I check it? The docs seem to imply this, but then don’t really provide an example of how to do it. The other issue here is that it seems to require you notify a device when an alert fires – but what if I just want to add something to my alert list, not necessarily send a push notification? Also, if I went this route, how could I create a count of all the alerts that are on, so I can show a number on my watch complication?
Persistent Notification also looks interesting (the notifications shown in the front-end web UI panel), but there doesn’t seem to be any sensor for getting the number of active notification (there’s something for the month of “What the heck?!”)