Inferred equalizing for BMS that do not report a balancing flag

Some BMS balance their cells but never expose a balancing flag, so
`bms_equalizing` stays false and the core cannot tell a pack that is still
balancing from one that has finished. This is not cosmetic : while
equalizing is true, yambms_core.yaml stops the Cut-Off timer and lets the
charge run to the EOC timer instead of terminating early.

bms_options_fake_equalizing.yaml infers that flag from the pack itself. No
absolute cell voltage is hardcoded : the anchor is bulk_voltage / cell
count, the same derivation as cell_bulk_v in yambms_core.yaml, so it
follows `yambms_battery_chemistry`, the cell count and the configured bulk
voltage automatically.

  START when BOTH are true
    max cell >= cell_bulk_v                     the pack is at the setpoint
    AND (max - min) >= trigger voltage          its own balancing threshold

  STOP when EITHER is true
    max cell <  cell_bulk_v - hysteresis        the pack dropped off the setpoint
    OR (max - min) <  trigger - delta hyst.     the spread closed back below it

Only two deltas and one offset are configurable, and none of the three
depends on the chemistry - LFP, Li-ion and LTO all want the same few tens
of mV. The absolute anchor they hang off comes from the core, for free.

The delta condition is what keeps this honest : a pack that reaches the
setpoint perfectly balanced has nothing to equalize, so it reports false
and the Cut-Off timer does its job. A plain voltage comparison would report
balancing forever and terminate every charge on the EOC timer.

It extends bms<id>_bms_equalizing, the raw BMS flag, and not the combined
bms<id>_equalizing sensor. bms_base_balancer.yaml is therefore neither
modified nor duplicated, and keeps giving an external balancer priority
whenever one is online : the inference only applies when no balancer
reports for this pack.

This commit only adds the package. Nothing includes it yet, so no existing
configuration changes behaviour. Candidates sharing the same case are
Seplos V3, Seplos V1/V2, EG4 LL V2 and JK RS485 DISPLAY, whose
bms_equalizing is a hardcoded `return false;`.
This commit is contained in:
Sleeper85 committed 2026-11-08 23:08:33 +01:00
1 parent 17360765d4
commit 9dd22fa56b
19 files changed
+546 -44

No files matched your search

@@ -1,5 +1,5 @@
# Updated : 2026.02.16
# Version : 1.1.4
# Updated : 2026.08.29
# Version : 1.1.5
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -39,6 +39,7 @@ packages:
bms_name: 'EG4-BMS 1'
## 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
bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
bms2: !include
@@ -47,6 +48,7 @@ packages:
bms_id: '2' # must be a number
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
bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
bms3: !include
@@ -55,4 +57,5 @@ packages:
bms_id: '3' # 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
bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
@@ -1,5 +1,5 @@
# Updated : 2026.02.16
# Version : 1.1.4
# Updated : 2026.08.29
# Version : 1.1.5
# GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution )
@@ -43,6 +43,7 @@
bms_name: 'EG4-BMS 1'
## 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
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'
@@ -50,6 +51,7 @@
bms_id: '2' # must be a number
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
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'
@@ -57,4 +59,5 @@
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
bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable