0xreversed/with.ai
Firmware and hardwareWorksSource available
Target: EG4 LL 400Ah LiFePO4 battery (BLE)

Reverse engineered an EG4 LiFePO4 battery's Bluetooth protocol into a Home Assistant integration with Claude

EG4 LL 400Ah LiFePO4 battery (BLE): A battery monitor over BLE for Home Assistant and the browser.
Image: GitHub (wilcox97/eg4-ll-battery-monitor)

What was done

A Home Assistant integration and a Web Bluetooth dashboard for the EG4 LL 400Ah battery, with the BLE protocol worked out with Claude.

wilcox97 built a Home Assistant integration and a browser dashboard for an EG4 LL 400Ah LiFePO4 battery. The README says it came from an extensive collaboration with Claude, which was the main development partner for the protocol work.

How it was done

The protocol was reverse engineered from nRF Connect BLE captures, decompilation of the official Android app and comparison with open source drivers. It turned out to be Modbus RTU over a custom GATT service, and the battery does not stream, so a poll command must be written after subscribing. Byte offsets, CRC logic and connection order were checked against the real battery before being ported to both implementations. The README credits Claude with the protocol work, implementation and debugging across 14 or more iterations.

Results

The integration exposes pack voltage, current, power, state of charge and health, cell voltages, temperatures, cycle count, runtime estimates and protection limits, and feeds the Energy dashboard. It installs through HACS. A single HTML file gives the same data over Web Bluetooth.