3 Commits
Author SHA1 Message Date
sharad 8a9b8f3213 Update packages/base/device_base_sub_device.yaml 2026-11-18 22:54:23 -08:00
Sleeper85 f44738ce8f HA dashboards 1.8.1 - Restore the Cut-Off Cell Voltage select
The select.yambms_1_cut_off_cell_voltage entity was dropped from the
"YamBMS - Charging Settings" card by mistake in 9febfa4. Put it back
after Charger Offset V in every dashboard.
2026-11-12 18:34:03 +01:00
Sleeper85 9e8dff09e5 Docs: Add inferred balancing to the 1.8.1 upgrade guide
EG4 LL V2, Seplos V1/V2, Seplos V3 and JK RS485 DISPLAY now infer their
balancing state. It changes when the charge ends without any validation
error, so it belongs in the biggest changes of the upgrade guide.
2026-11-10 13:20:33 +01:00
88 changed files with 502 additions and 998 deletions

No files matched your search

-1
View File
@@ -1,2 +1 @@
buy_me_a_coffee: sleeper85
custom: ["https://paypal.me/Sleeper85"]
@@ -1,5 +1,5 @@
# Updated : 2026.11.14
# Version : 1.8.2
# Updated : 2026.11.06
# Version : 1.8.1
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -752,10 +752,6 @@ views:
<td>Chip</td>
<td>{% set info = states('sensor.yambms_demo_board_debug_device_info') %}{% if info not in ['unknown', 'unavailable', ''] and '|' in info %}{{ info.split('|')[1].split('Features:')[0].replace('Chip:', '').strip() }}{% else %}{{ info }}{% endif %}</td>
</tr>
<tr>
<td>Board</td>
<td>{{ states('sensor.yambms_demo_board_board_name') }}</td>
</tr>
<tr>
<td>Board Uptime</td>
<td>{{ states('sensor.yambms_demo_board_uptime') }}</td>
@@ -996,7 +992,6 @@ views:
- entity: number.bms_1_max_cell_voltage_number
- entity: number.bms_1_min_temperature_number
- entity: number.bms_1_max_temperature_number
- entity: number.bms_1_yambms_errors_bitmask_number
conditions:
- condition: state
state_not: unavailable
@@ -1152,7 +1147,6 @@ views:
- entity: number.bms_2_max_cell_voltage_number
- entity: number.bms_2_min_temperature_number
- entity: number.bms_2_max_temperature_number
- entity: number.bms_2_yambms_errors_bitmask_number
conditions:
- condition: state
state_not: unavailable
@@ -1308,7 +1302,6 @@ views:
- entity: number.bms_3_max_cell_voltage_number
- entity: number.bms_3_min_temperature_number
- entity: number.bms_3_max_temperature_number
- entity: number.bms_3_yambms_errors_bitmask_number
conditions:
- condition: state
state_not: unavailable
@@ -1,5 +1,5 @@
# Updated : 2026.11.14
# Version : 1.8.2
# Updated : 2026.11.06
# Version : 1.8.1
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -293,10 +293,6 @@ views:
<td>Chip</td>
<td>{% set info = states('sensor.yambms_board_debug_device_info') %}{% if info not in ['unknown', 'unavailable', ''] and '|' in info %}{{ info.split('|')[1].split('Features:')[0].replace('Chip:', '').strip() }}{% else %}{{ info }}{% endif %}</td>
</tr>
<tr>
<td>Board</td>
<td>{{ states('sensor.yambms_board_board_name') }}</td>
</tr>
<tr>
<td>Board Uptime</td>
<td>{{ states('sensor.yambms_board_uptime') }}</td>
@@ -794,10 +790,6 @@ views:
<td>Chip</td>
<td>{% set info = states('sensor.yambms_board_debug_device_info') %}{% if info not in ['unknown', 'unavailable', ''] and '|' in info %}{{ info.split('|')[1].split('Features:')[0].replace('Chip:', '').strip() }}{% else %}{{ info }}{% endif %}</td>
</tr>
<tr>
<td>Board</td>
<td>{{ states('sensor.yambms_board_board_name') }}</td>
</tr>
<tr>
<td>Board Uptime</td>
<td>{{ states('sensor.yambms_board_uptime') }}</td>
@@ -1,5 +1,5 @@
# Updated : 2026.11.14
# Version : 1.8.2
# Updated : 2026.11.06
# Version : 1.8.1
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -293,10 +293,6 @@ views:
<td>Chip</td>
<td>{% set info = states('sensor.yambms_board_debug_device_info') %}{% if info not in ['unknown', 'unavailable', ''] and '|' in info %}{{ info.split('|')[1].split('Features:')[0].replace('Chip:', '').strip() }}{% else %}{{ info }}{% endif %}</td>
</tr>
<tr>
<td>Board</td>
<td>{{ states('sensor.yambms_board_board_name') }}</td>
</tr>
<tr>
<td>Board Uptime</td>
<td>{{ states('sensor.yambms_board_uptime') }}</td>
@@ -794,10 +790,6 @@ views:
<td>Chip</td>
<td>{% set info = states('sensor.yambms_board_debug_device_info') %}{% if info not in ['unknown', 'unavailable', ''] and '|' in info %}{{ info.split('|')[1].split('Features:')[0].replace('Chip:', '').strip() }}{% else %}{{ info }}{% endif %}</td>
</tr>
<tr>
<td>Board</td>
<td>{{ states('sensor.yambms_board_board_name') }}</td>
</tr>
<tr>
<td>Board Uptime</td>
<td>{{ states('sensor.yambms_board_uptime') }}</td>
@@ -1,5 +1,5 @@
# Updated : 2026.11.14
# Version : 1.8.2
# Updated : 2026.11.06
# Version : 1.8.1
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -293,10 +293,6 @@ views:
<td>Chip</td>
<td>{% set info = states('sensor.yambms_board_debug_device_info') %}{% if info not in ['unknown', 'unavailable', ''] and '|' in info %}{{ info.split('|')[1].split('Features:')[0].replace('Chip:', '').strip() }}{% else %}{{ info }}{% endif %}</td>
</tr>
<tr>
<td>Board</td>
<td>{{ states('sensor.yambms_board_board_name') }}</td>
</tr>
<tr>
<td>Board Uptime</td>
<td>{{ states('sensor.yambms_board_uptime') }}</td>
@@ -794,10 +790,6 @@ views:
<td>Chip</td>
<td>{% set info = states('sensor.yambms_board_debug_device_info') %}{% if info not in ['unknown', 'unavailable', ''] and '|' in info %}{{ info.split('|')[1].split('Features:')[0].replace('Chip:', '').strip() }}{% else %}{{ info }}{% endif %}</td>
</tr>
<tr>
<td>Board</td>
<td>{{ states('sensor.yambms_board_board_name') }}</td>
</tr>
<tr>
<td>Board Uptime</td>
<td>{{ states('sensor.yambms_board_uptime') }}</td>
@@ -1,5 +1,5 @@
# Updated : 2026.11.14
# Version : 1.8.2
# Updated : 2026.11.06
# Version : 1.8.1
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -293,10 +293,6 @@ views:
<td>Chip</td>
<td>{% set info = states('sensor.yambms_board_debug_device_info') %}{% if info not in ['unknown', 'unavailable', ''] and '|' in info %}{{ info.split('|')[1].split('Features:')[0].replace('Chip:', '').strip() }}{% else %}{{ info }}{% endif %}</td>
</tr>
<tr>
<td>Board</td>
<td>{{ states('sensor.yambms_board_board_name') }}</td>
</tr>
<tr>
<td>Board Uptime</td>
<td>{{ states('sensor.yambms_board_uptime') }}</td>
@@ -794,10 +790,6 @@ views:
<td>Chip</td>
<td>{% set info = states('sensor.yambms_board_debug_device_info') %}{% if info not in ['unknown', 'unavailable', ''] and '|' in info %}{{ info.split('|')[1].split('Features:')[0].replace('Chip:', '').strip() }}{% else %}{{ info }}{% endif %}</td>
</tr>
<tr>
<td>Board</td>
<td>{{ states('sensor.yambms_board_board_name') }}</td>
</tr>
<tr>
<td>Board Uptime</td>
<td>{{ states('sensor.yambms_board_uptime') }}</td>
+8 -26
View File
@@ -5,7 +5,7 @@
![GitHub stars](https://img.shields.io/github/stars/Sleeper85/esphome-yambms)
![GitHub forks](https://img.shields.io/github/forks/Sleeper85/esphome-yambms)
![GitHub watchers](https://img.shields.io/github/watchers/Sleeper85/esphome-yambms)
[![Badge Support](https://img.shields.io/badge/Support-YamBMS-FFDD00?logo=buymeacoffee&logoColor=black)](#support)
[!["Buy Me A Coffee"](https://img.shields.io/badge/buy%20me%20a%20coffee-donate-yellow.svg)](https://www.buymeacoffee.com/sleeper85)
> [!TIP]
> This page contains many links to other README.
@@ -25,19 +25,13 @@
> [!IMPORTANT]
> The most important thing for proper functioning of YamBMS is that **the voltage of your BMS is well calibrated**.
> YamBMS logic is based on the cell voltages of your `BMS`.
> YamBMS logic is based on the `min_cell_voltage` and `max_cell_voltage` voltages of your `BMS`.
> If you use `YamBMS`, the internal charging logic of the `JK-PB BMS` will not be used.
> Please read the [documentation](README.md#contents) and the [setup instructions](documents/README/Hardware_and_schematic_instructions.md).
> [!CAUTION]
> **DISCLAIMER:** Working with battery systems involves electrical hazards.
> Please read the [documentation](README.md#contents) and the [setup instructions](documents/README/Hardware_and_schematic_instructions.md)
> before installation and use this project at your own risk.
ESPHome application to `combine` information coming from your `BMS / Balancer / Shunt` and adds a smart layer before transmitting instructions to your inverter on `RS485 or CAN bus` using the protocols `PYLON`, `SMA`, `Victron` or `LuxPower` (EG4).
**Note: Pylontech uses 15S/48V and many others uses 16S/51.2V !**
Other battery profiles that utilise the **`PYLON`** protocol with different cell counts may also work, e.g. Alpha Ess Smile, BYD Battery-Box LV Flex Lite.
Select the correct battery profile in the inverter to match your battery pack !
| ESPHome application to `combine` information coming from<br>your `BMS / Balancer / Shunt` and adds a smart layer before<br>transmitting instructions to your inverter on `RS485 or CAN bus`<br>using the protocols `PYLON`, `SMA`, `Victron` or `LuxPower` (EG4). | <a href="https://www.buymeacoffee.com/Sleeper85" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a> |
| --- | --- |
| **Note: Pylontech uses 15S/48V and many others uses 16S/51.2V !**<br><br>Other battery profiles that utilise the **`PYLON`** protocol with different cell counts<br>may also work, e.g. Alpha Ess Smile, BYD Battery-Box LV Flex Lite.<br>Select the correct battery profile in the inverter to match your battery pack !<br><br>**DISCLAIMER:** Working with battery systems involves electrical hazards.<br>Please read the complete documentation before installation and use<br>this project at your own risk. | <a href="https://www.buymeacoffee.com/Sleeper85" target="_blank"><img src="images/BMC_QR.png" alt="Buy Me A Coffee" style="height: 217px !important;width: 217px !important;" ></a> |
**Sends over CAN / RS485 bus to your inverter :**
- Battery Voltage
@@ -180,7 +174,7 @@ rx_pin: 22 # to CAN board CRX (with 4.7K resistor except for SN65HVD230)
## Requirements
* [ESPHome 2026.11.0 or higher](https://github.com/esphome/esphome/releases)
* [ESPHome 2026.10.0 or higher](https://github.com/esphome/esphome/releases)
* ESP32 MCU (buying a board with ≥8MB flash is advised if you intend to monitor multiple BMS)
* CAN transceiver (only with TJA1050/TJA1051 => 4.7K resistor for 5V to 3V3 level shifing)
* BMS JK, JBD, Seplos (other BMS brands already integrated with ESPhome can be added easily)
@@ -196,15 +190,3 @@ rx_pin: 22 # to CAN board CRX (with 4.7K resistor except for SN65HVD230)
* Thanks to [@Fahmula](https://github.com/Fahmula) for developing the `PYLON RS485` component.
* Thanks to [@uksa007](https://www.patreon.com/Uksa007Codedevelopment) for the development of the first CANBUS code.
* Thanks to all the [contributors](https://github.com/Sleeper85/esphome-yambms/graphs/contributors).
## Support
YamBMS is free and open source, and will stay that way — no paid features,
no supporter-only functions, no locked code.
Hosting, the domain and the tools I use to develop it come to about $300 a year,
out of my own pocket. If YamBMS saved you time or money, a coffee helps cover
the bill. It doesn't buy anything — the project stays exactly the same either way.
[!["Buy Me A Coffee"](https://img.shields.io/badge/Buy%20Me%20a%20Coffee-FFDD00?logo=buymeacoffee&logoColor=black)](https://www.buymeacoffee.com/sleeper85)
[!["PayPal"](https://img.shields.io/badge/PayPal-003087?logo=paypal&logoColor=white)](https://paypal.me/Sleeper85)
+2 -17
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.19
# Version : 1.8.2
# Updated : 2026.11.05
# Version : 1.8.1
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -285,11 +285,6 @@ packages:
bms_cell_ovp: '3.650' # V Used by 'Auto CCL' functions
bms_cell_uvp: '2.800' # V Used by 'Auto DCL' functions and to calculate maximum discharge voltage
bms_balance_trigger_voltage: '0.010' # V Used by 'Auto CVL' functions
# Fake Equalizing: this BMS does not report its balancing state. When enabled, YamBMS infers it
# from the cell spread and holds the Cut-Off timer while the pack balances, instead of ending the charge.
# Warning: a BMS without a balancer (or with balancing disabled) never closes its cell spread, so it can
# stay in Cut-Off a long time, until the EOC timer (30min default) ends the charge, or forever if disabled.
bms_fake_equalizing_enabled: 'true' # true/false, false by default
bms_charging_cycles: '178' # charging cycles number Used to calculate the SoH
bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
@@ -312,11 +307,6 @@ packages:
bms_cell_ovp: '3.650' # V Used by 'Auto CCL' functions
bms_cell_uvp: '2.800' # V Used by 'Auto DCL' functions and to calculate maximum discharge voltage
bms_balance_trigger_voltage: '0.010' # V Used by 'Auto CVL' functions
# Fake Equalizing: this BMS does not report its balancing state. When enabled, YamBMS infers it
# from the cell spread and holds the Cut-Off timer while the pack balances, instead of ending the charge.
# Warning: a BMS without a balancer (or with balancing disabled) never closes its cell spread, so it can
# stay in Cut-Off a long time, until the EOC timer (30min default) ends the charge, or forever if disabled.
bms_fake_equalizing_enabled: 'true' # true/false, false by default
bms_charging_cycles: '226' # charging cycles number Used to calculate the SoH
bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
@@ -339,11 +329,6 @@ packages:
bms_cell_ovp: '3.650' # V Used by 'Auto CCL' functions
bms_cell_uvp: '2.800' # V Used by 'Auto DCL' functions and to calculate maximum discharge voltage
bms_balance_trigger_voltage: '0.010' # V Used by 'Auto CVL' functions
# Fake Equalizing: this BMS does not report its balancing state. When enabled, YamBMS infers it
# from the cell spread and holds the Cut-Off timer while the pack balances, instead of ending the charge.
# Warning: a BMS without a balancer (or with balancing disabled) never closes its cell spread, so it can
# stay in Cut-Off a long time, until the EOC timer (30min default) ends the charge, or forever if disabled.
bms_fake_equalizing_enabled: 'true' # true/false, false by default
bms_charging_cycles: '194' # charging cycles number Used to calculate the SoH
bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
+2 -2
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.08
# Version : 1.8.2
# Updated : 2026.11.05
# Version : 1.8.1
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
+2 -2
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.08
# Version : 1.8.2
# Updated : 2026.11.05
# Version : 1.8.1
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
+2 -2
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.08
# Version : 1.8.2
# Updated : 2026.11.05
# Version : 1.8.1
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
+2 -2
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.08
# Version : 1.8.2
# Updated : 2026.11.05
# Version : 1.8.1
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
+2 -17
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.19
# Version : 1.8.2
# Updated : 2026.11.05
# Version : 1.8.1
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -270,11 +270,6 @@ packages:
## BMS address must start at 2 with EG4 LLV2, ID 1 is a special case and has different output.
bms_address: 2 # BMS 1 modbus address
bms_balance_trigger_voltage: '0.030' # V. Cell spread at which the BMS balances, set yours
# Fake Equalizing: this BMS does not report its balancing state. When enabled, YamBMS infers it
# from the cell spread and holds the Cut-Off timer while the pack balances, instead of ending the charge.
# Warning: a BMS without a balancer (or with balancing disabled) never closes its cell spread, so it can
# stay in Cut-Off a long time, until the EOC timer (30min default) ends the charge, or forever if disabled.
bms_fake_equalizing_enabled: 'false' # true/false, false by default
bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
# BMS 2
- path: 'packages/bms/bms_combine_EG4_LLV2_RS485_bms_full.yaml'
@@ -283,11 +278,6 @@ packages:
bms_name: 'EG4-BMS 2'
bms_address: 3 # BMS 2 modbus address
bms_balance_trigger_voltage: '0.030' # V. Cell spread at which the BMS balances, set yours
# Fake Equalizing: this BMS does not report its balancing state. When enabled, YamBMS infers it
# from the cell spread and holds the Cut-Off timer while the pack balances, instead of ending the charge.
# Warning: a BMS without a balancer (or with balancing disabled) never closes its cell spread, so it can
# stay in Cut-Off a long time, until the EOC timer (30min default) ends the charge, or forever if disabled.
bms_fake_equalizing_enabled: 'false' # true/false, false by default
bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
# BMS 3
- path: 'packages/bms/bms_combine_EG4_LLV2_RS485_bms_full.yaml'
@@ -296,11 +286,6 @@ packages:
bms_name: 'EG4-BMS 3'
bms_address: 4 # BMS 3 modbus address
bms_balance_trigger_voltage: '0.030' # V. Cell spread at which the BMS balances, set yours
# Fake Equalizing: this BMS does not report its balancing state. When enabled, YamBMS infers it
# from the cell spread and holds the Cut-Off timer while the pack balances, instead of ending the charge.
# Warning: a BMS without a balancer (or with balancing disabled) never closes its cell spread, so it can
# stay in Cut-Off a long time, until the EOC timer (30min default) ends the charge, or forever if disabled.
bms_fake_equalizing_enabled: 'false' # true/false, false by default
bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
+2 -2
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.08
# Version : 1.8.2
# Updated : 2026.11.05
# Version : 1.8.1
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
+2 -2
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.08
# Version : 1.8.2
# Updated : 2026.11.05
# Version : 1.8.1
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
+3 -2
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.11
# Version : 1.8.2
# Updated : 2026.11.05
# Version : 1.8.1
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -260,6 +260,7 @@ packages:
# RS485 Sniffer
- path: 'packages/bms/bms_combine_JK_RS485_Modbus_sniffer.yaml'
vars:
sniffer_protocol: 'JK02_32S'
sniffer_uart_id: 'uart_esp_1'
# uart_flow_control_pin: ${talk_pin} # WS-RS485-CAN and other RS485 boards with a flow_control_pin
# BMS 1
+3 -2
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.11
# Version : 1.8.2
# Updated : 2026.11.05
# Version : 1.8.1
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -260,6 +260,7 @@ packages:
# RS485 Sniffer
- path: 'packages/bms/bms_combine_JK_RS485_Modbus_sniffer.yaml'
vars:
sniffer_protocol: 'JK02_32S'
sniffer_uart_id: 'uart_esp_1'
# uart_flow_control_pin: ${talk_pin} # WS-RS485-CAN and other RS485 boards with a flow_control_pin
# BMS 1
+2 -2
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.08
# Version : 1.8.2
# Updated : 2026.11.05
# Version : 1.8.1
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
+2 -2
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.08
# Version : 1.8.2
# Updated : 2026.11.05
# Version : 1.8.1
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
+2 -2
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.08
# Version : 1.8.2
# Updated : 2026.11.05
# Version : 1.8.1
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
+2 -17
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.19
# Version : 1.8.2
# Updated : 2026.11.05
# Version : 1.8.1
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -277,11 +277,6 @@ packages:
bms_cell_ovp: '3.650' # V. Used by 'Auto CCL' functions
bms_cell_uvp: '2.800' # V. Used by 'Auto DCL' functions and to calculate maximum discharge voltage
bms_balance_trigger_voltage: '0.010' # V. Used by 'Auto CVL' functions
# Fake Equalizing: this BMS does not report its balancing state. When enabled, YamBMS infers it
# from the cell spread and holds the Cut-Off timer while the pack balances, instead of ending the charge.
# Warning: a BMS without a balancer (or with balancing disabled) never closes its cell spread, so it can
# stay in Cut-Off a long time, until the EOC timer (30min default) ends the charge, or forever if disabled.
bms_fake_equalizing_enabled: 'false' # true/false, false by default
bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
# BMS 2
- path: 'packages/bms/bms_combine_SEPLOS_V1_V2_RS485_bms_full.yaml'
@@ -298,11 +293,6 @@ packages:
bms_cell_ovp: '3.650' # V. Used by 'Auto CCL' functions
bms_cell_uvp: '2.800' # V. Used by 'Auto DCL' functions and to calculate maximum discharge voltage
bms_balance_trigger_voltage: '0.010' # V. Used by 'Auto CVL' functions
# Fake Equalizing: this BMS does not report its balancing state. When enabled, YamBMS infers it
# from the cell spread and holds the Cut-Off timer while the pack balances, instead of ending the charge.
# Warning: a BMS without a balancer (or with balancing disabled) never closes its cell spread, so it can
# stay in Cut-Off a long time, until the EOC timer (30min default) ends the charge, or forever if disabled.
bms_fake_equalizing_enabled: 'false' # true/false, false by default
bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
# BMS 3
- path: 'packages/bms/bms_combine_SEPLOS_V1_V2_RS485_bms_full.yaml'
@@ -319,11 +309,6 @@ packages:
bms_cell_ovp: '3.650' # V. Used by 'Auto CCL' functions
bms_cell_uvp: '2.800' # V. Used by 'Auto DCL' functions and to calculate maximum discharge voltage
bms_balance_trigger_voltage: '0.010' # V. Used by 'Auto CVL' functions
# Fake Equalizing: this BMS does not report its balancing state. When enabled, YamBMS infers it
# from the cell spread and holds the Cut-Off timer while the pack balances, instead of ending the charge.
# Warning: a BMS without a balancer (or with balancing disabled) never closes its cell spread, so it can
# stay in Cut-Off a long time, until the EOC timer (30min default) ends the charge, or forever if disabled.
bms_fake_equalizing_enabled: 'false' # true/false, false by default
bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
@@ -1,5 +1,5 @@
# Updated : 2026.11.19
# Version : 1.8.2
# Updated : 2026.11.05
# Version : 1.8.1
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -278,11 +278,6 @@ packages:
bms_cell_ovp: '3.650' # V. Used by 'Auto CCL' functions
bms_cell_uvp: '2.800' # V. Used by 'Auto DCL' functions and to calculate maximum discharge voltage
bms_balance_trigger_voltage: '0.010' # V. Used by 'Auto CVL' functions
# Fake Equalizing: this BMS does not report its balancing state. When enabled, YamBMS infers it
# from the cell spread and holds the Cut-Off timer while the pack balances, instead of ending the charge.
# Warning: a BMS without a balancer (or with balancing disabled) never closes its cell spread, so it can
# stay in Cut-Off a long time, until the EOC timer (30min default) ends the charge, or forever if disabled.
bms_fake_equalizing_enabled: 'false' # true/false, false by default
bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
# BMS 2
- path: 'packages/bms/bms_combine_SEPLOS_V3_RS485_bms_full.yaml'
@@ -298,11 +293,6 @@ packages:
bms_cell_ovp: '3.650' # V. Used by 'Auto CCL' functions
bms_cell_uvp: '2.800' # V. Used by 'Auto DCL' functions and to calculate maximum discharge voltage
bms_balance_trigger_voltage: '0.010' # V. Used by 'Auto CVL' functions
# Fake Equalizing: this BMS does not report its balancing state. When enabled, YamBMS infers it
# from the cell spread and holds the Cut-Off timer while the pack balances, instead of ending the charge.
# Warning: a BMS without a balancer (or with balancing disabled) never closes its cell spread, so it can
# stay in Cut-Off a long time, until the EOC timer (30min default) ends the charge, or forever if disabled.
bms_fake_equalizing_enabled: 'false' # true/false, false by default
bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
# BMS 3
- path: 'packages/bms/bms_combine_SEPLOS_V3_RS485_bms_full.yaml'
@@ -318,11 +308,6 @@ packages:
bms_cell_ovp: '3.650' # V. Used by 'Auto CCL' functions
bms_cell_uvp: '2.800' # V. Used by 'Auto DCL' functions and to calculate maximum discharge voltage
bms_balance_trigger_voltage: '0.010' # V. Used by 'Auto CVL' functions
# Fake Equalizing: this BMS does not report its balancing state. When enabled, YamBMS infers it
# from the cell spread and holds the Cut-Off timer while the pack balances, instead of ending the charge.
# Warning: a BMS without a balancer (or with balancing disabled) never closes its cell spread, so it can
# stay in Cut-Off a long time, until the EOC timer (30min default) ends the charge, or forever if disabled.
bms_fake_equalizing_enabled: 'false' # true/false, false by default
bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
+2 -2
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.08
# Version : 1.8.2
# Updated : 2026.11.05
# Version : 1.8.1
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
+2 -17
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.19
# Version : 1.8.2
# Updated : 2026.11.05
# Version : 1.8.1
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -278,11 +278,6 @@ packages:
bms_cell_ovp: '3.650' # V Used by 'Auto CCL' functions
bms_cell_uvp: '2.800' # V Used by 'Auto DCL' functions and to calculate maximum discharge voltage
bms_balance_trigger_voltage: '0.010' # V Used by 'Auto CVL' functions
# Fake Equalizing: this BMS does not report its balancing state. When enabled, YamBMS infers it
# from the cell spread and holds the Cut-Off timer while the pack balances, instead of ending the charge.
# Warning: a BMS without a balancer (or with balancing disabled) never closes its cell spread, so it can
# stay in Cut-Off a long time, until the EOC timer (30min default) ends the charge, or forever if disabled.
bms_fake_equalizing_enabled: 'true' # true/false, false by default
bms_charging_cycles: '178' # charging cycles number Used to calculate the SoH
bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
@@ -305,11 +300,6 @@ packages:
bms_cell_ovp: '3.650' # V Used by 'Auto CCL' functions
bms_cell_uvp: '2.800' # V Used by 'Auto DCL' functions and to calculate maximum discharge voltage
bms_balance_trigger_voltage: '0.010' # V Used by 'Auto CVL' functions
# Fake Equalizing: this BMS does not report its balancing state. When enabled, YamBMS infers it
# from the cell spread and holds the Cut-Off timer while the pack balances, instead of ending the charge.
# Warning: a BMS without a balancer (or with balancing disabled) never closes its cell spread, so it can
# stay in Cut-Off a long time, until the EOC timer (30min default) ends the charge, or forever if disabled.
bms_fake_equalizing_enabled: 'true' # true/false, false by default
bms_charging_cycles: '226' # charging cycles number Used to calculate the SoH
bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
@@ -332,11 +322,6 @@ packages:
bms_cell_ovp: '3.650' # V Used by 'Auto CCL' functions
bms_cell_uvp: '2.800' # V Used by 'Auto DCL' functions and to calculate maximum discharge voltage
bms_balance_trigger_voltage: '0.010' # V Used by 'Auto CVL' functions
# Fake Equalizing: this BMS does not report its balancing state. When enabled, YamBMS infers it
# from the cell spread and holds the Cut-Off timer while the pack balances, instead of ending the charge.
# Warning: a BMS without a balancer (or with balancing disabled) never closes its cell spread, so it can
# stay in Cut-Off a long time, until the EOC timer (30min default) ends the charge, or forever if disabled.
bms_fake_equalizing_enabled: 'true' # true/false, false by default
bms_charging_cycles: '194' # charging cycles number Used to calculate the SoH
bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
+2 -2
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.08
# Version : 1.8.2
# Updated : 2026.11.05
# Version : 1.8.1
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
+2 -2
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.08
# Version : 1.8.2
# Updated : 2026.11.05
# Version : 1.8.1
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
+2 -2
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.08
# Version : 1.8.2
# Updated : 2026.11.05
# Version : 1.8.1
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
+2 -2
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.08
# Version : 1.8.2
# Updated : 2026.11.05
# Version : 1.8.1
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
+2 -2
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.08
# Version : 1.8.2
# Updated : 2026.11.05
# Version : 1.8.1
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -1,5 +1,5 @@
# Updated : 2026.11.08
# Version : 1.8.2
# Updated : 2026.11.05
# Version : 1.8.1
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
+4 -39
View File
@@ -18,37 +18,6 @@ The charging voltage and current correspond to the default values in the YAML sc
![Image](../../images/YamBMS_Charging_Logic_Diagram.png "YamBMS Charging Logic")
## BMS dropout
While no BMS is combined (boot, reboot, OTA update, RS485 or BLE dropout), the charging logic is suspended:
- the `Charging Status` keeps its value: a battery in `Float` or `EOC` stays there and is not sent back to `Bulk` when the BMS returns;
- the cut-off timer and the EOC timer are stopped: a dropout during the `Cut-Off` phase cannot declare an EOC with no BMS to confirm it;
- the `Charging Instruction` is `Stop`, the `Discharging Instruction` is off, and the requested values (CVL, DVL, CCL, DCL) are unknown;
- nothing is sent to the inverter until YamBMS is initialized again.
When a BMS is combined again, the logic resumes from the kept status, and the usual rebulk rules apply: if the battery was discharged during the dropout, `Rebulk voltage`, `Rebulk SoC` or `Rebulk days` start a new `Bulk`.
## Charging blocked (Wait)
While at least one BMS is combined, the `Charging Status` goes to `Wait` when charging is not allowed:
- without `bms_options_charging_logic.yaml`: when the `Charging` switch is off, or when no combined BMS allows charging (protection, charge switch off);
- with `bms_options_charging_logic.yaml`: only when the `Charging` switch is off. In that mode YamBMS turns the BMS charge switch off itself at Cut-Off, and that block must not change the status.
In `Wait` the `Charging Instruction` is `Stop`, and the cut-off timer and the EOC timer are stopped: an EOC is only declared while charging is allowed.
When charging is allowed again:
- a battery that was in `Float` or `EOC` goes back there, unless a rebulk rule applies (`Rebulk voltage`, `Rebulk SoC`, `Rebulk days`, `Force Bulk` or `Request Force Charge`), in which case a new `Bulk` starts;
- any other status (`Init`, `Bulk`, `Cut-Off`, `Balancing`) goes to `Bulk`.
## Bulk to Float with Auto Float
With `Automatic Float Voltage` enabled and a bulk voltage above the float voltage, the `Requested Charge Voltage (CVL)` does not drop when `Float` starts: the first `Float` CVL is the bulk voltage, and it is then lowered step by step down to the float voltage. See [Auto Float Voltage](YamBMS_functions.md#auto-float-voltage).
If the bulk or float voltage is changed less than a minute before `Float` starts, the first `Float` CVL can still use the previous values until the next Auto Float update, at most 60 s later.
## Cut-Off Charging Logic Equation
Source: [Charging Marine Lithium Battery Banks](https://nordkyndesign.com/charging-marine-lithium-battery-banks)
@@ -106,21 +75,17 @@ Once the **Cut-Off phase** is entered:
- otherwise the **cut-off timer** starts (`180s` default): if the Cut-Off conditions still hold when it expires, the **EOC** (End Of Charge) is declared;
- in parallel, if the `EOC timer` switch is enabled, the **EOC timer** (`30min` default) guarantees that the Cut-Off phase ends at the latest when it expires, even if cells are still equalizing.
Returning to the Bulk phase, going to `Wait` or a BMS dropout stops both timers.
Returning to the Bulk phase stops both timers.
Some BMS balance their cells but never expose a balancing flag. YamBMS infers it for
them, from the max cell reaching the bulk setpoint together with a cell spread that has
reached `bms_balance_trigger_voltage`, the threshold at which that pack's own balancer
engages, so the cut-off timer is held exactly as it would be with a
BMS that reports the flag. A real external balancer, when one is online, always takes
priority over the inference. It is available, but **disabled by default**, for Seplos V3,
Seplos V1/V2, EG4 LL v2 and JK RS485 DISPLAY: enable it per BMS with
`bms_fake_equalizing_enabled: 'true'`. A pack that does not actually balance (no balancer,
balancing disabled, or a balancer too weak for the pack) never closes its cell spread, so
the charge can stay in Cut-Off until the EOC timer ends it, or indefinitely if the
`EOC Timer enabled` switch is off. See
priority over the inference. This is enabled by default for Seplos V3, Seplos V1/V2,
EG4 LL v2 and JK RS485 DISPLAY — see
[Changelog_Fake_Equalizing.md](changelog/Changelog_Fake_Equalizing.md) for the references
it uses and how to tune it.
it uses and how to tune or disable it.
## LFP Cut-Off Values
+1 -1
View File
@@ -67,7 +67,7 @@ In Home Assistant under **" Settings > Devices and services > Add Intergration "
### 1. Install ESPHome on your computer
Before you can flash your ESP32 you need to install the [ESPHome 2026.11.0 or higher](https://github.com/esphome/esphome/releases) command line application.<br>
Before you can flash your ESP32 you need to install the [ESPHome 2025.11.0 or higher](https://github.com/esphome/esphome/releases) command line application.<br>
[Follow these instructions for installation on Windows, Mac or Linux.](https://esphome.io/guides/installing_esphome)
> [!TIP]
+2 -4
View File
@@ -204,11 +204,9 @@ The Deye inverter sends the ACK (can_id `0x305`) only when it receives the can_i
## Warning & Alarms
If all combined BMS have alarms, the alarms are sent to the `CAN bus` as `Protection Alarms`.
If all BMS have alarms, the alarms are sent to the `CAN bus` as `Protection Alarms`.
If at least one combined BMS has no alarms, the alarms are sent to the CAN bus as `Warning`.
Only combined BMS are counted. A BMS that is not combined (offline, or with missing data) is ignored, so a single BMS in protection while the others are offline sends `Protection Alarms`.
If at least one BMS has no alarms, the alarms are sent to the CAN bus as `Warning`.
Both **text_sensor** `Alarm` and `Warning` show the alarms/warnings currently transmitted to the inverter.
+1 -7
View File
@@ -193,10 +193,6 @@ This function allows you to force a charge from `GRID` :
- when `SoC <= Start SoC` the forced charge start
- when `SoC >= Stop SoC` the forced charge stop
The request is only evaluated while at least one BMS is combined. During a reboot or a BMS dropout
the SoC is not a real value, so the request keeps its last state. Turning the switch off clears it
at once.
Works only with `PYLON`, `LuxPower` and `Victron` protocols.
## Auto functions
@@ -404,8 +400,6 @@ This feature might not work with all inverters as good or is not required if the
The voltage steps can be configured (default `0.1V`) with `Auto Float Voltage Step`. The update interval can be configured (default `3 minutes`) with `Auto Float Update Interval`.
The adjustment only applies while the `Charging Instruction` is `Float`. When `Float` starts, the `Requested Charge Voltage (CVL)` stays at the bulk voltage and the step-down starts from there, with no drop to the float voltage in between. When a rebulk or `Force Bulk` starts a new `Bulk`, the `Requested Charge Voltage (CVL)` goes straight back to the bulk voltage.
## Auto EOC
![Image](../../images/YamBMS_Auto_EOC.png "YamBMS Auto EOC")
@@ -496,7 +490,7 @@ The text sensor `Auto SoC Limit Status` will show the current status of the func
Modes:
- `Float`: Will set the charging mode from `Bulk` to `Float`. If already at `Float`, nothing will happen.
- `CCL`: Limits the `Requested Charge Current (CCL)` to the value set by `Auto SoC Limit CCL`. The limit follows the `Max Charge Current` while it is held, so it stays at `Auto SoC Limit CCL` when a pack rejoins the bank. The limit will be removed once the `SoC` is below `Auto SoC Limit` - `Auto SoC Hysteresis`.
- `CCL`: Limits the `Requested Charge Current (CCL)` to the value set by `Auto SoC Limit CCL`. The limit will be removed once the `SoC` is below `Auto SoC Limit` - `Auto SoC Hysteresis`.
- `Float + CCL`: Will use both previously described methods. However while the `Requested Charge Current (CCL)` will be removed, the charging mode will not be reset to `Bulk`. For this, `Rebulk SoC` is available.
Note: Some inverters may not like `0A` for `Requested Charge Current (CCL)`. `Auto SoC Limit CCL` allows to set a small value to effectively limit the charging process.
-20
View File
@@ -6,26 +6,6 @@
![GitHub forks](https://img.shields.io/github/forks/Sleeper85/esphome-yambms)
![GitHub watchers](https://img.shields.io/github/watchers/Sleeper85/esphome-yambms)
* YamBMS 1.8.2 :
* Set esphome `min_version` to `2026.11.0`
* Updated EG4 LL-V2 component to [v1.1.1](https://github.com/RAR/esphome-eg4-bms/releases/tag/v1.1.1) : it builds on ESPHome 2026.11, which removed `format_hex_pretty()` ; v1.1.0 fails to compile with `'format_hex_pretty' was not declared in this scope`
* Updated EG4 LL-V2 component to [v1.1.4](https://github.com/RAR/esphome-eg4-bms/releases/tag/v1.1.4) : a pack goes offline when either of its two register blocks stops giving valid replies, and that block's sensors go unknown ; before, one good block kept the pack online with the other block's values going stale. The bus now waits `turnaround_time` (50 ms) after a reply before the next request, as a request sent right after another pack's reply was often not answered, and only the reply to the request in flight ends that wait ([RAR/esphome-eg4-bms#9](https://github.com/RAR/esphome-eg4-bms/issues/9))
* EG4 LL-V2 errors bitmask : protection bit 12 "Low Capacity" no longer raises a General alarm ; EG4 packs hold it while full and charging has stopped, so every full charge reported an alarm to the inverter (#342). Discharge over temperature and discharge under temperature protection, which were not mapped, now raise the high and low temperature alarms
* ESPHome 2026.11 requires a `relation` on every sub-device : the BMS, Shunt, Balancer, sniffer, Deye, board, YamBMS and inverter link devices are all declared as `via`, which is how Home Assistant already showed them, so your devices and entities stay as they are
* Waveshare ESP32-S3 Touch-LCD 4.3, 4.3B and 7 : removed the `enable_pin` workaround added in 1.8.1 for `Pin 2 is used in multiple places`, ESPHome 2026.11 now resolves this conflict itself ; the display and the backlight behave as before
* JK RS485 (JK-PB, and recent JK-B using the `JK BMS RS485 Modbus V1.0` protocol) : the sniffer packages temporarily load the [JK RS485 components](https://github.com/Sleeper85/esphome-components/tree/dev) 1.2 from the `dev` branch, until 1.2 is released on `main`. Full list in the [JK RS485 changelog](https://github.com/Sleeper85/esphome-components/blob/dev/documents/README/changelog/Changelog.md). Main fixes :
* JK-B package : toggling the `heating`, `display always on`, `disable temperature sensors` or `smart sleep on` switch **crashed and rebooted the ESP**, which also cut the CAN link to the inverter ; these switches now work, and only the toggled one is written to the BMS
* Numbers are rounded instead of truncated before being written : `3.350 V` was written `3.349 V`
* A BMS that goes offline no longer turns its status and alarm binary sensors `on` (charging, discharging, balancing, heating...) : they become unknown until the BMS answers again
* The `broadcast` mode no longer applies to the `charging` and `discharging` switches; it now applies **only to the BMS settings**. The `Broadcasting BMS settings to all BMS` switch is now `ON` by default.
* Mode 2 : a BMS that stops answering is removed from `network nodes available` and found again when it comes back
* The components build with ESPHome 2026.11 at log level `DEBUG`
* JK RS485 : removed the `precharging` switch and the `operation status` and `battery type` text sensors, which never received a value ; Home Assistant may keep them as unavailable entities, which you can delete
* JK RS485 : the `sniffer_protocol` var is no longer used (JK RS485 1.2 removed `protocol_version`) ; you can remove it from your YAML, keeping it does no harm
* Fixed [issue 344](https://github.com/Sleeper85/esphome-yambms/issues/344) : the `Protection Alarms` were never sent to the inverter while a BMS was offline, only `Warning` ; they are now sent when all **combined** BMS are in alarm, an offline BMS no longer counts. The `Alarm` text sensor follows
* Fixed [issue 345](https://github.com/Sleeper85/esphome-yambms/issues/345) : on CAN frame `0x359` (PYLON V1, PYLON V2, LuxPower), `Charge Over Current` was sent on bit 7 of bytes 1 and 3 instead of bit 0, so the inverter never received it. `UnBalanced Cell` is no longer sent on bit 4 of these bytes : PYLON V2 defines byte 1 bit 4 as an external communication timeout that stops charge and discharge. Cell imbalance is still sent on frame `0x35A`, where Victron reads it ; PYLON V2 marks that field as reserved
* CAN frame `0x35A` (PYLON V2, SMA, Victron) : an alarm or warning that is not active is now sent as `OK` instead of `not supported`. Each field is 2 bits, and `00` was sent when the alarm was off, which the inverter reads as "not supported" ; a frame with no alarm is now `AA AA AA 02 AA AA AA 02`. This only changes how the alarms are displayed by the inverter, not how it charges
* YamBMS 1.8.1 :
* Set esphome `min_version` to `2026.10.0`
* New documentation :
@@ -97,9 +97,8 @@ reading wins; the inference only applies when no balancer reports for this pack.
## 3. Which BMS are concerned
The four BMS below shipped a hardcoded `return false;`. The package is **included by
default** for them, but **disabled by default**: enable it per BMS with
`bms_fake_equalizing_enabled: 'true'` (see [To enable the inference](#to-enable-the-inference)).
The four BMS below shipped a hardcoded `return false;`. The package is now **included by
default** for them — there is nothing to add to your YAML:
| BMS | Packages |
|---|---|
@@ -165,7 +164,7 @@ They now expose it like the others with the following default values:
bms_id: '1'
# ... other vars of your BMS ...
bms_balance_trigger_voltage: '0.010' # V. Your BMS's balancing threshold
bms_fake_equalizing_enabled: 'true' # Optional : true/false, false by default
bms_fake_equalizing_enabled: 'true' # Optional : true/fasle, true by default
bms_fake_equalizing_hysteresis: '0.030' # Optional : 0.030 by default
bms_fake_equalizing_delta_hysteresis: '0.002' # Optional : 0.002 by default
```
@@ -180,7 +179,7 @@ defaults are fine for any pack.
| Substitution | Default | Meaning |
|---|---|---|
| `bms_fake_equalizing_enabled` | `'false'` | set to `'true'` to turn the inference on for this BMS |
| `bms_fake_equalizing_enabled` | `'true'` | set to `'false'` to turn the inference off for this BMS |
| `bms_fake_equalizing_hysteresis` | `0.030` | how far below the bulk setpoint the max cell may fall before balancing stops |
| `bms_fake_equalizing_delta_hysteresis` | `0.002` | how far below the trigger voltage the spread may fall before balancing stops |
@@ -188,41 +187,30 @@ All of them can be passed per BMS as above, or set once for every BMS in the roo
`substitutions:` block. The spread values are resolved to whole millivolts, the resolution
the cells are reported at, so a value finer than `0.001` has no effect.
### To enable the inference
It is off by default: the flag reports the constant `false` its package used to hardcode.
Turn it on per BMS, without editing any package:
**To disable the inference** on a BMS without editing any package:
```yaml
bms_fake_equalizing_enabled: 'true'
bms_fake_equalizing_enabled: 'false'
```
> [!WARNING]
> Enable it only if the pack actually balances at the configured
> `bms_balance_trigger_voltage`. A BMS without a balancer, with balancing disabled, or
> with a balancer too weak for the pack never closes its cell spread: the Cut-Off timer
> stays stopped and the charge can stay in Cut-Off for a long time, until the EOC timer
> ends it (`30min` by default), or indefinitely if the `EOC Timer enabled` switch is off.
To turn it off again, set it back to `'false'`. Do *not* try to disable it by raising
The flag then reports the constant `false` its package used to hardcode, which is the
behaviour you had before this release. Do *not* try to disable it by raising
`bms_balance_trigger_voltage` instead — that value also feeds `Auto CVL`, where it means
something else entirely: how far the highest cell may overshoot the per-cell setpoint
before the PI clamps.
## 5. What changes for you on upgrade
The inference is disabled by default, so nothing changes until you enable it. Once
enabled on one of the four BMS above, the `balancing` entity turns on at the top
If you own one of the four BMS above, the `balancing` entity will now turn on at the top
of charge as soon as your cells are spread by as much as your BMS's own
`bms_balance_trigger_voltage` — 10 mV on a Seplos or a JK, 30 mV on an EG4 unless you
declared otherwise. The charge then runs until the spread closes back below that, or
until the EOC timer expires, instead of being cut short by the Cut-Off timer. That is the
intended fix, but it *is* a change in charge termination, so watch a couple of cycles
after enabling it.
after updating.
The risk is bounded on the safe side. A false positive can only extend the charge up to
the EOC timer, which exists for exactly that purpose, as long as the `EOC Timer enabled`
switch is on. A false negative simply restores
the EOC timer, which exists for exactly that purpose. A false negative simply restores
the previous behaviour.
## Why not the original pull request
@@ -102,10 +102,6 @@ Every entity carries a `device_id:` that attaches it to the matching ESPHome `su
each BMS, Shunt, Balancer and YamBMS instance appears as its own device in Home Assistant. Always
fill it in — copy an existing package to get it right.
Since ESPHome 2026.11, every entry under `esphome: devices:` requires a `relation:`. Use `via`
for all of them, including the board, the YamBMS instance and the inverter links: it is the value
the API assumed before the key existed, so Home Assistant shows the devices exactly as it did.
## Section comments
Large files (`yambms_core.yaml`, `bms_combine.yaml`, the `YamBMS_LP_*` root YAML) are structured
+5 -76
View File
@@ -42,58 +42,12 @@ The condition in `bms_combine.yaml` checks every sensor the combiner will read.
purpose: a single missing or `NaN` value entering the totals corrupts the aggregate that drives
the inverter. Do not shorten it to a few representative checks.
Every entity in the condition is mandatory: a BMS with one value missing or `NaN` is not
combined.
The condition is evaluated in STEP 1, on the BMS's turn, and published to the `Can be combined`
binary sensor. Do not move it back into a template lambda: a template binary sensor with a lambda
runs it on every loop, about 60 times per second per BMS, for a value read once per round.
`shunt_combine.yaml` follows the same rules: its condition checks the `Combine enabled` switch,
`online_status` and the four values the combiner reads (`voltage > 0`, then `current`, `power`
and `soc` with `isnan()`), and it is evaluated in STEP 1 on the shunt's turn. A combined shunt
replaces the BMS values, so a `NaN` there would reach the inverter directly.
Note that the checks are not uniform, and the difference is deliberate:
- **Sensors use `!std::isnan()`, not `has_state()`.** ESPHome sets `has_state()` on every
publication, a `NaN` included, so a sensor that has published `NaN` once passes it. A sensor's
state starts at `NaN`, so `isnan()` also covers a sensor that never published.
- **Binary sensors use `has_state()`**, a `bool` cannot be `NaN`.
`total_voltage`, `battery_capacity`, `cell_ovp` and `cell_uvp` use `> 0` — a BMS reporting zero
for those is treated as not ready rather than as a valid reading. For `cell_ovp` and `cell_uvp` it
is also the only test that works: several packages (JK, KS, PACE) declare them as a `number`,
whose state starts at `0`, not `NaN`, so `isnan()` would combine the BMS before its protection
settings are read. `max_charge_current` and `max_discharge_current` use `>= 0`: `0 A` is a valid
Note that the checks are not uniform. Most use `has_state()`, but `total_voltage` and
`battery_capacity` use `> 0` — a BMS reporting zero for those is treated as not ready rather than
as a valid reading. `max_charge_current` and `max_discharge_current` use `>= 0`: `0 A` is a valid
limit that a BMS can announce, and it must not take that BMS out of the combination. A `NaN` still
fails the comparison, so a limit that was never received keeps the BMS uncombined.
### STEP 3 only runs on real values
**File:** `packages/yambms/yambms_core.yaml`
STEP 3 is entered only while at least one BMS is combined and every value it reads is real. Its
guard follows the `can_be_combined` rules — `isnan()` or a comparison for sensors, `has_state()`
for binary sensors — because STEP 2 publishes `NaN` when nothing is combined and `has_state()`
stays true after that.
The guard reads the live `var_to_combine_bms_counter`, not `bms_combined`: STEP 3 runs on every
tick, while STEP 2 publishes `bms_combined` only once per round. Reading the counter is what makes
the guard the single "at least one BMS combined" test of STEP 3, with no inner check repeating it.
When the guard fails, the `else` branch suspends the charging logic instead of running it on
`NaN`:
- **`var_charge_status` is not touched.** Running the logic with no BMS forced it to `Wait`, and
the `Init/Wait → Bulk` rebulk rule then restarted a Bulk on a full battery after every dropout.
- **The instructions and requested values are cleared** (`Stop`, off, `NaN`), so that Home
Assistant does not show the last ones during a dropout. No inverter link reads them then: CAN,
PYLON and LIB all stop on `var_initialized`.
- **`var_initialized` is set to false.** STEP 2 already does it when the counter is `0`; the
`else` also covers a round where the counter is back but STEP 2 has not published real values
yet.
### Combined by contribution, combined continuously, uncombined
Three distinct scopes in the same lambda, and they are not interchangeable:
@@ -157,24 +111,6 @@ because they share a CAN ID — that would break both protocols at once.
Byte order is not uniform either: `0x373` sends min cell voltage before max, `0x361` sends max
before min. Both match their respective specifications. Do not "harmonise" them.
### `0x35A` sends OK as `2`, never as `0`
`0x35A` is sent by PYLON V2, SMA and Victron. Each alarm and warning is a 2-bit field read as a
value: `1` (bit N) is active, `2` (bit N+1) is inactive, `0` and `3` mean not supported or
reserved. So a frame with no alarm is `AA AA AA 02 AA AA AA 02`, which is also what a BYD battery
sends at rest. The reserved fields of bytes 3 and 7 stay at `0`.
Do not go back to an all-zero frame on the grounds that "no bit set means no alarm". The inverter
then reads every field as not supported instead of OK, and the alarm list it displays is empty or
wrong. Do not write `0` for a field either: it is not "off", it is "this battery does not report
it".
### `0x359` does not carry cell imbalance
PYLON V2 uses byte 1 bit 4 of `0x359` for a communication timeout that stops charge and
discharge, and byte 3 bit 4 is reserved. Cell imbalance used to be sent on both, so an imbalance
alarm could stop the inverter. It is only sent on `0x35A` now. Do not put it back in `0x359`.
## Frame sequencing
**File:** `packages/yambms/yambms_canbus.yaml`
@@ -412,14 +348,7 @@ is why it has its own entry.
into an exception frame, so the inverter still gets an answer on a link that should be silent.
`ModbusServerHub::find_device_()` matches the address on every request, so moving the server to
address `248` makes the hub drop the request instead. The 100 ms interval moves it back to `1`
only while `rs485${rs485_id}_active_protocol` is `LIB` **and** YamBMS is initialized
(`var_initialized` and at least one BMS combined).
The second condition is the gate the CAN and PYLON links already apply: no frame on CAN, `NaN`
proxies on PYLON. Without it, the LIB link answered during a boot or a BMS dropout, and its
`read_lambda`s converted the `NaN` values to integers, which is undefined. The status mirroring
still follows `active` only: an active link left silent serves no request, its `Status` goes
false and raises the fault, exactly like the other links during a dropout.
only while `rs485${rs485_id}_active_protocol` is `LIB`.
Do not replace this with reported charge and discharge limits of zero: the inverter would still
see a battery, on a link the user believes is off.
@@ -528,7 +457,7 @@ missing key then fails validation instead of picking a speed.
`modbus_baud_rate` is the exception that keeps its place in `substitutions:`: `yambms_config.yaml`
shares it between the nodes of a multi-node setup from the root.
### `flow_control` is enabled by a var, so `min_version` is at least 2026.10.0
### `flow_control` is enabled by a var, so `min_version` is 2026.10.0
`uart_flow_control_pin` is passed like any other var of the import and reaches the UART file,
which includes `board_options_itf_uart_flow_control.yaml` only when it is defined. So no consumer
@@ -57,11 +57,6 @@ packages:
bms_cell_ovp: '3.650' # V Used by 'Auto CCL' functions
bms_cell_uvp: '2.800' # V Used by 'Auto DCL' functions and to calculate maximum discharge voltage
bms_balance_trigger_voltage: '0.010' # V Used by 'Auto CVL' functions
# Fake Equalizing: this BMS does not report its balancing state. When enabled, YamBMS infers it
# from the cell spread and holds the Cut-Off timer while the pack balances, instead of ending the charge.
# Warning: a BMS without a balancer (or with balancing disabled) never closes its cell spread, so it can
# stay in Cut-Off a long time, until the EOC timer (30min default) ends the charge, or forever if disabled.
bms_fake_equalizing_enabled: 'true' # true/false, false by default
bms_charging_cycles: '178' # charging cycles number Used to calculate the SoH
bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
@@ -84,11 +79,6 @@ packages:
bms_cell_ovp: '3.650' # V Used by 'Auto CCL' functions
bms_cell_uvp: '2.800' # V Used by 'Auto DCL' functions and to calculate maximum discharge voltage
bms_balance_trigger_voltage: '0.010' # V Used by 'Auto CVL' functions
# Fake Equalizing: this BMS does not report its balancing state. When enabled, YamBMS infers it
# from the cell spread and holds the Cut-Off timer while the pack balances, instead of ending the charge.
# Warning: a BMS without a balancer (or with balancing disabled) never closes its cell spread, so it can
# stay in Cut-Off a long time, until the EOC timer (30min default) ends the charge, or forever if disabled.
bms_fake_equalizing_enabled: 'true' # true/false, false by default
bms_charging_cycles: '226' # charging cycles number Used to calculate the SoH
bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
@@ -111,10 +101,5 @@ packages:
bms_cell_ovp: '3.650' # V Used by 'Auto CCL' functions
bms_cell_uvp: '2.800' # V Used by 'Auto DCL' functions and to calculate maximum discharge voltage
bms_balance_trigger_voltage: '0.010' # V Used by 'Auto CVL' functions
# Fake Equalizing: this BMS does not report its balancing state. When enabled, YamBMS infers it
# from the cell spread and holds the Cut-Off timer while the pack balances, instead of ending the charge.
# Warning: a BMS without a balancer (or with balancing disabled) never closes its cell spread, so it can
# stay in Cut-Off a long time, until the EOC timer (30min default) ends the charge, or forever if disabled.
bms_fake_equalizing_enabled: 'true' # true/false, false by default
bms_charging_cycles: '194' # charging cycles number Used to calculate the SoH
bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
@@ -40,11 +40,6 @@ packages:
## BMS address must start at 2 with EG4 LLV2, ID 1 is a special case and has different output.
bms_address: 2 # BMS 1 modbus address
bms_balance_trigger_voltage: '0.030' # V. Cell spread at which the BMS balances, set yours
# Fake Equalizing: this BMS does not report its balancing state. When enabled, YamBMS infers it
# from the cell spread and holds the Cut-Off timer while the pack balances, instead of ending the charge.
# Warning: a BMS without a balancer (or with balancing disabled) never closes its cell spread, so it can
# stay in Cut-Off a long time, until the EOC timer (30min default) ends the charge, or forever if disabled.
bms_fake_equalizing_enabled: 'false' # true/false, false by default
bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
bms2: !include
@@ -54,11 +49,6 @@ packages:
bms_name: 'EG4-BMS 2'
bms_address: 3 # BMS 2 modbus address
bms_balance_trigger_voltage: '0.030' # V. Cell spread at which the BMS balances, set yours
# Fake Equalizing: this BMS does not report its balancing state. When enabled, YamBMS infers it
# from the cell spread and holds the Cut-Off timer while the pack balances, instead of ending the charge.
# Warning: a BMS without a balancer (or with balancing disabled) never closes its cell spread, so it can
# stay in Cut-Off a long time, until the EOC timer (30min default) ends the charge, or forever if disabled.
bms_fake_equalizing_enabled: 'false' # true/false, false by default
bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
bms3: !include
@@ -68,9 +58,4 @@ packages:
bms_name: 'EG4-BMS 3'
bms_address: 4 # BMS 3 modbus address
bms_balance_trigger_voltage: '0.030' # V. Cell spread at which the BMS balances, set yours
# Fake Equalizing: this BMS does not report its balancing state. When enabled, YamBMS infers it
# from the cell spread and holds the Cut-Off timer while the pack balances, instead of ending the charge.
# Warning: a BMS without a balancer (or with balancing disabled) never closes its cell spread, so it can
# stay in Cut-Off a long time, until the EOC timer (30min default) ends the charge, or forever if disabled.
bms_fake_equalizing_enabled: 'false' # true/false, false by default
bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
@@ -1,5 +1,5 @@
# Updated : 2026.11.11
# Version : 1.1.6
# Updated : 2026.02.16
# Version : 1.1.5
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -32,6 +32,7 @@ packages:
sniffer1: !include
file: packages/bms/bms_combine_JK_RS485_Modbus_sniffer.yaml
vars:
sniffer_protocol: 'JK02_32S'
sniffer_uart_id: 'uart_esp_1'
# uart_flow_control_pin: ${talk_pin} # WS-RS485-CAN and other RS485 boards with a flow_control_pin
@@ -1,5 +1,5 @@
# Updated : 2026.11.11
# Version : 1.1.6
# Updated : 2026.02.16
# Version : 1.1.5
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -32,6 +32,7 @@ packages:
sniffer1: !include
file: packages/bms/bms_combine_JK_RS485_Modbus_sniffer.yaml
vars:
sniffer_protocol: 'JK02_32S'
sniffer_uart_id: 'uart_esp_1'
# uart_flow_control_pin: ${talk_pin} # WS-RS485-CAN and other RS485 boards with a flow_control_pin
@@ -1,5 +1,5 @@
# Updated : 2026.11.11
# Version : 1.1.6
# Updated : 2026.02.16
# Version : 1.1.5
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -32,6 +32,7 @@ packages:
sniffer1: !include
file: packages/bms/bms_combine_JK_RS485_Modbus_sniffer.yaml
vars:
sniffer_protocol: 'JK02_32S'
sniffer_uart_id: 'uart_esp_1'
# uart_flow_control_pin: ${talk_pin} # WS-RS485-CAN and other RS485 boards with a flow_control_pin
@@ -47,11 +47,6 @@ packages:
bms_cell_ovp: '3.650' # V. Used by 'Auto CCL' functions
bms_cell_uvp: '2.800' # V. Used by 'Auto DCL' functions and to calculate maximum discharge voltage
bms_balance_trigger_voltage: '0.010' # V. Used by 'Auto CVL' functions
# Fake Equalizing: this BMS does not report its balancing state. When enabled, YamBMS infers it
# from the cell spread and holds the Cut-Off timer while the pack balances, instead of ending the charge.
# Warning: a BMS without a balancer (or with balancing disabled) never closes its cell spread, so it can
# stay in Cut-Off a long time, until the EOC timer (30min default) ends the charge, or forever if disabled.
bms_fake_equalizing_enabled: 'false' # true/false, false by default
bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
bms2: !include
@@ -69,11 +64,6 @@ packages:
bms_cell_ovp: '3.650' # V. Used by 'Auto CCL' functions
bms_cell_uvp: '2.800' # V. Used by 'Auto DCL' functions and to calculate maximum discharge voltage
bms_balance_trigger_voltage: '0.010' # V. Used by 'Auto CVL' functions
# Fake Equalizing: this BMS does not report its balancing state. When enabled, YamBMS infers it
# from the cell spread and holds the Cut-Off timer while the pack balances, instead of ending the charge.
# Warning: a BMS without a balancer (or with balancing disabled) never closes its cell spread, so it can
# stay in Cut-Off a long time, until the EOC timer (30min default) ends the charge, or forever if disabled.
bms_fake_equalizing_enabled: 'false' # true/false, false by default
bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
bms3: !include
@@ -91,9 +81,4 @@ packages:
bms_cell_ovp: '3.650' # V. Used by 'Auto CCL' functions
bms_cell_uvp: '2.800' # V. Used by 'Auto DCL' functions and to calculate maximum discharge voltage
bms_balance_trigger_voltage: '0.010' # V. Used by 'Auto CVL' functions
# Fake Equalizing: this BMS does not report its balancing state. When enabled, YamBMS infers it
# from the cell spread and holds the Cut-Off timer while the pack balances, instead of ending the charge.
# Warning: a BMS without a balancer (or with balancing disabled) never closes its cell spread, so it can
# stay in Cut-Off a long time, until the EOC timer (30min default) ends the charge, or forever if disabled.
bms_fake_equalizing_enabled: 'false' # true/false, false by default
bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
@@ -48,11 +48,6 @@ packages:
bms_cell_ovp: '3.650' # V. Used by 'Auto CCL' functions
bms_cell_uvp: '2.800' # V. Used by 'Auto DCL' functions and to calculate maximum discharge voltage
bms_balance_trigger_voltage: '0.010' # V. Used by 'Auto CVL' functions
# Fake Equalizing: this BMS does not report its balancing state. When enabled, YamBMS infers it
# from the cell spread and holds the Cut-Off timer while the pack balances, instead of ending the charge.
# Warning: a BMS without a balancer (or with balancing disabled) never closes its cell spread, so it can
# stay in Cut-Off a long time, until the EOC timer (30min default) ends the charge, or forever if disabled.
bms_fake_equalizing_enabled: 'false' # true/false, false by default
bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
bms2: !include
@@ -69,11 +64,6 @@ packages:
bms_cell_ovp: '3.650' # V. Used by 'Auto CCL' functions
bms_cell_uvp: '2.800' # V. Used by 'Auto DCL' functions and to calculate maximum discharge voltage
bms_balance_trigger_voltage: '0.010' # V. Used by 'Auto CVL' functions
# Fake Equalizing: this BMS does not report its balancing state. When enabled, YamBMS infers it
# from the cell spread and holds the Cut-Off timer while the pack balances, instead of ending the charge.
# Warning: a BMS without a balancer (or with balancing disabled) never closes its cell spread, so it can
# stay in Cut-Off a long time, until the EOC timer (30min default) ends the charge, or forever if disabled.
bms_fake_equalizing_enabled: 'false' # true/false, false by default
bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
bms3: !include
@@ -90,9 +80,4 @@ packages:
bms_cell_ovp: '3.650' # V. Used by 'Auto CCL' functions
bms_cell_uvp: '2.800' # V. Used by 'Auto DCL' functions and to calculate maximum discharge voltage
bms_balance_trigger_voltage: '0.010' # V. Used by 'Auto CVL' functions
# Fake Equalizing: this BMS does not report its balancing state. When enabled, YamBMS infers it
# from the cell spread and holds the Cut-Off timer while the pack balances, instead of ending the charge.
# Warning: a BMS without a balancer (or with balancing disabled) never closes its cell spread, so it can
# stay in Cut-Off a long time, until the EOC timer (30min default) ends the charge, or forever if disabled.
bms_fake_equalizing_enabled: 'false' # true/false, false by default
bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
@@ -61,11 +61,6 @@
bms_cell_ovp: '3.650' # V Used by 'Auto CCL' functions
bms_cell_uvp: '2.800' # V Used by 'Auto DCL' functions and to calculate maximum discharge voltage
bms_balance_trigger_voltage: '0.010' # V Used by 'Auto CVL' functions
# Fake Equalizing: this BMS does not report its balancing state. When enabled, YamBMS infers it
# from the cell spread and holds the Cut-Off timer while the pack balances, instead of ending the charge.
# Warning: a BMS without a balancer (or with balancing disabled) never closes its cell spread, so it can
# stay in Cut-Off a long time, until the EOC timer (30min default) ends the charge, or forever if disabled.
bms_fake_equalizing_enabled: 'true' # true/false, false by default
bms_charging_cycles: '178' # charging cycles number Used to calculate the SoH
bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
@@ -88,11 +83,6 @@
bms_cell_ovp: '3.650' # V Used by 'Auto CCL' functions
bms_cell_uvp: '2.800' # V Used by 'Auto DCL' functions and to calculate maximum discharge voltage
bms_balance_trigger_voltage: '0.010' # V Used by 'Auto CVL' functions
# Fake Equalizing: this BMS does not report its balancing state. When enabled, YamBMS infers it
# from the cell spread and holds the Cut-Off timer while the pack balances, instead of ending the charge.
# Warning: a BMS without a balancer (or with balancing disabled) never closes its cell spread, so it can
# stay in Cut-Off a long time, until the EOC timer (30min default) ends the charge, or forever if disabled.
bms_fake_equalizing_enabled: 'true' # true/false, false by default
bms_charging_cycles: '226' # charging cycles number Used to calculate the SoH
bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
@@ -115,10 +105,5 @@
bms_cell_ovp: '3.650' # V Used by 'Auto CCL' functions
bms_cell_uvp: '2.800' # V Used by 'Auto DCL' functions and to calculate maximum discharge voltage
bms_balance_trigger_voltage: '0.010' # V Used by 'Auto CVL' functions
# Fake Equalizing: this BMS does not report its balancing state. When enabled, YamBMS infers it
# from the cell spread and holds the Cut-Off timer while the pack balances, instead of ending the charge.
# Warning: a BMS without a balancer (or with balancing disabled) never closes its cell spread, so it can
# stay in Cut-Off a long time, until the EOC timer (30min default) ends the charge, or forever if disabled.
bms_fake_equalizing_enabled: 'true' # true/false, false by default
bms_charging_cycles: '194' # charging cycles number Used to calculate the SoH
bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
@@ -44,11 +44,6 @@
## BMS address must start at 2 with EG4 LLV2, ID 1 is a special case and has different output.
bms_address: 2 # BMS 1 modbus address
bms_balance_trigger_voltage: '0.030' # V. Cell spread at which the BMS balances, set yours
# Fake Equalizing: this BMS does not report its balancing state. When enabled, YamBMS infers it
# from the cell spread and holds the Cut-Off timer while the pack balances, instead of ending the charge.
# Warning: a BMS without a balancer (or with balancing disabled) never closes its cell spread, so it can
# stay in Cut-Off a long time, until the EOC timer (30min default) ends the charge, or forever if disabled.
bms_fake_equalizing_enabled: 'false' # true/false, false by default
bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
# BMS 2
- path: 'packages/bms/bms_combine_EG4_LLV2_RS485_bms_full.yaml'
@@ -57,22 +52,12 @@
bms_name: 'EG4-BMS 2'
bms_address: 3 # BMS 2 modbus address
bms_balance_trigger_voltage: '0.030' # V. Cell spread at which the BMS balances, set yours
# Fake Equalizing: this BMS does not report its balancing state. When enabled, YamBMS infers it
# from the cell spread and holds the Cut-Off timer while the pack balances, instead of ending the charge.
# Warning: a BMS without a balancer (or with balancing disabled) never closes its cell spread, so it can
# stay in Cut-Off a long time, until the EOC timer (30min default) ends the charge, or forever if disabled.
bms_fake_equalizing_enabled: 'false' # true/false, false by default
bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
# BMS 3
- path: 'packages/bms/bms_combine_EG4_LLV2_RS485_bms_full.yaml'
vars:
bms_id: '3' # must be a number
bms_id: '2' # must be a number
bms_name: 'EG4-BMS 3'
bms_address: 4 # BMS 3 modbus address
bms_balance_trigger_voltage: '0.030' # V. Cell spread at which the BMS balances, set yours
# Fake Equalizing: this BMS does not report its balancing state. When enabled, YamBMS infers it
# from the cell spread and holds the Cut-Off timer while the pack balances, instead of ending the charge.
# Warning: a BMS without a balancer (or with balancing disabled) never closes its cell spread, so it can
# stay in Cut-Off a long time, until the EOC timer (30min default) ends the charge, or forever if disabled.
bms_fake_equalizing_enabled: 'false' # true/false, false by default
bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
@@ -1,5 +1,5 @@
# Updated : 2026.11.11
# Version : 1.1.6
# Updated : 2026.02.16
# Version : 1.1.5
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -34,6 +34,7 @@
# RS485 Sniffer
- path: 'packages/bms/bms_combine_JK_RS485_Modbus_sniffer.yaml'
vars:
sniffer_protocol: 'JK02_32S'
sniffer_uart_id: 'uart_esp_1'
# uart_flow_control_pin: ${talk_pin} # WS-RS485-CAN and other RS485 boards with a flow_control_pin
# BMS 1
@@ -1,5 +1,5 @@
# Updated : 2026.11.11
# Version : 1.1.6
# Updated : 2026.02.16
# Version : 1.1.5
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -34,6 +34,7 @@
# RS485 Sniffer
- path: 'packages/bms/bms_combine_JK_RS485_Modbus_sniffer.yaml'
vars:
sniffer_protocol: 'JK02_32S'
sniffer_uart_id: 'uart_esp_1'
# uart_flow_control_pin: ${talk_pin} # WS-RS485-CAN and other RS485 boards with a flow_control_pin
# BMS 1
@@ -51,11 +51,6 @@
bms_cell_ovp: '3.650' # V. Used by 'Auto CCL' functions
bms_cell_uvp: '2.800' # V. Used by 'Auto DCL' functions and to calculate maximum discharge voltage
bms_balance_trigger_voltage: '0.010' # V. Used by 'Auto CVL' functions
# Fake Equalizing: this BMS does not report its balancing state. When enabled, YamBMS infers it
# from the cell spread and holds the Cut-Off timer while the pack balances, instead of ending the charge.
# Warning: a BMS without a balancer (or with balancing disabled) never closes its cell spread, so it can
# stay in Cut-Off a long time, until the EOC timer (30min default) ends the charge, or forever if disabled.
bms_fake_equalizing_enabled: 'false' # true/false, false by default
bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
# BMS 2
- path: 'packages/bms/bms_combine_SEPLOS_V1_V2_RS485_bms_full.yaml'
@@ -72,11 +67,6 @@
bms_cell_ovp: '3.650' # V. Used by 'Auto CCL' functions
bms_cell_uvp: '2.800' # V. Used by 'Auto DCL' functions and to calculate maximum discharge voltage
bms_balance_trigger_voltage: '0.010' # V. Used by 'Auto CVL' functions
# Fake Equalizing: this BMS does not report its balancing state. When enabled, YamBMS infers it
# from the cell spread and holds the Cut-Off timer while the pack balances, instead of ending the charge.
# Warning: a BMS without a balancer (or with balancing disabled) never closes its cell spread, so it can
# stay in Cut-Off a long time, until the EOC timer (30min default) ends the charge, or forever if disabled.
bms_fake_equalizing_enabled: 'false' # true/false, false by default
bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
# BMS 3
- path: 'packages/bms/bms_combine_SEPLOS_V1_V2_RS485_bms_full.yaml'
@@ -93,9 +83,4 @@
bms_cell_ovp: '3.650' # V. Used by 'Auto CCL' functions
bms_cell_uvp: '2.800' # V. Used by 'Auto DCL' functions and to calculate maximum discharge voltage
bms_balance_trigger_voltage: '0.010' # V. Used by 'Auto CVL' functions
# Fake Equalizing: this BMS does not report its balancing state. When enabled, YamBMS infers it
# from the cell spread and holds the Cut-Off timer while the pack balances, instead of ending the charge.
# Warning: a BMS without a balancer (or with balancing disabled) never closes its cell spread, so it can
# stay in Cut-Off a long time, until the EOC timer (30min default) ends the charge, or forever if disabled.
bms_fake_equalizing_enabled: 'false' # true/false, false by default
bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
@@ -52,11 +52,6 @@
bms_cell_ovp: '3.650' # V. Used by 'Auto CCL' functions
bms_cell_uvp: '2.800' # V. Used by 'Auto DCL' functions and to calculate maximum discharge voltage
bms_balance_trigger_voltage: '0.010' # V. Used by 'Auto CVL' functions
# Fake Equalizing: this BMS does not report its balancing state. When enabled, YamBMS infers it
# from the cell spread and holds the Cut-Off timer while the pack balances, instead of ending the charge.
# Warning: a BMS without a balancer (or with balancing disabled) never closes its cell spread, so it can
# stay in Cut-Off a long time, until the EOC timer (30min default) ends the charge, or forever if disabled.
bms_fake_equalizing_enabled: 'false' # true/false, false by default
bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
# BMS 2
- path: 'packages/bms/bms_combine_SEPLOS_V3_RS485_bms_full.yaml'
@@ -72,11 +67,6 @@
bms_cell_ovp: '3.650' # V. Used by 'Auto CCL' functions
bms_cell_uvp: '2.800' # V. Used by 'Auto DCL' functions and to calculate maximum discharge voltage
bms_balance_trigger_voltage: '0.010' # V. Used by 'Auto CVL' functions
# Fake Equalizing: this BMS does not report its balancing state. When enabled, YamBMS infers it
# from the cell spread and holds the Cut-Off timer while the pack balances, instead of ending the charge.
# Warning: a BMS without a balancer (or with balancing disabled) never closes its cell spread, so it can
# stay in Cut-Off a long time, until the EOC timer (30min default) ends the charge, or forever if disabled.
bms_fake_equalizing_enabled: 'false' # true/false, false by default
bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
# BMS 3
- path: 'packages/bms/bms_combine_SEPLOS_V3_RS485_bms_full.yaml'
@@ -92,9 +82,4 @@
bms_cell_ovp: '3.650' # V. Used by 'Auto CCL' functions
bms_cell_uvp: '2.800' # V. Used by 'Auto DCL' functions and to calculate maximum discharge voltage
bms_balance_trigger_voltage: '0.010' # V. Used by 'Auto CVL' functions
# Fake Equalizing: this BMS does not report its balancing state. When enabled, YamBMS infers it
# from the cell spread and holds the Cut-Off timer while the pack balances, instead of ending the charge.
# Warning: a BMS without a balancer (or with balancing disabled) never closes its cell spread, so it can
# stay in Cut-Off a long time, until the EOC timer (30min default) ends the charge, or forever if disabled.
bms_fake_equalizing_enabled: 'false' # true/false, false by default
bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
@@ -1,5 +1,5 @@
# Updated : 2026.11.08
# Version : 1.1.2
# Updated : 2025.12.23
# Version : 1.1.1
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -23,4 +23,3 @@ esphome:
devices:
- id: balancer_${bms_id}
name: "${balancer_name}"
relation: via
+2 -13
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.14
# Version : 1.3.0
# Updated : 2026.08.31
# Version : 1.2.9
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -68,8 +68,6 @@ esphome:
- lambda: |-
// Register System
id(global_register_led)(${CAT_SYSTEM}, ${board_fault_device_id}, id(${board_status_led_id}));
// Constant, so published once: the API resends the stored state on every connection
id(esp32_board_name).publish_state("${board_name}");
time:
# https://esphome.io/components/time/homeassistant
@@ -161,15 +159,6 @@ text_sensor:
if (!t.is_valid()) return {};
return t.strftime("%Y-%m-%d %H:%M:%S");
# Board name, from the board_name substitution of the board_*.yaml
- platform: template
name: Board name
id: esp32_board_name
device_id: ${board_id}
update_interval: never # published once by on_boot
icon: mdi:developer-board
entity_category: diagnostic
# https://esphome.io/components/text_sensor/version
- platform: version
name: ESPHome version
+4 -4
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.08
# Version : 1.8.2
# Updated : 2026.11.05
# Version : 1.8.1
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -18,7 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/gpl.html>.
substitutions:
yambms_version: "1.8.2"
yambms_version: "1.8.1"
esphome:
name: ${hostname}
@@ -28,4 +28,4 @@ esphome:
project:
name: Sleeper85.YamBMS
version: ${yambms_version}
min_version: 2026.11.0
min_version: 2026.10.0
+2 -2
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.08
# Version : 1.1.3
# Updated : 2025.12.22
# Version : 1.1.2
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -1,5 +1,5 @@
# Updated : 2026.11.08
# Version : 1.1.3
# Updated : 2025.12.22
# Version : 1.1.2
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -23,4 +23,3 @@ esphome:
devices:
- id: sniffer_${sniffer_uart_id}
name: "${sniffer_name}"
relation: via
+2 -3
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.08
# Version : 1.1.2
# Updated : 2025.12.23
# Version : 1.1.1
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -23,4 +23,3 @@ esphome:
devices:
- id: bms_${bms_id}
name: "${bms_name}"
relation: via
+36 -43
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.10
# Version : 1.8.2
# Updated : 2026.11.05
# Version : 1.8.1
# GitHub : https://github.com/Sleeper85/esphome-yambms
# This YAML is free software: you can redistribute it and/or
@@ -46,6 +46,39 @@ binary_sensor:
name: "Can be combined"
id: bms${bms_id}_can_be_combined
device_id: bms_${bms_id}
lambda: |-
// Ensure that the sensors have a correct value and not NAN
if ((id(bms${bms_id}_online_status).has_state()) && // binary_sensor
(id(bms${bms_id}_online_status).state) && // binary_sensor
(id(bms${bms_id}_charging_allowed).has_state()) && // binary_sensor
(id(bms${bms_id}_discharging_allowed).has_state()) && // binary_sensor
(id(bms${bms_id}_equalizing).has_state()) && // binary_sensor
(id(bms${bms_id}_total_voltage).state > 0) &&
(id(bms${bms_id}_current).has_state()) &&
(id(bms${bms_id}_power).has_state()) &&
(id(bms${bms_id}_battery_soc).has_state()) &&
(id(bms${bms_id}_battery_soh).has_state()) &&
(id(bms${bms_id}_battery_capacity).state > 0) &&
(id(bms${bms_id}_battery_capacity_remaining).has_state()) &&
(id(bms${bms_id}_charging_cycles).has_state()) &&
(id(bms${bms_id}_max_charge_current).state >= 0) &&
(id(bms${bms_id}_max_discharge_current).state >= 0) &&
(id(bms${bms_id}_min_cell_voltage).has_state()) &&
(id(bms${bms_id}_max_cell_voltage).has_state()) &&
(id(bms${bms_id}_min_voltage_cell).has_state()) &&
(id(bms${bms_id}_max_voltage_cell).has_state()) &&
(id(bms${bms_id}_min_temperature).has_state()) &&
(id(bms${bms_id}_max_temperature).has_state()) &&
(id(bms${bms_id}_min_temperature_sensor).has_state()) &&
(id(bms${bms_id}_max_temperature_sensor).has_state()) &&
(id(bms${bms_id}_cell_ovp).has_state()) &&
(id(bms${bms_id}_cell_uvp).has_state()) &&
(id(bms${bms_id}_balance_trigger_voltage).has_state()) &&
(id(bms${bms_id}_yambms_errors_bitmask).has_state()))
{
return true;
}
else return false;
interval:
- interval: ${yambms_update_interval}
@@ -57,48 +90,8 @@ interval:
// BMS number to combine ?
if (id(yambms${yambms_id}_var_to_combine_bms_number) == ${bms_id})
{
// +-----------------------------------------------+
// | Can be combined |
// +-----------------------------------------------+
// Evaluated once per round, on this BMS's turn, and published to the
// binary sensor. A template lambda would run on every loop instead.
// Every entity below is mandatory and must hold a real value.
// Sensor: has_state() stays true after a NaN is published, so test isnan().
// > 0: zero is not a valid reading, and NaN fails the comparison. cell_ovp and
// cell_uvp may be a number, whose state starts at 0 instead of NaN.
// Binary sensor: has_state() is enough, a bool cannot be NaN.
const bool can_be_combined =
(id(bms${bms_id}_online_status).has_state()) && // binary_sensor
(id(bms${bms_id}_online_status).state) && // binary_sensor
(id(bms${bms_id}_charging_allowed).has_state()) && // binary_sensor
(id(bms${bms_id}_discharging_allowed).has_state()) && // binary_sensor
(id(bms${bms_id}_equalizing).has_state()) && // binary_sensor
(id(bms${bms_id}_total_voltage).state > 0) &&
(!std::isnan(id(bms${bms_id}_current).state)) &&
(!std::isnan(id(bms${bms_id}_power).state)) &&
(!std::isnan(id(bms${bms_id}_battery_soc).state)) &&
(!std::isnan(id(bms${bms_id}_battery_soh).state)) &&
(id(bms${bms_id}_battery_capacity).state > 0) &&
(!std::isnan(id(bms${bms_id}_battery_capacity_remaining).state)) &&
(!std::isnan(id(bms${bms_id}_charging_cycles).state)) &&
(id(bms${bms_id}_max_charge_current).state >= 0) &&
(id(bms${bms_id}_max_discharge_current).state >= 0) &&
(!std::isnan(id(bms${bms_id}_min_cell_voltage).state)) &&
(!std::isnan(id(bms${bms_id}_max_cell_voltage).state)) &&
(!std::isnan(id(bms${bms_id}_min_voltage_cell).state)) &&
(!std::isnan(id(bms${bms_id}_max_voltage_cell).state)) &&
(!std::isnan(id(bms${bms_id}_min_temperature).state)) &&
(!std::isnan(id(bms${bms_id}_max_temperature).state)) &&
(!std::isnan(id(bms${bms_id}_min_temperature_sensor).state)) &&
(!std::isnan(id(bms${bms_id}_max_temperature_sensor).state)) &&
(id(bms${bms_id}_cell_ovp).state > 0) && // sensor or number
(id(bms${bms_id}_cell_uvp).state > 0) && // sensor or number
(!std::isnan(id(bms${bms_id}_balance_trigger_voltage).state)) &&
(!std::isnan(id(bms${bms_id}_yambms_errors_bitmask).state));
id(bms${bms_id}_can_be_combined).publish_state(can_be_combined);
// The BMS can be combined ?
if (can_be_combined)
if (id(bms${bms_id}_can_be_combined).state)
{
// +-----------------------------------------------+
// | Installed battery capacity contribution |
@@ -1,5 +1,5 @@
# Updated : 2026.11.15
# Version : 2.0.5
# Updated : 2026.11.05
# Version : 2.0.3
# GitHub : https://github.com/RAR/esphome-eg4-bms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -22,7 +22,7 @@ substitutions:
eg4_modbus_id: modbus_eg4
external_components:
- source: github://RAR/esphome-eg4-bms@v1.1.4
- source: github://RAR/esphome-eg4-bms@v1.1.0
refresh: 0s
packages:
@@ -1,5 +1,5 @@
# Updated : 2026.11.19
# Version : 1.2.5
# Updated : 2026.11.05
# Version : 1.2.4
# GitHub : https://github.com/syssi/esphome-jk-bms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -35,8 +35,8 @@ packages:
substitutions:
# (V) cell spread at which this BMS starts balancing. Not readable over the display
# port, so declare your unit's actual setting at import. Used by 'Auto CVL' and, when
# Fake Equalizing is enabled (bms_fake_equalizing_enabled), as the spread reference
# for the inferred balancing flag.
# bms_options_fake_equalizing.yaml is included, as the spread reference for the
# inferred balancing flag.
bms_balance_trigger_voltage: '0.01'
# +--------------------------------------+
@@ -1,5 +1,5 @@
# Updated : 2026.11.11
# Version : 1.3.6
# Updated : 2026.08.14
# Version : 1.3.5
# GitHub : https://github.com/txubelaxu/esphome-jk-bms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -44,6 +44,9 @@ jk_rs485_bms:
switch:
- platform: jk_rs485_bms
jk_rs485_bms_id: jk_rs485_bms${bms_id}
precharging:
device_id: bms_${bms_id}
name: "precharging"
charging:
id: bms${bms_id}_charge_switch
device_id: bms_${bms_id}
@@ -253,6 +256,12 @@ text_sensor:
errors:
device_id: bms_${bms_id}
name: "errors"
operation_status:
device_id: bms_${bms_id}
name: "operation status"
battery_type:
device_id: bms_${bms_id}
name: "battery type"
total_runtime_formatted:
device_id: bms_${bms_id}
name: "total runtime formatted"
@@ -1,5 +1,5 @@
# Updated : 2026.11.11
# Version : 1.3.6
# Updated : 2026.11.05
# Version : 1.3.5
# GitHub : https://github.com/txubelaxu/esphome-jk-bms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -36,7 +36,7 @@ logger:
# +--------------------------------------+
external_components:
- source: github://Sleeper85/esphome-components@dev
- source: github://Sleeper85/esphome-components@main
refresh: 60min
components: [ jk_rs485_sniffer , jk_rs485_bms ]
# - source:
@@ -45,6 +45,7 @@ external_components:
jk_rs485_sniffer:
- id: ${sniffer_id}
protocol_version: ${sniffer_protocol}
rx_timeout: 500ms
uart_id: ${sniffer_uart_id}
@@ -57,7 +58,7 @@ switch:
device_id: sniffer_${sniffer_uart_id}
name: "Broadcasting BMS settings to all BMS"
icon: "mdi:cast"
restore_mode: RESTORE_DEFAULT_ON
restore_mode: RESTORE_DEFAULT_OFF
optimistic: true
entity_category: config
turn_on_action:
@@ -1,5 +1,5 @@
# Updated : 2026.11.11
# Version : 1.3.5
# Updated : 2026.09.02
# Version : 1.3.4
# GitHub : https://github.com/txubelaxu/esphome-jk-bms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -23,10 +23,6 @@ substitutions:
packages:
modbus_sniffer: !include bms_base_sniffer_sub_device.yaml
sniffer_uart: !include
file: ../board/board_options_itf_${sniffer_uart_id}.yaml
vars:
uart_baud_rate: ${sniffer_uart_baud_rate | default(115200)}
logger:
tx_buffer_size: 1024
@@ -45,6 +41,7 @@ external_components:
jk_rs485_sniffer:
- id: ${sniffer_id}
protocol_version: ${sniffer_protocol}
rx_timeout: 500ms
uart_id: ${sniffer_uart_id}
@@ -57,7 +54,7 @@ switch:
device_id: sniffer_${sniffer_uart_id}
name: "Broadcasting BMS settings to all BMS"
icon: "mdi:cast"
restore_mode: RESTORE_DEFAULT_ON
restore_mode: RESTORE_DEFAULT_OFF
optimistic: true
entity_category: config
turn_on_action:
@@ -1,5 +1,5 @@
# Updated : 2026.11.11
# Version : 1.3.5
# Updated : 2026.11.05
# Version : 1.3.4
# GitHub : https://github.com/txubelaxu/esphome-jk-bms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -36,7 +36,7 @@ logger:
# +--------------------------------------+
external_components:
- source: github://Sleeper85/esphome-components@dev
- source: github://Sleeper85/esphome-components@main
refresh: 0s
components: [ jk_rs485_sniffer , jk_rs485_bms ]
# - source:
@@ -45,6 +45,7 @@ external_components:
jk_rs485_sniffer:
- id: ${sniffer_id}
protocol_version: ${sniffer_protocol}
rx_timeout: 500ms
uart_id: ${sniffer_uart_id}
talk_pin: ${sniffer_talk_pin}
@@ -58,7 +59,7 @@ switch:
device_id: sniffer_${sniffer_uart_id}
name: "Broadcasting BMS settings to all BMS"
icon: "mdi:cast"
restore_mode: RESTORE_DEFAULT_ON
restore_mode: RESTORE_DEFAULT_OFF
optimistic: true
entity_category: config
turn_on_action:
@@ -1,5 +1,5 @@
# Updated : 2026.11.10
# Version : 2.0.2
# Updated : 2025.12.22
# Version : 2.0.1
# GitHub : https://github.com/RAR/esphome-eg4-bms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -43,7 +43,6 @@
# Bit 10 Charge Under Temp 0000 0100 0000 0000 0x0400
# Bit 11 Discharge Under Temp 0000 1000 0000 0000 0x0800
# Bit 12 Low Capacity 0001 0000 0000 0000 0x1000
# (held while a full pack has stopped charging, so it is not mapped to an alarm)
# Bit 13 Discharge SC 0010 0000 0000 0000 0x2000
# +--------------------------------------+
@@ -80,11 +79,8 @@ sensor:
- throttle: 10s
- delta: 1
lambda: |-
// The component publishes NaN for a register block that has gone stale (no bits)
float bms_errors = id(bms${bms_id}_errors_bitmask).state;
float bms_protection = id(bms${bms_id}_protection_bitmask).state;
uint32_t bms_errors_bitmask = std::isnan(bms_errors) ? 0 : (uint32_t) bms_errors;
uint32_t bms_protection_bitmask = std::isnan(bms_protection) ? 0 : (uint32_t) bms_protection;
uint32_t bms_errors_bitmask = id(bms${bms_id}_errors_bitmask).state;
uint32_t bms_protection_bitmask = id(bms${bms_id}_protection_bitmask).state;
uint16_t yambms_errors_bitmask = 0;
if (bms_errors_bitmask > 0)
@@ -104,12 +100,11 @@ sensor:
if (bms_protection_bitmask & 0x0010) yambms_errors_bitmask |= 0x0100;
if (bms_protection_bitmask & 0x0020) yambms_errors_bitmask |= 0x0080;
if (bms_protection_bitmask & 0x0100) yambms_errors_bitmask |= 0x0020;
if (bms_protection_bitmask & 0x0200) yambms_errors_bitmask |= 0x0008;
if (bms_protection_bitmask & 0x0400) yambms_errors_bitmask |= 0x0040;
if (bms_protection_bitmask & 0x0800) yambms_errors_bitmask |= 0x0010;
if (bms_protection_bitmask & 0x2000) yambms_errors_bitmask |= 0x0400;
if (bms_protection_bitmask & 0x0040) yambms_errors_bitmask |= 0x0001;
if (bms_protection_bitmask & 0x0080) yambms_errors_bitmask |= 0x0001;
if (bms_protection_bitmask & 0x1000) yambms_errors_bitmask |= 0x0001;
}
return yambms_errors_bitmask;
+12 -25
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.19
# Version : 1.1.1
# Updated : 2026.08.29
# Version : 1.1.0
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -47,7 +47,7 @@
# | max cell < setpoint - hysteresis the pack dropped off the setpoint
# | OR (max - min) < trigger - delta hyst. the spread closed back below it
# |
# | Nothing is configurable but an on/off switch (off by default) and the two hysteresis margins, so
# | Nothing is configurable but an on/off switch and the two hysteresis margins, so
# | the inference tracks the hardware instead of a constant that would fit no BMS in
# | particular : the
# | balance trigger voltage is 10 mV on a JK or a Seplos, 30 mV on an EG4. A pack that
@@ -81,18 +81,9 @@
# | V3, EG4 LL v2 and JK RS485 DISPLAY all work that way. Declare your unit's actual
# | setting there : it is what this package compares the spread against.
# +--------------------------------------------------------------------------------+
# | Included by default, DISABLED by default - set the var to enable it
# | Included by default - these BMS need nothing added to your YAML
# +--------------------------------------------------------------------------------+
# |
# | bms_fake_equalizing_enabled: 'true' in the vars of each BMS include
# |
# | It is off by default because it stops the Cut-Off timer while the spread stays
# | above the trigger voltage. A pack that does not actually balance - no balancer,
# | balancing disabled in the BMS, or a balancer too weak for the pack - never closes
# | its spread : the charge then stays in Cut-Off until the EOC timer ends it (30min
# | by default), or indefinitely if the 'EOC Timer enabled' switch is off.
# | Enable it only once you know your pack balances at the configured trigger voltage.
# |
# | EG4 LL V2 bms_combine_EG4_LLV2_RS485_bms_full.yaml
# | bms_modbus_EG4_LLV2_RS485_bms_full.yaml
# | Seplos V1 V2 bms_combine_SEPLOS_V1_V2_RS485_bms_full.yaml
@@ -104,8 +95,7 @@
# |
# | The four real BMS above declared `bms_equalizing` as a hardcoded
# | `return false;` : they do balance, they just never say so. The Fake BMS used
# | to carry an inline voltage comparison, which this package replaces. Disabled,
# | the flag reports that constant false again.
# | to carry an inline voltage comparison, which this package replaces.
# +--------------------------------------------------------------------------------+
# | Adding it to another BMS - once for each bms_id
# +--------------------------------------------------------------------------------+
@@ -131,7 +121,7 @@
# bms_id: '1'
# # ... other vars of your BMS ...
# bms_balance_trigger_voltage: '0.010' # V. Your BMS's balancing threshold
# bms_fake_equalizing_enabled: 'true' # Optional : true/false, false by default
# bms_fake_equalizing_enabled: 'true' # Optional : true/fasle, true by default
# bms_fake_equalizing_hysteresis: '0.030' # Optional : 0.030 by default
# bms_fake_equalizing_delta_hysteresis: '0.002' # Optional : 0.002 by default
#
@@ -139,7 +129,7 @@
# | balancing threshold, it also feeds 'Auto CVL', and the rest is fine as it is.
# |
# | Or set them once for every BMS in the root `substitutions:` block.
# | To turn the inference on for one BMS : bms_fake_equalizing_enabled: 'true'
# | To turn the inference off on one BMS : bms_fake_equalizing_enabled: 'false'
# +--------------------------------------------------------------------------------+
@@ -151,14 +141,11 @@ substitutions:
# | The spread anchor is `bms_balance_trigger_voltage`, from the BMS itself.
# | What is left is an on/off switch and the two hysteresis margins.
# +--------------------------------------------------------------------------------+
# 'true' / 'false'. Off by default : the flag reports the constant false its package
# used to hardcode. Set to 'true' to turn the inference on for this BMS. A switch is
# needed because the package is included by default for the BMS that cannot report
# the flag, and a Remote Packages user cannot edit a package to drop it.
# Off by default because a pack that does not actually balance never closes its
# spread : the Cut-Off timer stays stopped and the charge only ends on the EOC timer
# (30min by default), or never if the 'EOC Timer enabled' switch is off.
bms_fake_equalizing_enabled: 'false'
# 'true' / 'false'. Set to 'false' to turn the inference off for this BMS : the flag
# goes back to the constant false its package used to report. Needed because the
# package is included by default for the BMS that cannot report the flag, and a
# Remote Packages user cannot edit a package to drop it.
bms_fake_equalizing_enabled: 'true'
# (V) how far below the bulk setpoint the max cell may fall before balancing stops.
# Without it the state toggles on every tick while the max cell sits on the setpoint.
bms_fake_equalizing_hysteresis: '0.030'
@@ -1,5 +1,5 @@
# Updated : 2026.11.08
# Version : 1.1.9
# Updated : 2026.11.05
# Version : 1.1.8
# GitHub : https://github.com/GHswitt/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -29,7 +29,6 @@ esphome:
devices:
- id: deye_${deye_id}
name: "${deye_name}"
relation: via
globals:
- id: deye${deye_id}_send_flag
@@ -1,5 +1,5 @@
# Updated : 2026.11.08
# Version : 1.1.9
# Updated : 2026.11.05
# Version : 1.1.8
# GitHub : https://github.com/GHswitt/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -29,7 +29,6 @@ esphome:
devices:
- id: deye_${deye_id}
name: "${deye_name}"
relation: via
globals:
- id: deye${deye_id}_send_flag
@@ -1,5 +1,5 @@
# Updated : 2026.11.19
# Version : 2.0.8
# Updated : 2026.08.29
# Version : 2.0.5
# GitHub : https://github.com/RAR/esphome-eg4-bms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -25,8 +25,8 @@ packages:
substitutions:
# (V) cell spread at which this BMS starts balancing. Not readable over the protocol,
# so declare your unit's actual setting at import. Used by 'Auto CVL' and, when
# Fake Equalizing is enabled (bms_fake_equalizing_enabled), as the spread reference
# for the inferred balancing flag.
# bms_options_fake_equalizing.yaml is included, as the spread reference for the
# inferred balancing flag.
bms_balance_trigger_voltage: '0.030'
# +--------------------------------------+
@@ -34,7 +34,7 @@ substitutions:
# +--------------------------------------+
external_components:
- source: github://RAR/esphome-eg4-bms@v1.1.4
- source: github://RAR/esphome-eg4-bms@v1.1.0
refresh: 0s
eg4_bms:
@@ -1,5 +1,5 @@
# Updated : 2026.11.11
# Version : 1.3.8
# Updated : 2026.07.02
# Version : 1.3.7
# GitHub : https://github.com/txubelaxu/esphome-jk-bms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -39,6 +39,9 @@ jk_rs485_bms:
switch:
- platform: jk_rs485_bms
jk_rs485_bms_id: jk_rs485_bms${bms_id}
precharging:
device_id: bms_${bms_id}
name: "precharging"
charging:
id: bms${bms_id}_charge_switch
device_id: bms_${bms_id}
@@ -519,6 +522,12 @@ text_sensor:
errors:
device_id: bms_${bms_id}
name: "errors"
operation_status:
device_id: bms_${bms_id}
name: "operation status"
battery_type:
device_id: bms_${bms_id}
name: "battery type"
total_runtime_formatted:
device_id: bms_${bms_id}
name: "total runtime formatted"
@@ -1,5 +1,5 @@
# Updated : 2026.11.11
# Version : 1.3.8
# Updated : 2026.03.15
# Version : 1.3.7
# GitHub : https://github.com/txubelaxu/esphome-jk-bms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -39,6 +39,9 @@ jk_rs485_bms:
switch:
- platform: jk_rs485_bms
jk_rs485_bms_id: jk_rs485_bms${bms_id}
precharging:
device_id: bms_${bms_id}
name: "precharging"
charging:
id: bms${bms_id}_charge_switch
device_id: bms_${bms_id}
@@ -399,6 +402,12 @@ text_sensor:
errors:
device_id: bms_${bms_id}
name: "errors"
operation_status:
device_id: bms_${bms_id}
name: "operation status"
battery_type:
device_id: bms_${bms_id}
name: "battery type"
total_runtime_formatted:
device_id: bms_${bms_id}
name: "total runtime formatted"
@@ -1,5 +1,5 @@
# Updated : 2026.11.09
# Version : 1.2.4
# Updated : 2026.11.1
# Version : 1.2.3
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -170,5 +170,9 @@ display:
- platform: mipi_rgb
id: my_display
model: ESP32-S3-TOUCH-LCD-4.3
# The model drives ch422g pin 2 (backlight) as enable_pin, which conflicts with backlight_output.
# No enable pin so the backlight stays under light control.
# Can be removed once min_version includes https://github.com/esphome/esphome/pull/21605
enable_pin: []
update_interval: never
auto_clear_enabled: false
@@ -1,5 +1,5 @@
# Updated : 2026.11.09
# Version : 1.2.4
# Updated : 2026.11.1
# Version : 1.2.3
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -146,5 +146,9 @@ display:
- platform: mipi_rgb
id: my_display
model: ESP32-S3-TOUCH-LCD-4.3
# The model drives ch422g pin 2 (backlight) as enable_pin, which conflicts with backlight_output.
# No enable pin so the backlight stays under light control.
# Can be removed once min_version includes https://github.com/esphome/esphome/pull/21605
enable_pin: []
update_interval: never
auto_clear_enabled: false
@@ -1,5 +1,5 @@
# Updated : 2026.11.09
# Version : 1.2.4
# Updated : 2026.11.1
# Version : 1.2.3
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -171,5 +171,11 @@ display:
- platform: mipi_rgb
id: my_display
model: ESP32-S3-TOUCH-LCD-7-800X480
# The model drives ch422g pin 2 (backlight) as enable_pin, which conflicts with backlight_output.
# Keep pin 6 only so the backlight stays under light control.
# Can be removed once min_version includes https://github.com/esphome/esphome/pull/21605
enable_pin:
- ch422g: ch422g_hub
number: 6
update_interval: never
auto_clear_enabled: false
+2 -3
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.08
# Version : 1.1.2
# Updated : 2025.12.23
# Version : 1.1.1
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -23,4 +23,3 @@ esphome:
devices:
- id: shunt_${shunt_id}
name: "${shunt_name}"
relation: via
+3 -21
View File
@@ -1,4 +1,4 @@
# Updated : 2026.11.10
# Updated : 2026.06.27
# Version : 1.7.0
# GitHub : https://github.com/Sleeper85/esphome-yambms
@@ -69,6 +69,7 @@ binary_sensor:
name: "Can be combined"
id: shunt${shunt_id}_can_be_combined
device_id: shunt_${shunt_id}
lambda: return (id(shunt${shunt_id}_switch_combine).state && id(shunt${shunt_id}_online_status).state);
text_sensor:
# Show diagnostic state and reason for combine/uncombine
@@ -90,27 +91,8 @@ interval:
// Shunt number to combine ?
if (id(yambms${yambms_id}_var_to_combine_shunt_number) == ${shunt_id})
{
// +-----------------------------------------------+
// | Can be combined |
// +-----------------------------------------------+
// Evaluated once per round, on this Shunt's turn, and published to the
// binary sensor. A template lambda would run on every loop instead.
// Every entity below is mandatory and must hold a real value.
// Sensor: has_state() stays true after a NaN is published, so test isnan().
// > 0: zero is not a valid reading, and NaN fails the comparison.
// Binary sensor: has_state() is enough, a bool cannot be NaN.
const bool can_be_combined =
(id(shunt${shunt_id}_switch_combine).state) && // switch
(id(shunt${shunt_id}_online_status).has_state()) && // binary_sensor
(id(shunt${shunt_id}_online_status).state) && // binary_sensor
(id(shunt${shunt_id}_voltage).state > 0) &&
(!std::isnan(id(shunt${shunt_id}_current).state)) &&
(!std::isnan(id(shunt${shunt_id}_power).state)) &&
(!std::isnan(id(shunt${shunt_id}_soc).state));
id(shunt${shunt_id}_can_be_combined).publish_state(can_be_combined);
// The Shunt can be combined ?
if (can_be_combined)
if (id(shunt${shunt_id}_can_be_combined).state)
{
// +-----------------------------------------------+
// | Check if all connected BMS are online |
@@ -1,6 +1,6 @@
# Updated : 2026.11.19
# Version : 1.1.2
# GitHub : https://github.com/darek-margas/esphome-victron_ble
# Updated : 2024.12.23
# Version : 1.1.1
# GitHub : https://github.com/Fabian-Schmidt/esphome-victron_ble
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -1,6 +1,6 @@
# Updated : 2026.11.19
# Version : 1.1.2
# GitHub : https://github.com/darek-margas/esphome-victron_ble
# Updated : 2024.12.23
# Version : 1.1.1
# GitHub : https://github.com/Fabian-Schmidt/esphome-victron_ble
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -1,5 +1,5 @@
# Updated : 2026.11.19
# Version : 1.2.0
# Updated : 2026.11.05
# Version : 1.1.9
# GitHub : https://github.com/Sleeper85/esphome-junctek_khf
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -30,7 +30,7 @@ packages:
external_components:
- source: github://Sleeper85/esphome-junctek_khf@main
refresh: 60min
refresh: 0s
# - source:
# type: local
# path: components
@@ -1,6 +1,6 @@
# Updated : 2026.11.19
# Version : 1.1.8
# GitHub : https://github.com/darek-margas/esphome-victron_ble
# Updated : 2026.02.05
# Version : 1.1.7
# GitHub : https://github.com/Fabian-Schmidt/esphome-victron_ble
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -25,8 +25,8 @@ packages:
# +--------------------------------------+
external_components:
- source: github://darek-margas/esphome-victron_ble
refresh: 60min
- source: github://Fabian-Schmidt/esphome-victron_ble
refresh: 0s
esp32_ble_tracker:
@@ -1,6 +1,6 @@
# Updated : 2026.11.19
# Version : 1.2.1
# GitHub : https://github.com/GHswitt/VictronMPPT-ESPHOME
# Updated : 2026.11.05
# Version : 1.2.0
# GitHub : https://github.com/KinDR007/VictronMPPT-ESPHOME
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -31,7 +31,7 @@ packages:
external_components:
- source: github://GHswitt/VictronMPPT-ESPHOME@main
refresh: 60min
refresh: 60s
victron:
- uart_id: ${shunt_uart_id}
@@ -1,6 +1,6 @@
# Updated : 2026.11.19
# Version : 1.1.9
# GitHub : https://github.com/GHswitt/VictronMPPT-ESPHOME
# Updated : 2026.11.05
# Version : 1.1.8
# GitHub : https://github.com/KinDR007/VictronMPPT-ESPHOME
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -31,7 +31,7 @@ packages:
external_components:
- source: github://GHswitt/VictronMPPT-ESPHOME@main
refresh: 60min
refresh: 60s
victron:
- uart_id: ${shunt_uart_id}
+3 -7
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.17
# Version : 1.2.1
# Updated : 2026.08.11
# Version : 1.2.0
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -140,11 +140,7 @@ interval:
// Reset values
float_v = bulk_v;
time_count = 0;
// Arm the delta at Bulk - Float instead of 0. The core only adds it while the
// instruction is Float, so it has no effect here, but it is already in place
// on the first Float tick. Clearing it made the CVL drop to the final Float
// voltage for up to 60s, then rise back to Bulk on the next interval tick.
id(yambms${yambms_id}_var_auto_float) = roundf((bulk_v - target_float_v) * 10.0f) / 10.0f;
id(yambms${yambms_id}_var_auto_float) = 0.0;
id(yambms${yambms_id}_auto_float_v).publish_state(float_v);
id(yambms${yambms_id}_auto_float_v_delta).publish_state(0.0);
return;
+2 -12
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.14
# Version : 1.1.7
# Updated : 2026.06.29
# Version : 1.1.6
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -177,16 +177,6 @@ interval:
return;
}
// While the target is reached in a CCL mode, the offset follows the Max Charge
// Current on every pass. Computed once, a cached offset applied to a larger
// maximum (a pack rejoining, a BMS raising its limit) released the CCL limit.
if (id(yambms${yambms_id}_var_auto_soc_target_reached)) {
const auto mode = id(yambms${yambms_id}_auto_soc_limit_mode).active_index();
const float max_ccl = id(yambms${yambms_id}_max_charge_current).state;
if (((mode == 1) || (mode == 2)) && !std::isnan(max_ccl))
id(yambms${yambms_id}_var_auto_soc_limit) = -(max_ccl - id(yambms${yambms_id}_auto_soc_ccl).state);
}
// Update in 60s intervals only
static uint32_t last_execution_ms = 0;
uint32_t current_ms = millis();
+40 -44
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.14
# Version : 2.7.5
# Updated : 2026.11.05
# Version : 2.7.2
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -61,7 +61,6 @@ esphome:
devices:
- id: canbus_${canbus_id}
name: "${yambms_name} ${canbus_name}"
relation: via
globals:
- id: canbus${canbus_id}_send_canbus_data
@@ -635,11 +634,9 @@ interval:
if (errors_bitmask_alarm & 0x0010) can_mesg[0] |= 0x10; // Under Temp Protection
if (errors_bitmask_alarm & 0x0040) can_mesg[0] |= 0x10; // Charge Under Temp Protection
if (errors_bitmask_alarm & 0x0080) can_mesg[0] |= 0x80; // Discharge Over Current Protection
if (errors_bitmask_alarm & 0x0100) can_mesg[1] |= 0x01; // Charge Over Current Protection
if (errors_bitmask_alarm & 0x0100) can_mesg[1] |= 0x80; // Charge Over Current Protection
if (errors_bitmask_alarm & 0x0800) can_mesg[1] |= 0x08; // BMS Internal Error
// UnBalanced Cell (0x1000) is not sent here : PYLON V2 defines byte 1 bit 4 as
// "External communication timeout", which stops charge and discharge.
// Cell imbalance is reported in 0x35A byte 3 (read by Victron ; reserved in PYLON V2).
if (errors_bitmask_alarm & 0x1000) can_mesg[1] |= 0x10; // UnBalanced Cell
}
// +---------------------------+
@@ -656,10 +653,9 @@ interval:
if (errors_bitmask_warning & 0x0010) can_mesg[2] |= 0x10; // Under Temp Protection
if (errors_bitmask_warning & 0x0040) can_mesg[2] |= 0x10; // Charge Under Temp Protection
if (errors_bitmask_warning & 0x0080) can_mesg[2] |= 0x80; // Discharge Over Current Protection
if (errors_bitmask_warning & 0x0100) can_mesg[3] |= 0x01; // Charge Over Current Protection
if (errors_bitmask_warning & 0x0100) can_mesg[3] |= 0x80; // Charge Over Current Protection
if (errors_bitmask_warning & 0x0800) can_mesg[3] |= 0x08; // BMS Internal Error
// UnBalanced Cell (0x1000) is not sent here : byte 3 bit 4 is reserved.
// Cell imbalance is reported in 0x35A byte 7 (read by Victron ; reserved in PYLON V2).
if (errors_bitmask_warning & 0x1000) can_mesg[3] |= 0x10; // UnBalanced Cell
}
// +---------------------------+
@@ -734,49 +730,49 @@ interval:
uint16_t errors_bitmask_alarm = id(yambms${yambms_id}_errors_bitmask_alarm).state;
uint16_t errors_bitmask_warning = id(yambms${yambms_id}_errors_bitmask_warning).state;
// Each alarm and warning is a 2-bit field, read as a value :
// 1 (bit N) = active
// 2 (bit N+1) = inactive, status OK
// 0 or 3 = not supported / reserved
// 0 must never be used for OK : the inverter would read the field as not supported.
// An idle frame is AA AA AA 02 AA AA AA 02, reserved fields stay at 0.
auto field = [](uint16_t mask, uint16_t bit) -> uint8_t { return (mask & bit) ? 0x01 : 0x02; };
// +---------------------------+
// | Alarm : byte 0 to 3 |
// +---------------------------+
can_mesg[0] = field(errors_bitmask_alarm, 0x0001) // General alarm
| field(errors_bitmask_alarm, 0x0002) << 2 // Battery high voltage alarm
| field(errors_bitmask_alarm, 0x0004) << 4 // Battery low voltage alarm
| field(errors_bitmask_alarm, 0x0008) << 6; // Battery high temperature alarm
can_mesg[1] = field(errors_bitmask_alarm, 0x0010) // Battery low temperature alarm
| field(errors_bitmask_alarm, 0x0020) << 2 // Battery high temperature charge alarm
| field(errors_bitmask_alarm, 0x0040) << 4 // Battery low temperature charge alarm
| field(errors_bitmask_alarm, 0x0080) << 6; // Battery high discharge current alarm
can_mesg[2] = field(errors_bitmask_alarm, 0x0100) // Battery high charge current alarm
| field(errors_bitmask_alarm, 0x0200) << 2 // Contactor alarm
| field(errors_bitmask_alarm, 0x0400) << 4 // Short circuit alarm
| field(errors_bitmask_alarm, 0x0800) << 6; // BMS internal alarm
can_mesg[3] = field(errors_bitmask_alarm, 0x1000); // Cell imbalance alarm, bits 2-7 reserved
// YamBMS alarm ?
if (errors_bitmask_alarm > 0)
{
if (errors_bitmask_alarm & 0x0001) can_mesg[0] |= 0x0001; // General alarm
if (errors_bitmask_alarm & 0x0002) can_mesg[0] |= 0x0004; // Battery high voltage alarm
if (errors_bitmask_alarm & 0x0004) can_mesg[0] |= 0x0010; // Battery low voltage alarm
if (errors_bitmask_alarm & 0x0008) can_mesg[0] |= 0x0040; // Battery high temperature alarm
if (errors_bitmask_alarm & 0x0010) can_mesg[1] |= 0x0001; // Battery low temperature alarm
if (errors_bitmask_alarm & 0x0020) can_mesg[1] |= 0x0004; // Battery high temperature charge alarm
if (errors_bitmask_alarm & 0x0040) can_mesg[1] |= 0x0010; // Battery low temperature charge alarm
if (errors_bitmask_alarm & 0x0080) can_mesg[1] |= 0x0040; // Battery high discharge current alarm
if (errors_bitmask_alarm & 0x0100) can_mesg[2] |= 0x0001; // Battery high charge current alarm
if (errors_bitmask_alarm & 0x0200) can_mesg[2] |= 0x0004; // Contactor alarm
if (errors_bitmask_alarm & 0x0400) can_mesg[2] |= 0x0010; // Short circuit alarm
if (errors_bitmask_alarm & 0x0800) can_mesg[2] |= 0x0040; // BMS internal alarm
if (errors_bitmask_alarm & 0x1000) can_mesg[3] |= 0x0001; // Cell imbalance alarm
}
// +---------------------------+
// | Warning : byte 4 to 7 |
// +---------------------------+
can_mesg[4] = field(errors_bitmask_warning, 0x0001) // General warning
| field(errors_bitmask_warning, 0x0002) << 2 // Battery high voltage warning
| field(errors_bitmask_warning, 0x0004) << 4 // Battery low voltage warning
| field(errors_bitmask_warning, 0x0008) << 6; // Battery high temperature warning
can_mesg[5] = field(errors_bitmask_warning, 0x0010) // Battery low temperature warning
| field(errors_bitmask_warning, 0x0020) << 2 // Battery high temperature charge warning
| field(errors_bitmask_warning, 0x0040) << 4 // Battery low temperature charge warning
| field(errors_bitmask_warning, 0x0080) << 6; // Battery high discharge current warning
can_mesg[6] = field(errors_bitmask_warning, 0x0100) // Battery high charge current warning
| field(errors_bitmask_warning, 0x0200) << 2 // Contactor warning
| field(errors_bitmask_warning, 0x0400) << 4 // Short circuit warning
| field(errors_bitmask_warning, 0x0800) << 6; // BMS internal warning
can_mesg[7] = field(errors_bitmask_warning, 0x1000); // Cell imbalance warning, bits 2-7 reserved
// YamBMS warning ?
if (errors_bitmask_warning > 0)
{
if (errors_bitmask_warning & 0x0001) can_mesg[4] |= 0x0001; // General warning
if (errors_bitmask_warning & 0x0002) can_mesg[4] |= 0x0004; // Battery high voltage warning
if (errors_bitmask_warning & 0x0004) can_mesg[4] |= 0x0010; // Battery low voltage warning
if (errors_bitmask_warning & 0x0008) can_mesg[4] |= 0x0040; // Battery high temperature warning
if (errors_bitmask_warning & 0x0010) can_mesg[5] |= 0x0001; // Battery low temperature warning
if (errors_bitmask_warning & 0x0020) can_mesg[5] |= 0x0004; // Battery high temperature charge warning
if (errors_bitmask_warning & 0x0040) can_mesg[5] |= 0x0010; // Battery low temperature charge warning
if (errors_bitmask_warning & 0x0080) can_mesg[5] |= 0x0040; // Battery high discharge current warning
if (errors_bitmask_warning & 0x0100) can_mesg[6] |= 0x0001; // Battery high charge current warning
if (errors_bitmask_warning & 0x0200) can_mesg[6] |= 0x0004; // Contactor warning
if (errors_bitmask_warning & 0x0400) can_mesg[6] |= 0x0010; // Short circuit warning
if (errors_bitmask_warning & 0x0800) can_mesg[6] |= 0x0040; // BMS internal warning
if (errors_bitmask_warning & 0x1000) can_mesg[7] |= 0x0001; // Cell imbalance warning
}
ESP_LOGD("canbus_debug", "send can_id: 0x35A hex: %x %x %x %x %x %x %x %x", can_mesg[0], can_mesg[1], can_mesg[2], can_mesg[3], can_mesg[4], can_mesg[5], can_mesg[6], can_mesg[7]);
return {can_mesg[0], can_mesg[1], can_mesg[2], can_mesg[3], can_mesg[4], can_mesg[5], can_mesg[6], can_mesg[7]};
+169 -225
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.17
# Version : 1.8.2
# Updated : 2026.11.08
# Version : 1.8.1
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -18,7 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/gpl.html>.
substitutions:
yambms_version: "1.8.2"
yambms_version: "1.8.1"
# YamBMS services
yambms_update_service: 'true' # Set to false to disable update checks
yambms_telemetry_service: 'true' # Set to false to disable the sending of telemetry data
@@ -243,11 +243,6 @@ globals:
type: std::string
restore_value: no
initial_value: '"Init"'
# Charge status before Wait, restored if it was Float or EOC
- id: yambms${yambms_id}_var_charge_status_before_wait
type: std::string
restore_value: no
initial_value: '"Init"'
# Inverter links: one slot per declared CAN/RS485 link, filled by the link
# package itself. The n-th element of the four vectors describes the same
# link, so an unresolved link writes "None" and never an empty string.
@@ -367,7 +362,6 @@ esphome:
devices:
- id: yambms_yambms${yambms_id}
name: "${yambms_name}"
relation: via
# Execute once
on_boot:
@@ -530,12 +524,11 @@ interval:
// +-----------------------------------------------+
// Alarm
// Alarm - all combined BMS are in alarm ?
// An uncombined BMS is offline or has missing data, it does not count as "not in alarm".
if (id(yambms${yambms_id}_var_errors_bitmask_counter) == id(yambms${yambms_id}_var_to_combine_bms_counter))
// Alarm - all BMS are in alarm ?
if (id(yambms${yambms_id}_var_errors_bitmask_counter) == id(yambms${yambms_id}_var_bms_counter))
id(yambms${yambms_id}_errors_bitmask_alarm).publish_state(id(yambms${yambms_id}_var_errors_bitmask));
// At least one combined BMS is not in alarm
// At least one BMS is not in alarm
else id(yambms${yambms_id}_errors_bitmask_alarm).publish_state(0);
// Warning
@@ -857,27 +850,22 @@ interval:
// +-----------------------------------------------+
// | STEP 3 - YamBMS Logic |
// +-----------------------------------------------+
// Entered only while at least one BMS is combined and every value read below
// is real. A sensor keeps has_state() after a NaN is published, so the
// sensors are tested with isnan() or a comparison, as in can_be_combined.
// The live counter is used rather than bms_combined, which STEP 2 only
// publishes once per round.
if ((id(yambms${yambms_id}_var_to_combine_bms_counter) > 0) &&
(id(yambms${yambms_id}_total_voltage).state > 0) &&
(!std::isnan(id(yambms${yambms_id}_current).state)) &&
(!std::isnan(id(yambms${yambms_id}_power).state)) &&
(!std::isnan(id(yambms${yambms_id}_battery_soc).state)) &&
(!std::isnan(id(yambms${yambms_id}_battery_soh).state)) &&
(id(yambms${yambms_id}_battery_capacity).state > 0) &&
(id(yambms${yambms_id}_equalizing).has_state()) && // binary_sensor
(!std::isnan(id(yambms${yambms_id}_max_cell_voltage).state)) &&
(id(yambms${yambms_id}_max_charge_current).state >= 0) &&
(id(yambms${yambms_id}_max_discharge_current).state >= 0) &&
(id(yambms${yambms_id}_cell_ovp).state > 0) &&
(id(yambms${yambms_id}_cell_uvp).state > 0) &&
(id(yambms${yambms_id}_cell_count).state > 0) &&
(id(yambms${yambms_id}_charging_allowed).has_state()) && // binary_sensor
(id(yambms${yambms_id}_discharging_allowed).has_state())) // binary_sensor
if ((id(yambms${yambms_id}_bms_combined).has_state()) &&
(id(yambms${yambms_id}_total_voltage).has_state()) &&
(id(yambms${yambms_id}_current).has_state()) &&
(id(yambms${yambms_id}_power).has_state()) &&
(id(yambms${yambms_id}_battery_soc).has_state()) &&
(id(yambms${yambms_id}_battery_soh).has_state()) &&
(id(yambms${yambms_id}_battery_capacity).has_state()) &&
(id(yambms${yambms_id}_equalizing).has_state()) &&
(id(yambms${yambms_id}_max_cell_voltage).has_state()) &&
(id(yambms${yambms_id}_max_charge_current).has_state()) &&
(id(yambms${yambms_id}_max_discharge_current).has_state()) &&
(id(yambms${yambms_id}_cell_ovp).has_state()) &&
(id(yambms${yambms_id}_cell_uvp).has_state()) &&
(id(yambms${yambms_id}_cell_count).has_state()) &&
(id(yambms${yambms_id}_charging_allowed).has_state()) &&
(id(yambms${yambms_id}_discharging_allowed).has_state()))
{
ESP_LOGD("yambms_debug", "===> STEP 3 : Entering YamBMS logic... <===");
@@ -932,17 +920,6 @@ interval:
}
}
// +-----------------------------------------------+
// | Charging allowed again after Wait |
// +-----------------------------------------------+
// A battery that was in Float or EOC goes back there, and the rebulk rules
// below decide whether a new Bulk is needed. Any other status (Init, Bulk,
// Cut-Off, Balancing) goes to Bulk through the Init / Wait rule.
if ((id(yambms${yambms_id}_var_charge_status) == "Wait") &&
((id(yambms${yambms_id}_var_charge_status_before_wait) == "Float") ||
(id(yambms${yambms_id}_var_charge_status_before_wait) == "EOC")))
id(yambms${yambms_id}_var_charge_status) = id(yambms${yambms_id}_var_charge_status_before_wait);
// +-----------------------------------------------+
// | Force Bulk Logic |
// +-----------------------------------------------+
@@ -1075,7 +1052,8 @@ interval:
{
ESP_LOGD("yambms_debug", "Entering the Bulk phase...");
// Stop timer
id(yambms${yambms_id}_script_stop_timers).execute();
if (id(yambms${yambms_id}_script_eoc_timer).is_running()) id(yambms${yambms_id}_script_eoc_timer).stop();
if (id(yambms${yambms_id}_script_cutoff_timer).is_running()) id(yambms${yambms_id}_script_cutoff_timer).stop();
// Balancing : the BMS is equalizing the cells
if (id(yambms${yambms_id}_equalizing).state) id(yambms${yambms_id}_var_charge_status) = "Balancing";
// Bulk
@@ -1116,27 +1094,14 @@ interval:
}
}
// Charging not allowed (BMS or YamBMS)
// The status before Wait is kept, to go back to Float or EOC when charging
// is allowed again (see "Charging allowed again after Wait").
// The Cut-Off and EOC timers are stopped: an EOC is only declared while
// charging, so a Wait during the Cut-Off phase does not count as a full charge.
else if (id(yambms${yambms_id}_var_bms_charging_logic) == true)
{
ESP_LOGD("yambms_debug", "Charging not allowed !");
if (!id(yambms${yambms_id}_switch_charging).state)
{
id(yambms${yambms_id}_script_stop_timers).execute();
if (id(yambms${yambms_id}_var_charge_status) != "Wait")
id(yambms${yambms_id}_var_charge_status_before_wait) = id(yambms${yambms_id}_var_charge_status);
id(yambms${yambms_id}_var_charge_status) = "Wait";
}
if (!id(yambms${yambms_id}_switch_charging).state) id(yambms${yambms_id}_var_charge_status) = "Wait";
}
else
{
ESP_LOGD("yambms_debug", "Charging not allowed !");
id(yambms${yambms_id}_script_stop_timers).execute();
if (id(yambms${yambms_id}_var_charge_status) != "Wait")
id(yambms${yambms_id}_var_charge_status_before_wait) = id(yambms${yambms_id}_var_charge_status);
id(yambms${yambms_id}_var_charge_status) = "Wait";
}
@@ -1190,146 +1155,142 @@ interval:
// leaves the counter at 0. Clamp to 1 to prevent division by 0.
const int comm_interfaces_count = std::max(1, id(yambms${yambms_id}_var_comm_interfaces_count));
// +-----------------------------------------------+
// | Requested Force Charge |
// +-----------------------------------------------+
// Evaluated only while at least one BMS is combined: otherwise the SoC is
// not a real value, and the request keeps its last state (boot, BMS dropout).
// Switch off: the request is cleared by its on_turn_off and only republished here.
bool force_charge = id(yambms${yambms_id}_requested_force_charge).state;
if (id(yambms${yambms_id}_switch_request_force_charge).state)
// At least one BMS combined
if (id(yambms${yambms_id}_var_to_combine_bms_counter) > 0)
{
const float soc = id(yambms${yambms_id}_battery_soc).state;
if (soc <= id(yambms${yambms_id}_request_force_charge_start_soc).state) force_charge = true;
else if (soc >= id(yambms${yambms_id}_request_force_charge_stop_soc).state) force_charge = false;
// Between Start and Stop SoC (or NaN SoC): keep the current state (hysteresis)
}
id(yambms${yambms_id}_requested_force_charge).publish_state(force_charge);
// +-----------------------------------------------+
// | Requested Charge Voltage (CVL) |
// +-----------------------------------------------+
// Bulk
if (charging_instruction == "Bulk")
requested_charge_voltage = id(yambms${yambms_id}_bulk_voltage).state;
// Float
else if (charging_instruction == "Float")
requested_charge_voltage = id(yambms${yambms_id}_float_voltage).state;
// Stop : keep at nominal voltage
else
requested_charge_voltage = id(yambms${yambms_id}_var_cell_nominal_v) * ${yambms_cell_count};
// +-----------------------------------------------+
// | Requested Charge Voltage (CVL) |
// +-----------------------------------------------+
// Bulk
if (charging_instruction == "Bulk")
requested_charge_voltage = id(yambms${yambms_id}_bulk_voltage).state;
// Float
// Auto Float only applies to the Float voltage. Outside Float its 60s interval
// keeps the delta armed at Bulk - Float, so that the first Float CVL is the Bulk
// voltage. Adding it to every instruction would raise the CVL above the Bulk
// voltage outside Float.
else if (charging_instruction == "Float")
requested_charge_voltage = id(yambms${yambms_id}_float_voltage).state + id(yambms${yambms_id}_var_auto_float);
// Stop : keep at nominal voltage
requested_charge_voltage += id(yambms${yambms_id}_charger_offset_v).state +
id(yambms${yambms_id}_var_auto_cvl) +
id(yambms${yambms_id}_var_auto_float) +
id(yambms${yambms_id}_var_auto_custom_cvl);
// Publish the sensor
id(yambms${yambms_id}_requested_charge_voltage).publish_state(requested_charge_voltage);
// +-----------------------------------------------+
// | Requested Discharge Voltage (DVL) |
// +-----------------------------------------------+
requested_discharge_voltage = ((id(yambms${yambms_id}_cell_uvp).state + 0.2) * id(yambms${yambms_id}_cell_count).state);
// Publish the sensor
id(yambms${yambms_id}_requested_discharge_voltage).publish_state(requested_discharge_voltage);
// +-----------------------------------------------+
// | Requested Charge Current (CCL) |
// +-----------------------------------------------+
int cc_step = id(yambms${yambms_id}_var_charge_current_step);
if (cc_step == id(yambms${yambms_id}_var_auto_ccl_functions_count) + 1)
{
ESP_LOGD("yambms_debug", "Entering Requested CCL...");
ESP_LOGD("yambms_debug", "Charging instruction : %s", charging_instruction.c_str());
// Charging Not Allowed
requested_charge_current = 0;
// Charging Allowed
if ((charging_instruction == "Bulk") || (charging_instruction == "Float"))
{
float auto_limit = std::min({
id(yambms${yambms_id}_var_auto_temperature_ccl),
id(yambms${yambms_id}_var_auto_ccl),
id(yambms${yambms_id}_var_auto_ccl_current_taper),
id(yambms${yambms_id}_var_auto_soc_limit),
id(yambms${yambms_id}_var_auto_eoc),
id(yambms${yambms_id}_var_auto_custom_ccl)
});
requested_charge_current = id(yambms${yambms_id}_max_charge_current).state + auto_limit;
requested_charge_current = round(requested_charge_current / comm_interfaces_count);
if (requested_charge_current < 0) requested_charge_current = 0;
}
// Publish the sensor
id(yambms${yambms_id}_requested_charge_current).publish_state(requested_charge_current);
// Derating reason update and log
id(yambms${yambms_id}_ccl_derating_reason).update();
ESP_LOGD("yambms_debug", "CCL limits : temp=%.1f auto=%.1f taper=%.1f soc=%.1f eoc=%.1f custom=%.1f => CCL=%.1f A",
id(yambms${yambms_id}_var_auto_temperature_ccl),
id(yambms${yambms_id}_var_auto_ccl),
id(yambms${yambms_id}_var_auto_ccl_current_taper),
id(yambms${yambms_id}_var_auto_soc_limit),
id(yambms${yambms_id}_var_auto_eoc),
id(yambms${yambms_id}_var_auto_custom_ccl),
requested_charge_current);
if (id(yambms${yambms_id}_var_charge_status) != "Init")
id(yambms${yambms_id}_var_requested_ccl_init) = true;
id(yambms${yambms_id}_var_charge_current_step) = 1;
}
// +-----------------------------------------------+
// | Requested Discharge Current (DCL) |
// +-----------------------------------------------+
int dc_step = id(yambms${yambms_id}_var_discharge_current_step);
if (dc_step == id(yambms${yambms_id}_var_auto_dcl_functions_count) + 1)
{
ESP_LOGD("yambms_debug", "Entering Requested DCL...");
// Discharging Not Allowed
requested_discharge_current = 0;
// Discharging Allowed
if (discharging_instruction == true)
{
float auto_limit = std::min({
id(yambms${yambms_id}_var_auto_temperature_dcl),
id(yambms${yambms_id}_var_auto_dcl),
id(yambms${yambms_id}_var_auto_custom_dcl)
});
requested_discharge_current = id(yambms${yambms_id}_max_discharge_current).state + auto_limit;
requested_discharge_current = round(requested_discharge_current / comm_interfaces_count);
if (requested_discharge_current < 0) requested_discharge_current = 0;
}
// Publish the sensor
id(yambms${yambms_id}_requested_discharge_current).publish_state(requested_discharge_current);
// Derating reason update and log
id(yambms${yambms_id}_dcl_derating_reason).update();
ESP_LOGD("yambms_debug", "DCL limits : temp=%.1f auto=%.1f custom=%.1f => DCL=%.1f A",
id(yambms${yambms_id}_var_auto_temperature_dcl),
id(yambms${yambms_id}_var_auto_dcl),
id(yambms${yambms_id}_var_auto_custom_dcl),
requested_discharge_current);
id(yambms${yambms_id}_var_requested_dcl_init) = true;
id(yambms${yambms_id}_var_discharge_current_step) = 1;
}
}
// No BMS combined
else
requested_charge_voltage = id(yambms${yambms_id}_var_cell_nominal_v) * ${yambms_cell_count};
requested_charge_voltage += id(yambms${yambms_id}_charger_offset_v).state +
id(yambms${yambms_id}_var_auto_cvl) +
id(yambms${yambms_id}_var_auto_custom_cvl);
// Publish the sensor
id(yambms${yambms_id}_requested_charge_voltage).publish_state(requested_charge_voltage);
// +-----------------------------------------------+
// | Requested Discharge Voltage (DVL) |
// +-----------------------------------------------+
requested_discharge_voltage = ((id(yambms${yambms_id}_cell_uvp).state + 0.2) * id(yambms${yambms_id}_cell_count).state);
// Publish the sensor
id(yambms${yambms_id}_requested_discharge_voltage).publish_state(requested_discharge_voltage);
// +-----------------------------------------------+
// | Requested Charge Current (CCL) |
// +-----------------------------------------------+
int cc_step = id(yambms${yambms_id}_var_charge_current_step);
if (cc_step == id(yambms${yambms_id}_var_auto_ccl_functions_count) + 1)
{
ESP_LOGD("yambms_debug", "Entering Requested CCL...");
ESP_LOGD("yambms_debug", "Charging instruction : %s", charging_instruction.c_str());
// Charging Not Allowed
requested_charge_current = 0;
// Charging Allowed
if ((charging_instruction == "Bulk") || (charging_instruction == "Float"))
{
float auto_limit = std::min({
id(yambms${yambms_id}_var_auto_temperature_ccl),
id(yambms${yambms_id}_var_auto_ccl),
id(yambms${yambms_id}_var_auto_ccl_current_taper),
id(yambms${yambms_id}_var_auto_soc_limit),
id(yambms${yambms_id}_var_auto_eoc),
id(yambms${yambms_id}_var_auto_custom_ccl)
});
requested_charge_current = id(yambms${yambms_id}_max_charge_current).state + auto_limit;
requested_charge_current = round(requested_charge_current / comm_interfaces_count);
if (requested_charge_current < 0) requested_charge_current = 0;
}
// Publish the sensor
id(yambms${yambms_id}_requested_charge_current).publish_state(requested_charge_current);
// Derating reason update and log
id(yambms${yambms_id}_ccl_derating_reason).update();
ESP_LOGD("yambms_debug", "CCL limits : temp=%.1f auto=%.1f taper=%.1f soc=%.1f eoc=%.1f custom=%.1f => CCL=%.1f A",
id(yambms${yambms_id}_var_auto_temperature_ccl),
id(yambms${yambms_id}_var_auto_ccl),
id(yambms${yambms_id}_var_auto_ccl_current_taper),
id(yambms${yambms_id}_var_auto_soc_limit),
id(yambms${yambms_id}_var_auto_eoc),
id(yambms${yambms_id}_var_auto_custom_ccl),
requested_charge_current);
if (id(yambms${yambms_id}_var_charge_status) != "Init")
id(yambms${yambms_id}_var_requested_ccl_init) = true;
id(yambms${yambms_id}_var_charge_current_step) = 1;
}
// +-----------------------------------------------+
// | Requested Discharge Current (DCL) |
// +-----------------------------------------------+
int dc_step = id(yambms${yambms_id}_var_discharge_current_step);
if (dc_step == id(yambms${yambms_id}_var_auto_dcl_functions_count) + 1)
{
ESP_LOGD("yambms_debug", "Entering Requested DCL...");
// Discharging Not Allowed
requested_discharge_current = 0;
// Discharging Allowed
if (discharging_instruction == true)
{
float auto_limit = std::min({
id(yambms${yambms_id}_var_auto_temperature_dcl),
id(yambms${yambms_id}_var_auto_dcl),
id(yambms${yambms_id}_var_auto_custom_dcl)
});
requested_discharge_current = id(yambms${yambms_id}_max_discharge_current).state + auto_limit;
requested_discharge_current = round(requested_discharge_current / comm_interfaces_count);
if (requested_discharge_current < 0) requested_discharge_current = 0;
}
// Publish the sensor
id(yambms${yambms_id}_requested_discharge_current).publish_state(requested_discharge_current);
// Derating reason update and log
id(yambms${yambms_id}_dcl_derating_reason).update();
ESP_LOGD("yambms_debug", "DCL limits : temp=%.1f auto=%.1f custom=%.1f => DCL=%.1f A",
id(yambms${yambms_id}_var_auto_temperature_dcl),
id(yambms${yambms_id}_var_auto_dcl),
id(yambms${yambms_id}_var_auto_custom_dcl),
requested_discharge_current);
id(yambms${yambms_id}_var_requested_dcl_init) = true;
id(yambms${yambms_id}_var_discharge_current_step) = 1;
// Publishing sensors to NAN
id(yambms${yambms_id}_requested_charge_voltage).publish_state(NAN);
id(yambms${yambms_id}_requested_discharge_voltage).publish_state(NAN);
id(yambms${yambms_id}_requested_charge_current).publish_state(NAN);
id(yambms${yambms_id}_requested_discharge_current).publish_state(NAN);
}
// +-----------------------------------------------+
// | End Of STEP 3 : YamBMS initialized ? |
// | The datas can be communicated to the inverter |
// +-----------------------------------------------+
if ((id(yambms${yambms_id}_var_charge_status) != "Init") &&
if ((id(yambms${yambms_id}_bms_combined).state > 0) &&
(id(yambms${yambms_id}_var_charge_status) != "Init") &&
(id(yambms${yambms_id}_total_voltage).state > 0) &&
(id(yambms${yambms_id}_min_temperature).state < 100) &&
(id(yambms${yambms_id}_max_temperature).state > -100) &&
(id(yambms${yambms_id}_requested_charge_voltage).state > 0) &&
@@ -1341,23 +1302,6 @@ interval:
}
else id(yambms${yambms_id}_var_initialized) = false; // Communication with the inverter stops.
}
// No BMS combined or invalid data: the charging logic is suspended.
// var_charge_status keeps its value, so a dropout in Float or EOC does not
// restart a Bulk. The Cut-Off and EOC timers are stopped, so a dropout during
// the Cut-Off phase cannot declare an EOC with no BMS to confirm it. The
// instructions and requested values are cleared so that Home Assistant does
// not show stale ones; the inverter links stop on var_initialized.
else
{
id(yambms${yambms_id}_script_stop_timers).execute();
id(yambms${yambms_id}_charging_instruction).publish_state("Stop");
id(yambms${yambms_id}_discharging_instruction).publish_state(false);
id(yambms${yambms_id}_requested_charge_voltage).publish_state(NAN);
id(yambms${yambms_id}_requested_discharge_voltage).publish_state(NAN);
id(yambms${yambms_id}_requested_charge_current).publish_state(NAN);
id(yambms${yambms_id}_requested_discharge_current).publish_state(NAN);
id(yambms${yambms_id}_var_initialized) = false; // Communication with the inverter stops.
}
// +-----------------------------------------------+
// | DEBUG LOGS |
@@ -1402,17 +1346,12 @@ script:
then:
- delay: ${yambms_cutoff_timer}s
- script.execute: yambms${yambms_id}_script_eoc
# Stops the Cut-Off and EOC timers (Bulk, Wait, suspended logic, EOC declared)
# No delay: execute() runs both stops before returning to the caller.
- id: yambms${yambms_id}_script_stop_timers
then:
- script.stop: yambms${yambms_id}_script_eoc_timer
- script.stop: yambms${yambms_id}_script_cutoff_timer
- id: yambms${yambms_id}_script_eoc
then:
- lambda: |-
// Stop timer
id(yambms${yambms_id}_script_stop_timers).execute();
if (id(yambms${yambms_id}_script_eoc_timer).is_running()) id(yambms${yambms_id}_script_eoc_timer).stop();
if (id(yambms${yambms_id}_script_cutoff_timer).is_running()) id(yambms${yambms_id}_script_cutoff_timer).stop();
// EOC script
if (id(yambms${yambms_id}_switch_float).state) id(yambms${yambms_id}_var_charge_status) = "Float";
else id(yambms${yambms_id}_var_charge_status) = "EOC";
@@ -1491,11 +1430,6 @@ switch:
restore_mode: RESTORE_DEFAULT_OFF
optimistic: true
entity_category: config
# Clear the request at once, even while no BMS is combined
on_turn_off:
- binary_sensor.template.publish:
id: yambms${yambms_id}_requested_force_charge
state: OFF
# +--------------------------------------+
# | binary_sensor |
@@ -1544,6 +1478,16 @@ binary_sensor:
device_id: yambms_yambms${yambms_id}
icon: mdi:battery-charging-low
trigger_on_initial_state: true
lambda: |-
if (id(yambms${yambms_id}_switch_request_force_charge).state)
{
int soc = id(yambms${yambms_id}_battery_soc).state;
if (soc <= id(yambms${yambms_id}_request_force_charge_start_soc).state) return true;
else if (soc >= id(yambms${yambms_id}_request_force_charge_stop_soc).state) return false;
else if (id(yambms${yambms_id}_requested_force_charge).state) return true;
else return false;
}
else return false;
# +--------------------------------------+
# | number |
@@ -2137,7 +2081,7 @@ sensor:
const float delta = 1.0f;
${rate_limit_filter}
# Alarm - errors_bitmask bitwise OR, published only when all combined BMS are in alarm (16bit)
# Alarm - errors_bitmask bitwise AND (16bit)
- platform: template
id: yambms${yambms_id}_errors_bitmask_alarm
device_id: yambms_yambms${yambms_id}
@@ -2483,13 +2427,13 @@ text_sensor:
entity_category: diagnostic
icon: mdi:battery-alert
lambda: |-
// Shows what is sent to the inverter : alarm bits if all combined BMS are in alarm,
// otherwise Warning if at least one is.
// Error Bitmask ?
uint16_t errors_bitmask = id(yambms${yambms_id}_errors_bitmask_alarm).state;
int eb_counter = id(yambms${yambms_id}_errors_bitmask_counter).state;
// At least one BMS in alarm
if ((errors_bitmask == 0) && (id(yambms${yambms_id}_errors_bitmask_warning).state > 0)) return {"Warning"};
// All combined BMS are in alarm
if ((eb_counter > 0) && (eb_counter < id(yambms${yambms_id}_var_bms_counter))) return {"Warning"};
// All BMS are in alarm
else if (errors_bitmask > 0)
{
if ((errors_bitmask & 0x0002)) return {"OVP"}; // Over Voltage Protection
+2 -3
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.08
# Version : 1.1.3
# Updated : 2026.11.05
# Version : 1.1.2
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -75,7 +75,6 @@ esphome:
devices:
- id: rs485_${rs485_id}
name: "${yambms_name} ${rs485_name}"
relation: via
globals:
# Protocol actually applied on this link, resolved from the `Protocol` select
+3 -8
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.11
# Version : 1.1.2
# Updated : 2026.11.05
# Version : 1.1.1
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -81,11 +81,6 @@ interval:
then:
- lambda: |-
bool active = id(rs485${rs485_id}_active_protocol) == ${YB_PROTO_RS485_VOLTRONIC_LIB};
// Same gate as the CAN and PYLON links: no answer until YamBMS is initialized,
// so the read_lambdas never convert a NaN (no BMS combined) to an integer.
bool serve = active &&
(id(yambms${yambms_id}_var_initialized) == true) &&
(id(yambms${yambms_id}_bms_combined).state > 0);
// Mirror RS485 status into inverter_com_status. Turning the link off clears
// it once per transition, so a CAN link on the same node keeps owning it.
@@ -95,7 +90,7 @@ interval:
id(inverter_com_status).publish_state(false);
}
id(rs485${rs485_id}_modbus_server).set_address(serve ? 1 : 248);
id(rs485${rs485_id}_modbus_server).set_address(active ? 1 : 248);
modbus:
- uart_id: ${rs485_uart_id}