Recently I got a notification from a water leak sensor that was flapping. Because my alert automation is set up with a minimum duration of 1 second (see below), I only got notified once it became stable.
However, it looks like some history was lost as I only saw data back a few minutes before it stabilized:
Zoomed in:
Compared with some other sensors which don’t exhibit the flapping, and they do show more historical data:
These sensors were installed around the same time. Does this mean I lost some data because of the flapping sensor — like there is a limit on the number of state changes that is stored?
Additionally, are there any recommendations for a way that I can be notified in case a sensor starts changing rapidly like this, even if it never stabilizes in the Wet state? (Obviously I don’t want hundreds of notifications being sent to my phone, which is why I had the 1 second minimum in the first place!)
My current alert automation:
alias: Alert water leak (non-critical)
description: ""
triggers:
- entity_id:
- binary_sensor.basement_fridge_leak_sensor_moisture
- binary_sensor.basement_laundry_leak_sensor_moisture
- ...
for:
hours: 0
minutes: 0
seconds: 1
to: "on"
trigger: state
conditions: []
actions:
- metadata: {}
data:
message: ...
action: notify.mobile_app_...
mode: single


