Andy DixonandCopilot da80da71d1 Add field selectors for charge, load, and state metrics
Field Mapping options (new category at top of editor):
- Charge field: pick which numeric field drives the battery level
  (falls back to first number field if unset)
- Enable load metric: toggle + field picker for a load/power draw
  percentage, displayed as a themed semi-circular gauge arc beside
  the battery (green < 50%, amber 50-80%, red > 80%)
- Enable state field: toggle + field picker + user-defined values
  for charging/discharging so the panel uses an explicit data field
  rather than computing state from the rate of change

Visual integration:
- Load gauge renders in a card with the battery, scales responsively,
  and collapses to a compact text line in small panels
- State field drives the status badge, gradient direction, and
  charging animation (overrides computed rate when enabled)
- All new options use showIf for conditional visibility in the editor

Also fixed deprecation warnings by replacing .toArray() with
Array.from() for Grafana 12+ compatibility.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-24 13:15:21 +01:00
2025-10-11 18:48:08 +02:00
2025-10-11 17:26:33 +01:00
2025-10-11 18:36:06 +02:00

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

S
Description
Grafana battery visualisation
Readme GPL-3.0
276 KiB
Languages
TypeScript 87%
JavaScript 9.5%
Dockerfile 2.8%
Shell 0.7%