

A Choice for Energy Idependence
The batteries live in one of the two matching 30U racks described on the homelab page (the other still runs the lab). Watching them meant teaching a computer to read the battery management system.
The pack is managed by a Batrium Watchmon 4+ BMS, which broadcasts its telemetry as little-endian binary UDP packets on port 18542.
batrium-udp2http-bridge is a Go service that turns those packets into something easier to use. It listens for the broadcasts, picks a decoder from the 16-bit message type in each packet, and keeps the latest decoded message for each type. Each type is served as JSON on a route named after its message ID (for example /0x3E32), plus a per-cell-monitor route, /0x4232/{id}. It also exports Prometheus metrics and ships as a Docker image.
| Message ID | What it carries |
|---|---|
| 0x5732 | System Discovery |
| 0x415A | Cell Monitor Basic Status |
| 0x4232 | Cell Monitor Full Info |
| 0x3E32 / 0x3F33 / 0x4032 | Telemetry Rapid / Fast / Slow |
| 0x4732 | Logic Control Status |
| 0x4932 | Remote Status |
| 0x5432 | Daily Session |
| 0x6131 / 0x7857 / 0x5632 | Communication Status / Shunt Metrics / Lifetime Metrics |
| 0x4A35 / 0x4B35 / 0x4C33 / 0x4D33 / 0x5334 | Hardware setup: system, cell group, shunt, expansion, integration |
| 0x4F33 / 0x5033 / 0x5158 / 0x5258 / 0x4E58 | Control-logic setup: critical, charge, discharge, thermal, remote |
The source is on GitHub: github.com/liskl/batrium-udp2http-bridge.
In Feb 2014 I wrote TED5000.sh, a shell script that cron runs every minute. It pulls the latest power reading from a TED 5000 whole-home power monitor gateway and feeds an rrdtool round-robin database: a 60-second step, a GAUGE data source, and a MAX archive of 525,949 one-minute rows (about a year of minutes). It then renders PNG graphs, which the old site served.
* * * * * TED5000.sh <gateway-ip> 0
rrdtool create <rrd-dir>/ted5000.rrd --start now --step 60 DS:watts:GAUGE:120:0:20 RRA:MAX:0.5:1:525949
The script and setup notes are on GitHub: liskl/t5k-power-monitor.
Years later, the same itch became the powerwall.