The inferred balancing flag stops the Cut-Off timer while the cell spread
stays above bms_balance_trigger_voltage. A pack that does not actually
balance (no balancer, balancing disabled, or a balancer too weak for the
pack) never closes its spread, so the charge stayed in Cut-Off until the
EOC timer ended it, or indefinitely with the EOC timer switch off.
bms_fake_equalizing_enabled now defaults to 'false' for every BMS that
includes the package (EG4 LL V2, Seplos V1/V2, Seplos V3, JK RS485
DISPLAY, Fake/Demo BMS): the flag reports the constant false these
packages used to hardcode. Set it to 'true' per BMS to enable it.
Charging_logic.md and Changelog_Fake_Equalizing.md describe the new
default and the warning.
Fixes#342
* EG4 LL-V2: no General alarm for a full pack, component v1.1.2
EG4 packs hold protection bit 12 ("Low Capacity") while they are full and
have stopped charging, and it clears once they discharge. It was mapped to
General alarm, so every full charge raised a YamBMS alarm and sent it to
the inverter over CAN (#342). It is no longer mapped.
Discharge over temperature (0x0200) and discharge under temperature
(0x0800) protection were not mapped; they now raise the high and low
temperature alarms, as charge OT/UT already raise the charge ones.
Component v1.1.2 tracks each register block on its own
(RAR/esphome-eg4-bms#9): a pack goes offline when either block stops
giving valid replies, and that block's sensors publish NaN, so the
bitmask lambda now reads a NaN bitmask as no bits.
* EG4 LL-V2: component v1.1.3 (bus turnaround gap)
v1.1.2 took packs offline on a shared bus: a request sent right after
another pack's reply was often not answered. v1.1.3 waits a turnaround
time (50 ms) after each reply (RAR/esphome-eg4-bms#9).
* EG4 LL-V2: update date and version of the changed YAMLs
* EG4 LL-V2: component v1.1.4 (only the awaited reply ends the wait)
The sniffer packages load the JK RS485 components from the dev branch of
Sleeper85/esphome-components (JK RS485 1.2) until it is tested and merged
into main ; they will then go back to @main.
JK RS485 1.2 removes the protocol_version key of jk_rs485_sniffer (the
JK-PB RS485 protocol has only one version) and refuses it, while 1.1
requires it : both changes have to be made together. The sniffer packages
no longer pass it, and the sniffer_protocol var is removed from the JK-B
and JK-PB RS485 YAML and examples. A user YAML that still defines
sniffer_protocol keeps working, the var is simply unused.
The JK RS485 component never published a value for them : the
"precharging" switch had no register and wrote nothing, and the
"operation status" and "battery type" text sensors were never decoded.
They stayed unknown in Home Assistant and are removed from the component
in JK RS485 1.2.
The "status precharging" binary sensor, which works, is kept.
Same declaration as the other sniffer packages: the UART comes from
board_options_itf_${sniffer_uart_id}.yaml, with sniffer_uart_baud_rate
(default 115200).
The BMS condition tested most sensors with has_state(), which ESPHome sets
on every publication, NaN included. A BMS that had published NaN once on a
mandatory sensor (for example the PACE power template, which returns NaN
when the current is unknown) stayed combinable, and the NaN corrupted the
totals that drive the inverter.
- Sensors are tested with !std::isnan(): a sensor's state starts at NaN,
so it also covers a sensor that never published.
- cell_ovp and cell_uvp use > 0, like total_voltage and battery_capacity.
JK, KS and PACE packages declare them as a number, whose state starts
at 0, so isnan() alone would combine the BMS before its protection
settings are read.
- Binary sensors keep has_state(), a bool cannot be NaN.
The shunt condition only checked the switch and online_status. It now
also checks the four values the combiner reads: voltage > 0, and current,
power and soc with isnan(). A combined shunt replaces the BMS values, so a
NaN there reached the inverter directly.
Both conditions move from the binary sensor lambda to STEP 1, on the
device's turn, and are published to "Can be combined". A template binary
sensor with a lambda runs it on every loop, about 60 times per second per
device, for a value read once per round.
Design_decisions documents which test applies to which entity type, that
every entity in the conditions is mandatory, and why they are evaluated in
STEP 1.
Update EG4 LL-V2 component to v1.1.1 (builds on ESPHome 2026.11)
ESPHome 2026.11 removed format_hex_pretty(), which v1.1.0 used in its frame
logs, so every EG4 LL-V2 config failed to compile on dev:
'format_hex_pretty' was not declared in this scope. v1.1.1 uses its own
formatter (same output) and changes nothing else.
Checked with the EG4 LL-V2 example (3 BMS, ESP32) on ESPHome 2026.11.0b3.
ESPHome 2026.11 makes `relation` a required option for every entry under
`esphome: devices:`, and 2026.10 rejects that key. Both changes have to
land together, so raise min_version to 2026.11.0 in the same commit.
Use `relation: via` on all ten device declarations (BMS, sniffer, shunt,
balancer, Deye stack, board, YamBMS instance, CAN and RS485 links). It is
the value the API assumed before the key existed, so Home Assistant keeps
showing the devices exactly as before. `child` would fit the board, the
YamBMS instance and the inverter links better, but it is left for later:
a Home Assistant release that reads the field without supporting `child`
drops those devices and their entities.
Docs: ESPHome 2026.11.0 in README and Installation_procedure (which still
said 2025.11.0), Design_decisions no longer equates min_version with the
flow_control requirement, and Coding_conventions documents the
`relation: via` rule.
Daily Charging/Discharging Energy (YamBMS and per BMS) were published
with 1 Wh resolution. Home Assistant records every float change, so a
new state was written every few seconds while charging or discharging.
- Add a round: 2 filter and set accuracy_decimals to 2 (0.01 kWh).
- bms_base_daily_energy 1.1.4, changelog updated.
yambms_canbus.yaml and the Deye top packages now import their node from
canbus_platform (esp32_can, mcp2515 or external). canbus_bitrate replaces
esp32_canbus_bitrate and mcp2515_canbus_bitrate. Breaking change.
Each package now imports its UART from its *_uart_id var and keeps its own baud
rate key. WK2168 channels work the same way, uart_flow_control_pin replaces the
flow control include, and min_version moves to 2026.10.0. Breaking change.
* Fix Deye power update interval
* Keep batteries the report CCL/DCL 0A
A battery that reports a charge limit (CCL) or discharge limit (DCL) of 0 A now stays in the combine. Before, a full Deye at 0 A CCL, or an empty one at 0 A DCL, dropped out of capacity, SoC and the totals.
- Missing values are still caught: a CCL or DCL with no value yet still fails >= 0, because comparisons with NaN are always false.
- No effect on the limits: CCL and DCL are added up, so a battery at 0 A adds 0 A to the total.
- All BMS models are affected
https://github.com/Sleeper85/esphome-yambms/issues/335
Several sensors had a device_class that did not match their unit, so
Home Assistant shows warnings and handles them wrongly (unit
conversion, statistics).
- Power sensors in W used device_class 'current'; now 'power'
(BASEN RS485, DEYE CAN module full/minimal, FAKE).
- Ah sensors had a device_class that does not accept Ah ('battery',
'energy', 'energy_storage'). Removed it, since Home Assistant has no
device_class for Ah (BASEN RS485, DEYE CAN module/top full/minimal,
JK RS485 Display, Modbus client).
- DEYE battery capacity used state_class 'total_increasing', but the
value is not a counter. Changed to 'measurement'.
bms_base_charging_cycles.yaml coerced a NaN raw reading to 0 before adding
the user offset, instead of letting NaN propagate like the sensors fixed
in dee203e4 ("Sensors published to NAN when no BMS is combined"). *_raw is
NaN until the first trusted BMS frame arrives after a reboot, so both
`charging cycles` and `total charging cycle capacity` published a literal
0 during that transient - with `state_class: total`, that 0 also landed
in Home Assistant's long-term statistics.
Fix is to drop the two `if (isnan(...)) = 0;` coercions and let
`NaN + offset == NaN` propagate, so both sensors go unavailable through
the transient instead of reporting 0.
Both sensors also moved from `or: [throttle: 10s, delta: 1]` to the
NaN-safe rate-limit filter already used throughout yambms_core.yaml, since
the built-in `delta` filter drops a NaN transition without updating its
reference and would otherwise freeze the sensor on its last value for up
to 10s.
That filter is extracted from yambms_core.yaml into
packages/base/device_base.yaml, which every node loads via its board_*.yaml
regardless of whether it runs the YamBMS engine - unlike yambms_core.yaml,
which is absent from a multi-node Modbus-server node that only exposes
BMS/Shunt packages. Renamed yambms_rate_limit_filter to rate_limit_filter
now that it is no longer engine-specific.
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;`.
The installed total was accumulated once per BMS per boot, latched by
bms<id>_combined_once, so a BMS reconfigured with a different capacity
kept contributing its boot value until the next reboot.
Each BMS now remembers the last capacity it contributed in
bms<id>_installed_capacity and applies only the difference to the total.
- the update runs in the can_be_combined branch, so an offline BMS simply
stops updating its contribution, which stays in the total : the installed
capacity still never shrinks on an uncombine, as before
- a BMS coming back with a different capacity is applied as a delta, with
no double counting
- combined_once had no other reader and is removed
The total is deliberately not turned into a per-round accumulator reset in
the Global vars reset block like the other totals : its sensor is polled
independently of STEP 2 and its state is written straight into CAN frame
0x379 with no has_state() guard, so a transient zero would announce 0 Ah of
installed capacity to the inverter. See Design_decisions.md.
* Update EG4 LL-V2 component to v1.1.0
FixesRAR/esphome-eg4-bms#7: some EG4 LL-V2 units intermittently answer
with a CRC-valid function-03 response whose register data area is
entirely zero. The component published those zeroes as a real reading,
collapsing SoC, pack voltage and capacity for one poll cycle.
v1.1.0 rejects implausible blocks and no longer lets them refresh the
online tracker, so a unit stuck returning zeroes now goes offline
instead of reporting a flat-zero battery.
No YamBMS-side changes are required: neither EG4 package uses the
removed designed_capacity sensor, and both already use the
cell_average_voltage key.
Add switch to enable/disable communication with Basen BMS. For example
this can be used during maintenance to disable communication with the
selected battery.