60c787d0419e74e7c472c766cc34cf65bf6858f1
When no state field is configured, the panel now uses a least-squares slope over the most recent ≤ 50 data points to determine whether the battery is charging, on battery, or stable — instead of relying on the overall first-to-last rate which could be misleading over long ranges. Priority order for state resolution: 1. Explicit state field (if enabled and configured) 2. Inferred trend from last ≤ 50 points (always computed) The slope threshold (0.01) avoids flicker from sensor noise. Status badge now shows 'On Battery' instead of 'Discharging'. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Grafana Battery Visualisation
I hate writing documentation, and since I will have ADHD brain, I will forget how to do this.
npm install
npm run build
cp -r dist /var/lib/grafana/plugins/andydixon-battery-panel
in /etc/grafana/grsfana.ini add andydixon-battery-panel to allow_loading_unsigned_plugins
Languages
TypeScript
87%
JavaScript
9.5%
Dockerfile
2.8%
Shell
0.7%