battery-charge alerts using a rolling mean of the last 10 valid measurements.

This commit is contained in:
2026-08-15 15:52:11 +02:00
parent 87b6a77f3c
commit a404d198a4
2 changed files with 50 additions and 7 deletions
+5 -2
View File
@@ -826,8 +826,8 @@ full-size PNG when a graph is clicked.
The collector also sends an ntfy notification when:
- The UPS status changes
- Battery charge crosses below 50%
- Battery charge crosses below 5%
- Mean battery charge over the last 10 measurements crosses below 50%
- Mean battery charge over the last 10 measurements crosses below 5%
- Estimated battery runtime crosses below 5 minutes
- Local Raspberry Pi shutdown is requested below 200 seconds of runtime
@@ -835,6 +835,9 @@ Alert state is stored in `/var/lib/rrd/bx950mi-alert-state.json`, allowing
changes to be detected across cron runs. The first run establishes a baseline
without sending notifications. Threshold notifications can fire again after a
value recovers above the threshold and later drops below it.
Battery-charge alerts start after 10 valid measurements have been collected;
using their rolling mean prevents a single erroneous `0%` report from causing
a false alarm. Raw measurements are still stored in the RRD and graphed.
### Automatic shutdown of the Plex server