Docan DR-WIFI-04-V2 battery Wi-Fi stick: local ESPHome monitoring

I reverse engineered the Docan DR-WIFI-04-V2 battery Wi-Fi stick and replaced its original firmware with ESPHome for fully local monitoring in Home Assistant. The stick uses its own ESP32 to read the BMS over UART; no permanent external serial adapter or cloud connection is needed.

The configuration exposes pack voltage, current, power, SoC, SoH, capacities, cycle count, 16 cell voltages, temperatures and diagnostic status values. It also discovers the BMS address automatically and uses the three onboard LEDs for heartbeat, Home Assistant connection and BMS communication.

I documented the tested GPIO pinout, programming pads, board photographs, protocol frames and the complete generic ESPHome YAML here:

This is tested on my DR-WIFI-04-V2 board and battery. Other PCB revisions or BMS versions may differ, so please verify the hardware before flashing. I would welcome test results and corrections from anyone with a similar Docan pack.