Advanced ESPHome component supporting multiple Daly BMS units on a shared RS485 bus with centralized UART dispatch.
- ✅ Multi-BMS Support - Connect 2+ Daly BMS units on the same RS485 bus
- ✅ Centralized Dispatcher - No packet collisions or data loss
- ✅ Individual Addressing - Each BMS has unique command and response addresses
- ✅ Full Sensor Support - Voltage, current, SOC, temperatures, cell voltages, and more
- ✅ Configurable Update Intervals - Optimize polling frequency per BMS
- ✅ Detailed Logging - Debug support for troubleshooting
- Why This Component?
- Architecture
- Hardware Requirements
- Installation
- Configuration
- Supported Sensors
- Troubleshooting
- Contributing
- License
The standard Daly BMS component in ESPHome cannot handle multiple BMS units on the same RS485 bus because:
- Shared UART Buffer - Both BMS instances read from the same buffer, causing packet collisions
- Hardcoded Response Address - Original component expects responses only from address
0x01 - No Packet Routing - No mechanism to route responses to the correct BMS instance
- Centralized Dispatcher reads all UART data and routes packets to the correct BMS instance
- Configurable Response Addresses allow each BMS to filter its own responses
- Zero Packet Loss - Every response reaches its intended BMS instance
┌─────────────────────────────────────────────┐
│ ESP32 / ESPHome │
│ │
│ ┌──────────────────────────────────────┐ │
│ │ DalyBmsDispatcher (Singleton) │ │
│ │ - Reads UART buffer │ │
│ │ - Identifies response address │ │
│ │ - Routes to correct BMS instance │ │
│ └──────────────┬───────────────────────┘ │
│ │ │
│ ┌─────────┴─────────┐ │
│ │ │ │
│ ┌────▼─────┐ ┌─────▼────┐ │
│ │ BMS1 │ │ BMS2 │ │
│ │ (0x40→ │ │ (0x41→ │ │
│ │ 0x01) │ │ 0x02) │ │
│ └────┬─────┘ └─────┬────┘ │
│ │ │ │
└───────┼──────────────────┼─────────────────┘
│ │
│ RS485 Bus │
│ │
┌───▼──┐ ┌───▼──┐
│ BMS1 │ │ BMS2 │
│ Daly │ │ Daly │
└──────┘ └──────┘
- BMS Instance requests data (e.g.,
A5 40 90 ...for BMS1) - Dispatcher sends request via UART
- Physical BMS responds (e.g.,
A5 01 90 ...) - Dispatcher reads response, identifies address (
0x01) - Dispatcher routes to correct BMS instance (BMS1)
- BMS Instance processes data and publishes sensors
- ESP32 or ESP8266 board
- RS485 to TTL converter (e.g., MAX485, MAX3485)
- 2 or more Daly BMS units with RS485 interface
- Shared RS485 bus connecting all BMS units
ESP32 RS485 Module BMS1 & BMS2
────── ──────────── ───────────
GPIO17 ──────> TX (DI)
GPIO16 <────── RX (RO)
A ─────────> A (all BMS)
B ─────────> B (all BMS)
GND ───────> GND ─────────> GND
Each BMS must be configured with unique addresses:
- BMS1: Command Address =
0x40, Response Address =0x01 - BMS2: Command Address =
0x41, Response Address =0x02 - BMS3: Command Address =
0x42, Response Address =0x03(if needed)
Note: Use the Daly BMS PC software or Bluetooth app to set these addresses.
Clone this repository or download as ZIP:
git clone https://github.com/Kicosta/esphome-daly-bms-multi.gitExtract the component to your ESPHome configuration directory:
# If using Home Assistant Add-on
unzip esphome-daly-bms-multi.zip -d /config/esphome/my_components/
# If using standalone ESPHome
unzip esphome-daly-bms-multi.zip -d ~/esphome/my_components/Verify directory structure:
my_components/
├── daly_bms/
│ ├── __init__.py
│ ├── daly_bms.h
│ ├── daly_bms.cpp
│ ├── sensor.py
│ ├── binary_sensor.py
│ └── text_sensor.py
└── daly_bms_dispatcher/
├── __init__.py
├── daly_bms_dispatcher.h
└── daly_bms_dispatcher.cpp
Add to your .yaml file:
external_components:
- source:
type: local
path: my_components
components: [daly_bms, daly_bms_dispatcher]esphome:
name: battery-monitor
esp32:
board: esp32dev
# External components
external_components:
- source:
type: local
path: my_components
components: [daly_bms, daly_bms_dispatcher]
# UART for RS485
uart:
id: uart_bus
tx_pin: GPIO17
rx_pin: GPIO16
baud_rate: 9600
# Dispatcher (singleton - configure once)
daly_bms_dispatcher:
id: bms_dispatcher
uart_id: uart_bus
# BMS instances
daly_bms:
- id: bms1
dispatcher_id: bms_dispatcher
address: 0x40 # Command address
response_address: 0x01 # Response address
update_interval: 8s
- id: bms2
dispatcher_id: bms_dispatcher
address: 0x41
response_address: 0x02
update_interval: 9s
# Sensors
sensor:
- platform: daly_bms
bms_daly_id: bms1
voltage:
name: "BMS1 Voltage"
current:
name: "BMS1 Current"
battery_level:
name: "BMS1 SOC"
- platform: daly_bms
bms_daly_id: bms2
voltage:
name: "BMS2 Voltage"
current:
name: "BMS2 Current"
battery_level:
name: "BMS2 SOC"See example.yaml for a complete configuration with all sensors.
| Sensor | Description | Unit |
|---|---|---|
voltage |
Total pack voltage | V |
current |
Pack current (+ charge, - discharge) | A |
battery_level |
State of Charge (SOC) | % |
max_cell_voltage |
Highest cell voltage | V |
max_cell_voltage_number |
Cell number with highest voltage | - |
min_cell_voltage |
Lowest cell voltage | V |
min_cell_voltage_number |
Cell number with lowest voltage | - |
max_temperature |
Highest temperature | °C |
max_temperature_probe_number |
Probe number with highest temp | - |
min_temperature |
Lowest temperature | °C |
min_temperature_probe_number |
Probe number with lowest temp | - |
remaining_capacity |
Remaining capacity | Ah |
cells_number |
Number of cells in series | - |
temperature_1 |
Temperature sensor 1 | °C |
temperature_2 |
Temperature sensor 2 | °C |
cell_1_voltage to cell_16_voltage |
Individual cell voltages | V |
| Sensor | Description |
|---|---|
charging_mos_enabled |
Charge MOS status |
discharging_mos_enabled |
Discharge MOS status |
| Sensor | Description |
|---|---|
status |
BMS status (Stationary/Charging/Discharging) |
Cause: Incorrect directory structure.
Solution: Ensure two separate directories exist:
ls my_components/daly_bms/__init__.py # Must exist
ls my_components/daly_bms_dispatcher/__init__.py # Must existCause: Response address mismatch or dispatcher not configured.
Solution:
-
Check YAML configuration:
daly_bms: - id: bms2 response_address: 0x02 # Must match BMS physical setting!
-
Verify BMS hardware address using Daly PC software
-
Check logs for:
[V][daly_bms_dispatcher]: Dispatching frame to BMS instance (response_addr=0x02)
Cause: Update intervals too long.
Solution: Reduce update_interval:
daly_bms:
- id: bms1
update_interval: 8s # Faster updatesRecommended intervals:
- 5-10s: Real-time monitoring, active charging/discharging
- 20-30s: Balanced (recommended)
- 60s: Low-frequency monitoring, energy saving
Cause: Old ESPHome version or cache issues.
Solution:
# Clean build cache
esphome clean your-config.yaml
# Update ESPHome
pip3 install -U esphome
# Recompile
esphome compile your-config.yamllogger:
level: VERBOSEUseful log patterns:
# Dispatcher receiving and routing
[V][daly_bms_dispatcher]: Complete frame received: addr=0x01, len=13
[V][daly_bms_dispatcher]: Dispatching frame to BMS instance (response_addr=0x01)
# BMS processing frame
[V][daly_bms]: Processing frame for BMS addr=0x40, response_addr=0x01
# Sensor updates
[D][sensor]: 'BMS1 Voltage': Sending state 54.20V
| Scenario | BMS1 | BMS2 | Bus Load | Notes |
|---|---|---|---|---|
| Real-time | 5s | 6s | ~52% | For active monitoring |
| Balanced ⭐ | 8s | 9s | ~33% | Recommended |
| Efficient | 20s | 20s | ~14% | Low power |
| Power Saving | 60s | 60s | ~5% | Minimal updates |
- Stagger intervals (e.g., 8s and 9s) to avoid simultaneous polling
- Start with 20s, reduce if you need faster updates
- Monitor logs for timeout warnings
- Avoid intervals < 5s unless necessary
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
# Clone repository
git clone https://github.com/Kicosta/esphome-daly-bms-multi.git
cd esphome-daly-bms-multi
# Test with ESPHome
esphome compile example.yamlThis component is provided for personal, non-commercial use only under CC BY-NC-SA 4.0.
Permitted:
- Home automation projects
- Personal learning and experimentation
- Sharing modifications with the community
Not Permitted:
- Commercial products or services
- Paid installations or consulting
- Resale or redistribution in commercial packages
For commercial licensing, contact: [kicosta@hotmail.com]
See LICENSE for full terms.
- Original Daly BMS component by @s1lvi0
- Multi-BMS dispatcher architecture by Kicosta
- ESPHome community for the excellent platform
- ESPHome - The platform this component is built for
- Home Assistant - Home automation platform
- Original Daly BMS Component
** If this component helped you, please star the repository!**
dispatcher.py- Configurazione dispatchersensor.py,binary_sensor.py,text_sensor.py- Sensori