ESPHome configuration for reading Dyness battery CAN bus data using an ESP32 and MCP2515 CAN controller.
The configuration decodes Dyness battery CAN frames and exposes battery information locally to Home Assistant using the ESPHome API — no cloud services required.
Tested with:
- Dyness Junior Box
- ESP32-C3 (ESP32-C3-DevKitM-1)
- MCP2515 CAN module (8 MHz)
CAN configuration:
500 kbps
Extended CAN frames
Other Dyness battery systems may also work but have not yet been tested.
- Dyness CAN bus decoding
- Pylontech compatibility frame decoding
- automatic CAN ID sniffer for discovering unknown frames
- native ESPHome integration with Home Assistant
- local operation without any cloud services
- battery voltage / current / power
- SOC / SOH
- cell voltages
- temperature sensors
- protection and alarm flags
The ESPHome node connects directly to Home Assistant using the native ESPHome API.
All sensors automatically appear in Home Assistant, including:
- battery voltage
- battery current
- battery power
- SOC
- SOH
- cell voltages
- temperature sensors
- alarm and protection flags
This allows local battery monitoring without any cloud dependency.
Dyness batteries transmit two groups of CAN messages:
18AAxxxx
18BBxxxx
00000351
00000355
00000356
00000359
0000035C
0000035E
0000035F
These frames are used by many inverters to communicate with the battery.
The configuration includes a built-in CAN sniffer.
Unknown CAN IDs are automatically detected and reported, which helps with reverse engineering additional Dyness protocol frames.
esphome/
dyness_can.yaml
docs/
pinout.md
can_frames.md
Connector pinouts and CAN frame documentation can be found in:
docs/
Contributions, frame decoding improvements, and additional hardware tests are welcome.
MIT License