Hi, I was considering modifying the Alert class (core/homeassistant/components/alert) to add the ability to disable an alert, either indefinitely or for a fixed period of time (ie, snooze). Any opinions?
A use case is a water-leak binary_sensor that is just a little wet, and so frequently switches on and fires the alert. "Ack"ing the alert doesn’t help because it is frequently retriggering.
You could work around this by adding another binary_sensor that tracks whether the underlying leak binary_sensor has fired in the last X minutes, but that doesn’t seem to quite capture the desired behavior.
Or you could use an automation instead of an alert, but then you miss out on the alert machinery, particularly the ability to set varying delays, and it seems like slightly the wrong abstraction.
I work around this by ANDing the alert template binary sensor with an input boolean to enable or disable the alert. Easy to do, clear in the alert logic what is happening, and easy to add to a single card for managing alerts in the UI.
There’s probably a way to accomplish this behavior using additional scripts/automations/input-entities. Though, I think the experience is better if it’s part of the Alert entity.
I’d also like to improve the alert info shown on the more-info popup in lovelace, but I’ll first see how the PR is received.