33 Commits
Author SHA1 Message Date
Sleeper85 62be2cf496 README - Add a Support section 2026-11-19 04:18:57 +01:00
Sleeper85 7d347ae626 Examples - Add bms_fake_equalizing_enabled
Every example including a BMS that ships Fake Equalizing (EG4 LL V2,
Seplos V1/V2, Seplos V3, Demo BMS) now declares
bms_fake_equalizing_enabled on each BMS, with a comment explaining what
enabling it does and warning that a BMS without a balancer can stay in
Cut-Off for a long time before reaching EOC.

The EG4 and Seplos examples set it to 'false', the package default. The
DEMO examples set it to 'true'.
2026-11-19 04:18:57 +01:00
Sleeper85 c428e3470f Examples - EG4 LL V2 RP example: BMS 3 used bms_id 2
The third BMS block of RP_BMS_example_EG4_LLV2_RS485_Modbus.yaml declared
bms_id: '2', a duplicate of BMS 2. It now uses bms_id: '3'.
2026-11-19 02:31:42 +01:00
Sleeper85 25727029f6 Fake Equalizing - Disabled by default
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.
2026-11-19 02:31:42 +01:00
Sleeper85 dc038954e6 Shunt - Refresh the Junctek and Victron UART components every 60min
The Junctek KHF component was refreshed on every build (0s) and the
Victron UART component every 60s. Both are now refreshed every 60min.

The GitHub header of the two Victron UART packages pointed to
KinDR007/VictronMPPT-ESPHOME, while the component comes from
GHswitt/VictronMPPT-ESPHOME. It now names GHswitt.
2026-11-19 01:26:15 +01:00
Sleeper85 867db48329 Victron SmartShunt BLE - Switch to darek-margas/esphome-victron_ble
Fabian-Schmidt/esphome-victron_ble no longer compiles with current
ESPHome. The external component now comes from the
darek-margas/esphome-victron_ble fork, and the GitHub header of the
three Victron BLE packages points to it.

The component is now refreshed every 60min instead of on every build.
2026-11-19 01:26:15 +01:00
Sleeper85 bd7c20cd7e Auto Float - Keep the Bulk CVL when Float starts (#353)
Outside Float, the Auto Float interval cleared var_auto_float to 0. When
Float started, the CVL dropped to the final Float voltage for up to 60s,
then rose back to Bulk on the next interval tick before the step-down.

The delta is now kept armed at Bulk - Float outside Float. The core only
adds it while the instruction is Float, so Bulk and Stop are unchanged,
and the first Float CVL is the Bulk voltage.

Issue #353
2026-11-17 20:28:11 +01:00
Sleeper85 6a448e1696 YamBMS - Stop the Cut-Off and EOC timers from a single script
The same two lines stopping the Cut-Off and EOC timers were repeated in
five places: entering Bulk, both Wait branches, the suspended charging
logic and the EOC script. They are replaced by a call to the new
yambms_script_stop_timers script.

The script has no delay, so execute() runs both stops before returning
to the caller: the timers are stopped before the next line runs, as
before. No behaviour change.
2026-11-17 20:17:06 +01:00
Andrew Rankin a7e190b8e1 EG4 LL-V2: no General alarm for a full pack, component v1.1.4 (#349)
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)
2026-11-16 20:50:55 +01:00
Sleeper85 28393af4cf Add yambms_errors_bitmask_number to DEMO dashboard 2026-11-14 20:45:04 +01:00
Sleeper85 dfbe4805ad Auto SoC Limit - Follow the Max Charge Current while the CCL limit is held
In the CCL and Float + CCL modes, the offset -(Max Charge Current - Auto
SoC Limit CCL) was computed once, when the target SoC was reached, and
then kept until the SoC dropped below the hysteresis. If the Max Charge
Current increased in the meantime (a pack rejoining the bank, a BMS
raising its limit), the cached offset applied to the larger maximum
released the limit: e.g. 141A requested instead of 1A.

While the target is reached in a CCL mode, the offset is now recomputed
on every pass, before the 60s throttle. A NaN Max Charge Current leaves
the previous offset in place.

Reported in #352
2026-11-14 20:24:19 +01:00
Sleeper85 eee476340d YamBMS - Stop the Cut-Off and EOC timers in Wait and while no BMS is combined
The cut-off timer (180s) and the EOC timer (30min) were only stopped when
the Bulk phase was re-entered. While the charging logic was suspended (no
BMS combined) or in Wait (charging not allowed), they kept running, so a
dropout or a charge block during the Cut-Off phase could declare an EOC
with no BMS data to confirm it: the status went to Float or EOC, SoC 100%
could be sent and the rebulk days counter was reset.

Both timers are now stopped while the logic is suspended and whenever the
status is set to Wait. With bms_options_charging_logic.yaml, Wait is only
entered when the Charging switch is off, so the Cut-Off performed by
YamBMS itself is not affected. When charging is allowed again after a
Wait in Cut-Off, a new Bulk starts and the Cut-Off phase is run again.

Charging_logic.md is updated accordingly.

Reported in #352
2026-11-14 20:24:19 +01:00
Sleeper85 21c0251309 YamBMS - Apply the Auto Float adjustment to the Float voltage only
The 1.8.0 CVL rework added the Auto Float delta to the requested charge
voltage for every charging instruction. Auto Float clears that delta on
its own 60s interval once the instruction is no longer Float, so after a
Float => Bulk transition (Force Bulk, rebulk rules, Force Charge) the CVL
was the Bulk voltage plus the delta for up to 60s. The delta can reach
Bulk - Float when Float has just been entered.

The delta is now added in the Float branch only, as in 1.7.0. Auto CVL
and the custom CVL still apply to every instruction.

Reported in #352
2026-11-14 20:24:12 +01:00
Sleeper85 e569bfbac9 CAN 0x35A - Send inactive alarms and warnings as OK (10), not 00
Each alarm and warning of 0x35A is a 2-bit field : 1 is active, 2 is
inactive (OK), 0 and 3 mean not supported. YamBMS only set the active
bit and left 00 otherwise, so an inverter read every field that was not
in alarm as "not supported" instead of OK.

Every field is now written explicitly, active or inactive, and a frame
with no alarm is AA AA AA 02 AA AA AA 02, which is what a BYD battery
sends at rest. The reserved fields of bytes 3 and 7 stay at 0. The
mapping of the YamBMS bits is unchanged.

The frame is sent by PYLON V2, SMA and Victron. SMA calls the two bits
"arrive" and "leave", with the same meaning. The alarms are only
displayed and logged by the inverter, they do not change how it charges.

Design_decisions.md records why OK must never be sent as 0.
2026-11-14 19:50:47 +01:00
Sleeper85 6085e6ff24 PYLON CAN 0x359 - Send Charge Over Current on bit 0, stop sending UnBalanced Cell (#345)
Charge Over Current was set with 0x80 in bytes 1 and 3, a copy of the
Discharge Over Current value of byte 0. PYLON V1 and V2, LuxPower and the
other 0x359 specifications put it on bit 0 of both bytes, which is also
where 0x35A already sends it. Bit 7 is undefined, so the inverter never
saw the alarm.

UnBalanced Cell was sent on bit 4 of bytes 1 and 3. PYLON V2 defines byte
1 bit 4 as an external communication timeout that stops charge and
discharge, so a cell imbalance alarm could stop the inverter. Byte 3 bit
4 is reserved. Neither is sent any more; cell imbalance is still sent on
0x35A.

The frame layout is the same in PYLON V1 and V2, so the fix applies to
both, and to LuxPower which shares frame 5.
2026-11-14 19:50:47 +01:00
Sleeper85 0ef4ab355b Send the protection alarms when all combined BMS are in alarm (#344)
The alarm bitmask was published only when the number of BMS in alarm
equalled var_bms_counter, the number of configured BMS. But only
combined BMS are counted in alarm, so with one BMS offline or missing a
value the alarm could never be raised : the inverter received only the
warning bits, and the "Alarm" text sensor showed "Warning".

STEP 2 now compares with var_to_combine_bms_counter. An uncombined BMS
is offline or has missing data, it does not count as "not in alarm".
This matches the rest of the combiner, where charge and discharge are
already decided by the combined BMS only.

The "Alarm" text sensor no longer compares counters : it is derived from
the published alarm and warning bitmasks, so it shows what is sent to
the inverter.

The comment on the alarm sensor said "bitwise AND", it is an OR.
2026-11-14 19:08:36 +01:00
Sleeper85 c3affb8a10 Add a Board name text sensor and show it in the HA dashboards
The board_name substitution of each board_*.yaml only reached the
telemetry POST. Home Assistant had no way to read it: the device model is
replaced by the project name, and a sub-device carries no model.

device_base.yaml declares a "Board name" diagnostic text sensor on the
board sub-device. Its value is a constant, so it is published once from
the existing on_boot at priority 600, and update_interval is never: the
API resends the stored state on every connection.

The Diagnostic card of the HA dashboards shows it in a Board row, under
Chip.

The RPi Pico board does not include device_base.yaml and has no such
sensor.
2026-11-14 16:00:27 +01:00
Sleeper85 0db1572953 Docs: Add JK RS485 1.2 to the 1.8.2 changelog 2026-11-13 08:12:00 +01:00
Sleeper85 bb071e6565 JK RS485 - Load the components 1.2 from @dev and remove protocol_version
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.
2026-11-13 08:02:20 +01:00
Sleeper85 6940efb357 JK RS485 - Remove the precharging, operation status and battery type entities
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.
2026-11-12 17:52:48 +01:00
Sleeper85 8ade0b4ce6 JK RS485 - The sniffer dev package declares its UART
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).
2026-11-12 17:52:43 +01:00
Sleeper85 a9fb4df7bc HA dashboards 1.8.2 - 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 13:59:50 +01:00
Sleeper85 249541420e Restore Float or EOC when charging is allowed again after Wait (#343)
When charging was not allowed, the status went to Wait, also from Float or
EOC. When charging was allowed again, the Init / Wait -> Bulk rule came
first in the rebulk chain, so a full battery got the Bulk voltage again
after any short block, without any rebulk rule being checked.

The status is now kept in var_charge_status_before_wait on entering Wait.
When charging is allowed again, Float or EOC is restored before the Force
Bulk and rebulk rules, which then decide whether a new Bulk is needed.
Any other status goes to Bulk as before.

A dedicated variable is used rather than var_eoc: Auto SoC Limit sets
Float without a full charge and leaves var_eoc false on purpose, and that
Float must be restored too.

Charging_logic documents when the status goes to Wait and what happens
when charging is allowed again.

Fixes #343
2026-11-11 00:41:13 +01:00
Sleeper85 fcbe5023af Suspend the charging logic while no BMS is combined
The STEP 3 guard tested its values with has_state(), which ESPHome sets on
every publication, NaN included. STEP 2 publishes NaN when no BMS is
combined, so STEP 3 ran on every tick of a boot or a BMS dropout. The
charging logic then saw "Charging allowed" false and set the status to
Wait, and the Init/Wait -> Bulk rebulk rule restarted a Bulk on a full
battery as soon as the BMS came back.

- The guard follows the can_be_combined rules: isnan() or a comparison
  for sensors, has_state() for binary sensors. It reads the live
  var_to_combine_bms_counter rather than bms_combined, which STEP 2 only
  publishes once per round.
- The inner "At least one BMS combined" check is removed: the guard is
  now the single test. CVL, DVL, CCL, DCL and Requested Force Charge
  move up one level.
- A new else branch suspends the logic: var_charge_status keeps its
  value, the instructions and requested values are cleared for Home
  Assistant, and var_initialized is set to false.
- The end of STEP 3 no longer tests bms_combined and total_voltage,
  already guaranteed by the guard.

This fixes the dropout case of #343. A BMS that blocks charging while
combined still goes through Wait.

Charging_logic documents the BMS dropout behaviour, Design_decisions the
guard and its else branch.

Refs #343
2026-11-11 00:20:09 +01:00
Sleeper85 2fcfc4f44f Silence the Voltronic LIB link until YamBMS is initialized
The CAN and PYLON links only send data while var_initialized is true and
at least one BMS is combined. The LIB link only checked its protocol, so
it kept answering the inverter during a boot or a BMS dropout, and its
read_lambdas converted the NaN values to integers, which is undefined.

The 100 ms interval now moves the Modbus server to address 248, the
mechanism already used for Disabled, until YamBMS is initialized. The
status mirroring still follows the protocol only: an active link left
silent serves no request, its Status goes false and raises the fault,
like the other links during a dropout.

Design_decisions documents the second condition.
2026-11-11 00:00:27 +01:00
Sleeper85 77237e7c6c Reject NaN values in the BMS and shunt can_be_combined conditions
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.
2026-11-10 22:54:46 +01:00
Sleeper85 c9502bd196 Fix Requested Force Charge turning on while no BMS is combined (#346)
The binary sensor lambda was evaluated on every loop, including while no
BMS was combined (boot, BMS dropout). The SoC was NaN then, and
`int soc = NaN` is undefined: the request could turn on, and with a real
SoC between Start and Stop it stayed on until Stop SoC once the packs came
back.

The rule now runs in STEP 3, inside the "At least one BMS combined" block,
and publishes the sensor. While no BMS is combined it is not evaluated, so
the request keeps its last state. The SoC is read as a float: a NaN fails
both comparisons and keeps the current state too. The "Request force
charge" switch clears the request at once with an on_turn_off, even while
no BMS is combined.

Reported in #346, first fix proposed in #347.
2026-11-10 22:02:11 +01:00
Sleeper85 239f9137c3 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:24 +01:00
Andrew Rankin 8b24872878 Update EG4 LL-V2 component to v1.1.1 (builds on ESPHome 2026.11) (#341)
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.
2026-11-09 23:19:31 +01:00
Sleeper85 a36677320c Docs: Add the 1.8.2 changelog 2026-11-09 00:18:43 +01:00
Sleeper85 b7ad915ea8 Remove the WS Touch-LCD enable_pin overrides
ESPHome 2026.11 includes esphome#21605: a default enable pin that is used
elsewhere in the config is dropped automatically. The model's ch422g pin 2
no longer conflicts with backlight_output, so the overrides added for
2026.10 are no longer needed. The resolved enable_pin is unchanged: ch422g
pin 6 on the 7", none on the 4.3 and 4.3B.
2026-11-09 00:14:59 +01:00
Sleeper85 67b6892e24 Set ESPHome min_version to 2026.11.0 and declare sub-device relation
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.
2026-11-09 00:06:28 +01:00
Sleeper85 4fd0bd796c Set YamBMS version to 1.8.2 2026-11-08 23:45:59 +01:00
89 changed files with 1019 additions and 502 deletions

No files matched your search

+1
View File
@@ -1 +1,2 @@
buy_me_a_coffee: sleeper85 buy_me_a_coffee: sleeper85
custom: ["https://paypal.me/Sleeper85"]
@@ -1,5 +1,5 @@
# Updated : 2026.11.06 # Updated : 2026.11.14
# Version : 1.8.1 # Version : 1.8.2
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -349,6 +349,9 @@ views:
- entity: number.yambms_demo_charger_offset_v - entity: number.yambms_demo_charger_offset_v
name: name:
type: entity type: entity
- entity: select.yambms_demo_cut_off_cell_voltage
name:
type: entity
- type: weblink - type: weblink
url: >- url: >-
https://github.com/Sleeper85/esphome-yambms/blob/main/documents/README/YamBMS_functions.md#charging-settings https://github.com/Sleeper85/esphome-yambms/blob/main/documents/README/YamBMS_functions.md#charging-settings
@@ -749,6 +752,10 @@ views:
<td>Chip</td> <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> <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>
<tr>
<td>Board</td>
<td>{{ states('sensor.yambms_demo_board_board_name') }}</td>
</tr>
<tr> <tr>
<td>Board Uptime</td> <td>Board Uptime</td>
<td>{{ states('sensor.yambms_demo_board_uptime') }}</td> <td>{{ states('sensor.yambms_demo_board_uptime') }}</td>
@@ -989,6 +996,7 @@ views:
- entity: number.bms_1_max_cell_voltage_number - entity: number.bms_1_max_cell_voltage_number
- entity: number.bms_1_min_temperature_number - entity: number.bms_1_min_temperature_number
- entity: number.bms_1_max_temperature_number - entity: number.bms_1_max_temperature_number
- entity: number.bms_1_yambms_errors_bitmask_number
conditions: conditions:
- condition: state - condition: state
state_not: unavailable state_not: unavailable
@@ -1144,6 +1152,7 @@ views:
- entity: number.bms_2_max_cell_voltage_number - entity: number.bms_2_max_cell_voltage_number
- entity: number.bms_2_min_temperature_number - entity: number.bms_2_min_temperature_number
- entity: number.bms_2_max_temperature_number - entity: number.bms_2_max_temperature_number
- entity: number.bms_2_yambms_errors_bitmask_number
conditions: conditions:
- condition: state - condition: state
state_not: unavailable state_not: unavailable
@@ -1299,6 +1308,7 @@ views:
- entity: number.bms_3_max_cell_voltage_number - entity: number.bms_3_max_cell_voltage_number
- entity: number.bms_3_min_temperature_number - entity: number.bms_3_min_temperature_number
- entity: number.bms_3_max_temperature_number - entity: number.bms_3_max_temperature_number
- entity: number.bms_3_yambms_errors_bitmask_number
conditions: conditions:
- condition: state - condition: state
state_not: unavailable state_not: unavailable
@@ -1,5 +1,5 @@
# Updated : 2026.11.06 # Updated : 2026.11.14
# Version : 1.8.1 # Version : 1.8.2
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -293,6 +293,10 @@ views:
<td>Chip</td> <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> <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>
<tr>
<td>Board</td>
<td>{{ states('sensor.yambms_board_board_name') }}</td>
</tr>
<tr> <tr>
<td>Board Uptime</td> <td>Board Uptime</td>
<td>{{ states('sensor.yambms_board_uptime') }}</td> <td>{{ states('sensor.yambms_board_uptime') }}</td>
@@ -452,6 +456,9 @@ views:
- entity: number.yambms_1_charger_offset_v - entity: number.yambms_1_charger_offset_v
name: name:
type: entity type: entity
- entity: select.yambms_1_cut_off_cell_voltage
name:
type: entity
- type: weblink - type: weblink
url: >- url: >-
https://github.com/Sleeper85/esphome-yambms/blob/main/documents/README/YamBMS_functions.md#charging-settings https://github.com/Sleeper85/esphome-yambms/blob/main/documents/README/YamBMS_functions.md#charging-settings
@@ -787,6 +794,10 @@ views:
<td>Chip</td> <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> <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>
<tr>
<td>Board</td>
<td>{{ states('sensor.yambms_board_board_name') }}</td>
</tr>
<tr> <tr>
<td>Board Uptime</td> <td>Board Uptime</td>
<td>{{ states('sensor.yambms_board_uptime') }}</td> <td>{{ states('sensor.yambms_board_uptime') }}</td>
@@ -1,5 +1,5 @@
# Updated : 2026.11.06 # Updated : 2026.11.14
# Version : 1.8.1 # Version : 1.8.2
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -293,6 +293,10 @@ views:
<td>Chip</td> <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> <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>
<tr>
<td>Board</td>
<td>{{ states('sensor.yambms_board_board_name') }}</td>
</tr>
<tr> <tr>
<td>Board Uptime</td> <td>Board Uptime</td>
<td>{{ states('sensor.yambms_board_uptime') }}</td> <td>{{ states('sensor.yambms_board_uptime') }}</td>
@@ -452,6 +456,9 @@ views:
- entity: number.yambms_1_charger_offset_v - entity: number.yambms_1_charger_offset_v
name: name:
type: entity type: entity
- entity: select.yambms_1_cut_off_cell_voltage
name:
type: entity
- type: weblink - type: weblink
url: >- url: >-
https://github.com/Sleeper85/esphome-yambms/blob/main/documents/README/YamBMS_functions.md#charging-settings https://github.com/Sleeper85/esphome-yambms/blob/main/documents/README/YamBMS_functions.md#charging-settings
@@ -787,6 +794,10 @@ views:
<td>Chip</td> <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> <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>
<tr>
<td>Board</td>
<td>{{ states('sensor.yambms_board_board_name') }}</td>
</tr>
<tr> <tr>
<td>Board Uptime</td> <td>Board Uptime</td>
<td>{{ states('sensor.yambms_board_uptime') }}</td> <td>{{ states('sensor.yambms_board_uptime') }}</td>
@@ -1,5 +1,5 @@
# Updated : 2026.11.06 # Updated : 2026.11.14
# Version : 1.8.1 # Version : 1.8.2
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -293,6 +293,10 @@ views:
<td>Chip</td> <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> <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>
<tr>
<td>Board</td>
<td>{{ states('sensor.yambms_board_board_name') }}</td>
</tr>
<tr> <tr>
<td>Board Uptime</td> <td>Board Uptime</td>
<td>{{ states('sensor.yambms_board_uptime') }}</td> <td>{{ states('sensor.yambms_board_uptime') }}</td>
@@ -452,6 +456,9 @@ views:
- entity: number.yambms_1_charger_offset_v - entity: number.yambms_1_charger_offset_v
name: name:
type: entity type: entity
- entity: select.yambms_1_cut_off_cell_voltage
name:
type: entity
- type: weblink - type: weblink
url: >- url: >-
https://github.com/Sleeper85/esphome-yambms/blob/main/documents/README/YamBMS_functions.md#charging-settings https://github.com/Sleeper85/esphome-yambms/blob/main/documents/README/YamBMS_functions.md#charging-settings
@@ -787,6 +794,10 @@ views:
<td>Chip</td> <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> <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>
<tr>
<td>Board</td>
<td>{{ states('sensor.yambms_board_board_name') }}</td>
</tr>
<tr> <tr>
<td>Board Uptime</td> <td>Board Uptime</td>
<td>{{ states('sensor.yambms_board_uptime') }}</td> <td>{{ states('sensor.yambms_board_uptime') }}</td>
@@ -1,5 +1,5 @@
# Updated : 2026.11.06 # Updated : 2026.11.14
# Version : 1.8.1 # Version : 1.8.2
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -293,6 +293,10 @@ views:
<td>Chip</td> <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> <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>
<tr>
<td>Board</td>
<td>{{ states('sensor.yambms_board_board_name') }}</td>
</tr>
<tr> <tr>
<td>Board Uptime</td> <td>Board Uptime</td>
<td>{{ states('sensor.yambms_board_uptime') }}</td> <td>{{ states('sensor.yambms_board_uptime') }}</td>
@@ -452,6 +456,9 @@ views:
- entity: number.yambms_1_charger_offset_v - entity: number.yambms_1_charger_offset_v
name: name:
type: entity type: entity
- entity: select.yambms_1_cut_off_cell_voltage
name:
type: entity
- type: weblink - type: weblink
url: >- url: >-
https://github.com/Sleeper85/esphome-yambms/blob/main/documents/README/YamBMS_functions.md#charging-settings https://github.com/Sleeper85/esphome-yambms/blob/main/documents/README/YamBMS_functions.md#charging-settings
@@ -787,6 +794,10 @@ views:
<td>Chip</td> <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> <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>
<tr>
<td>Board</td>
<td>{{ states('sensor.yambms_board_board_name') }}</td>
</tr>
<tr> <tr>
<td>Board Uptime</td> <td>Board Uptime</td>
<td>{{ states('sensor.yambms_board_uptime') }}</td> <td>{{ states('sensor.yambms_board_uptime') }}</td>
+26 -8
View File
@@ -5,7 +5,7 @@
![GitHub stars](https://img.shields.io/github/stars/Sleeper85/esphome-yambms) ![GitHub stars](https://img.shields.io/github/stars/Sleeper85/esphome-yambms)
![GitHub forks](https://img.shields.io/github/forks/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) ![GitHub watchers](https://img.shields.io/github/watchers/Sleeper85/esphome-yambms)
[!["Buy Me A Coffee"](https://img.shields.io/badge/buy%20me%20a%20coffee-donate-yellow.svg)](https://www.buymeacoffee.com/sleeper85) [![Badge Support](https://img.shields.io/badge/Support-YamBMS-FFDD00?logo=buymeacoffee&logoColor=black)](#support)
> [!TIP] > [!TIP]
> This page contains many links to other README. > This page contains many links to other README.
@@ -25,13 +25,19 @@
> [!IMPORTANT] > [!IMPORTANT]
> The most important thing for proper functioning of YamBMS is that **the voltage of your BMS is well calibrated**. > 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 `min_cell_voltage` and `max_cell_voltage` voltages of your `BMS`. > YamBMS logic is based on the cell 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).
| 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> | > [!CAUTION]
| --- | --- | > **DISCLAIMER:** Working with battery systems involves electrical hazards.
| **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> | > 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 !
**Sends over CAN / RS485 bus to your inverter :** **Sends over CAN / RS485 bus to your inverter :**
- Battery Voltage - Battery Voltage
@@ -174,7 +180,7 @@ rx_pin: 22 # to CAN board CRX (with 4.7K resistor except for SN65HVD230)
## Requirements ## Requirements
* [ESPHome 2026.10.0 or higher](https://github.com/esphome/esphome/releases) * [ESPHome 2026.11.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) * 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) * 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) * BMS JK, JBD, Seplos (other BMS brands already integrated with ESPhome can be added easily)
@@ -190,3 +196,15 @@ 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 [@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 [@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). * 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)
+17 -2
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.05 # Updated : 2026.11.19
# Version : 1.8.1 # Version : 1.8.2
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -285,6 +285,11 @@ packages:
bms_cell_ovp: '3.650' # V Used by 'Auto CCL' functions 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_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 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_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 bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
@@ -307,6 +312,11 @@ packages:
bms_cell_ovp: '3.650' # V Used by 'Auto CCL' functions 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_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 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_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 bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
@@ -329,6 +339,11 @@ packages:
bms_cell_ovp: '3.650' # V Used by 'Auto CCL' functions 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_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 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_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 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.05 # Updated : 2026.11.08
# Version : 1.8.1 # Version : 1.8.2
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
+2 -2
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.05 # Updated : 2026.11.08
# Version : 1.8.1 # Version : 1.8.2
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
+2 -2
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.05 # Updated : 2026.11.08
# Version : 1.8.1 # Version : 1.8.2
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
+2 -2
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.05 # Updated : 2026.11.08
# Version : 1.8.1 # Version : 1.8.2
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
+17 -2
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.05 # Updated : 2026.11.19
# Version : 1.8.1 # Version : 1.8.2
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -270,6 +270,11 @@ packages:
## BMS address must start at 2 with EG4 LLV2, ID 1 is a special case and has different output. ## 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_address: 2 # BMS 1 modbus address
bms_balance_trigger_voltage: '0.030' # V. Cell spread at which the BMS balances, set yours 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_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
# BMS 2 # BMS 2
- path: 'packages/bms/bms_combine_EG4_LLV2_RS485_bms_full.yaml' - path: 'packages/bms/bms_combine_EG4_LLV2_RS485_bms_full.yaml'
@@ -278,6 +283,11 @@ packages:
bms_name: 'EG4-BMS 2' bms_name: 'EG4-BMS 2'
bms_address: 3 # BMS 2 modbus address bms_address: 3 # BMS 2 modbus address
bms_balance_trigger_voltage: '0.030' # V. Cell spread at which the BMS balances, set yours 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_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
# BMS 3 # BMS 3
- path: 'packages/bms/bms_combine_EG4_LLV2_RS485_bms_full.yaml' - path: 'packages/bms/bms_combine_EG4_LLV2_RS485_bms_full.yaml'
@@ -286,6 +296,11 @@ packages:
bms_name: 'EG4-BMS 3' bms_name: 'EG4-BMS 3'
bms_address: 4 # BMS 3 modbus address bms_address: 4 # BMS 3 modbus address
bms_balance_trigger_voltage: '0.030' # V. Cell spread at which the BMS balances, set yours 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_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.05 # Updated : 2026.11.08
# Version : 1.8.1 # Version : 1.8.2
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
+2 -2
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.05 # Updated : 2026.11.08
# Version : 1.8.1 # Version : 1.8.2
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
+2 -3
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.05 # Updated : 2026.11.11
# Version : 1.8.1 # Version : 1.8.2
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -260,7 +260,6 @@ packages:
# RS485 Sniffer # RS485 Sniffer
- path: 'packages/bms/bms_combine_JK_RS485_Modbus_sniffer.yaml' - path: 'packages/bms/bms_combine_JK_RS485_Modbus_sniffer.yaml'
vars: vars:
sniffer_protocol: 'JK02_32S'
sniffer_uart_id: 'uart_esp_1' sniffer_uart_id: 'uart_esp_1'
# uart_flow_control_pin: ${talk_pin} # WS-RS485-CAN and other RS485 boards with a flow_control_pin # uart_flow_control_pin: ${talk_pin} # WS-RS485-CAN and other RS485 boards with a flow_control_pin
# BMS 1 # BMS 1
+2 -3
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.05 # Updated : 2026.11.11
# Version : 1.8.1 # Version : 1.8.2
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -260,7 +260,6 @@ packages:
# RS485 Sniffer # RS485 Sniffer
- path: 'packages/bms/bms_combine_JK_RS485_Modbus_sniffer.yaml' - path: 'packages/bms/bms_combine_JK_RS485_Modbus_sniffer.yaml'
vars: vars:
sniffer_protocol: 'JK02_32S'
sniffer_uart_id: 'uart_esp_1' sniffer_uart_id: 'uart_esp_1'
# uart_flow_control_pin: ${talk_pin} # WS-RS485-CAN and other RS485 boards with a flow_control_pin # uart_flow_control_pin: ${talk_pin} # WS-RS485-CAN and other RS485 boards with a flow_control_pin
# BMS 1 # BMS 1
+2 -2
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.05 # Updated : 2026.11.08
# Version : 1.8.1 # Version : 1.8.2
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
+2 -2
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.05 # Updated : 2026.11.08
# Version : 1.8.1 # Version : 1.8.2
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
+2 -2
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.05 # Updated : 2026.11.08
# Version : 1.8.1 # Version : 1.8.2
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
+17 -2
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.05 # Updated : 2026.11.19
# Version : 1.8.1 # Version : 1.8.2
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -277,6 +277,11 @@ packages:
bms_cell_ovp: '3.650' # V. Used by 'Auto CCL' functions 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_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 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_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
# BMS 2 # BMS 2
- path: 'packages/bms/bms_combine_SEPLOS_V1_V2_RS485_bms_full.yaml' - path: 'packages/bms/bms_combine_SEPLOS_V1_V2_RS485_bms_full.yaml'
@@ -293,6 +298,11 @@ packages:
bms_cell_ovp: '3.650' # V. Used by 'Auto CCL' functions 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_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 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_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
# BMS 3 # BMS 3
- path: 'packages/bms/bms_combine_SEPLOS_V1_V2_RS485_bms_full.yaml' - path: 'packages/bms/bms_combine_SEPLOS_V1_V2_RS485_bms_full.yaml'
@@ -309,6 +319,11 @@ packages:
bms_cell_ovp: '3.650' # V. Used by 'Auto CCL' functions 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_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 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_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
@@ -1,5 +1,5 @@
# Updated : 2026.11.05 # Updated : 2026.11.19
# Version : 1.8.1 # Version : 1.8.2
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -278,6 +278,11 @@ packages:
bms_cell_ovp: '3.650' # V. Used by 'Auto CCL' functions 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_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 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_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
# BMS 2 # BMS 2
- path: 'packages/bms/bms_combine_SEPLOS_V3_RS485_bms_full.yaml' - path: 'packages/bms/bms_combine_SEPLOS_V3_RS485_bms_full.yaml'
@@ -293,6 +298,11 @@ packages:
bms_cell_ovp: '3.650' # V. Used by 'Auto CCL' functions 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_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 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_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
# BMS 3 # BMS 3
- path: 'packages/bms/bms_combine_SEPLOS_V3_RS485_bms_full.yaml' - path: 'packages/bms/bms_combine_SEPLOS_V3_RS485_bms_full.yaml'
@@ -308,6 +318,11 @@ packages:
bms_cell_ovp: '3.650' # V. Used by 'Auto CCL' functions 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_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 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_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.05 # Updated : 2026.11.08
# Version : 1.8.1 # Version : 1.8.2
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
+17 -2
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.05 # Updated : 2026.11.19
# Version : 1.8.1 # Version : 1.8.2
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -278,6 +278,11 @@ packages:
bms_cell_ovp: '3.650' # V Used by 'Auto CCL' functions 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_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 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_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 bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
@@ -300,6 +305,11 @@ packages:
bms_cell_ovp: '3.650' # V Used by 'Auto CCL' functions 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_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 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_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 bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
@@ -322,6 +332,11 @@ packages:
bms_cell_ovp: '3.650' # V Used by 'Auto CCL' functions 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_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 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_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 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.05 # Updated : 2026.11.08
# Version : 1.8.1 # Version : 1.8.2
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
+2 -2
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.05 # Updated : 2026.11.08
# Version : 1.8.1 # Version : 1.8.2
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
+2 -2
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.05 # Updated : 2026.11.08
# Version : 1.8.1 # Version : 1.8.2
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
+2 -2
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.05 # Updated : 2026.11.08
# Version : 1.8.1 # Version : 1.8.2
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
+2 -2
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.05 # Updated : 2026.11.08
# Version : 1.8.1 # Version : 1.8.2
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -1,5 +1,5 @@
# Updated : 2026.11.05 # Updated : 2026.11.08
# Version : 1.8.1 # Version : 1.8.2
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
+39 -4
View File
@@ -18,6 +18,37 @@ The charging voltage and current correspond to the default values in the YAML sc
![Image](../../images/YamBMS_Charging_Logic_Diagram.png "YamBMS Charging Logic") ![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 ## Cut-Off Charging Logic Equation
Source: [Charging Marine Lithium Battery Banks](https://nordkyndesign.com/charging-marine-lithium-battery-banks) Source: [Charging Marine Lithium Battery Banks](https://nordkyndesign.com/charging-marine-lithium-battery-banks)
@@ -75,17 +106,21 @@ 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; - 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. - 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 stops both timers. Returning to the Bulk phase, going to `Wait` or a BMS dropout stops both timers.
Some BMS balance their cells but never expose a balancing flag. YamBMS infers it for 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 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 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 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 BMS that reports the flag. A real external balancer, when one is online, always takes
priority over the inference. This is enabled by default for Seplos V3, Seplos V1/V2, priority over the inference. It is available, but **disabled by default**, for Seplos V3,
EG4 LL v2 and JK RS485 DISPLAY — see 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
[Changelog_Fake_Equalizing.md](changelog/Changelog_Fake_Equalizing.md) for the references [Changelog_Fake_Equalizing.md](changelog/Changelog_Fake_Equalizing.md) for the references
it uses and how to tune or disable it. it uses and how to tune it.
## LFP Cut-Off Values ## 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 ### 1. Install ESPHome on your computer
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> 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>
[Follow these instructions for installation on Windows, Mac or Linux.](https://esphome.io/guides/installing_esphome) [Follow these instructions for installation on Windows, Mac or Linux.](https://esphome.io/guides/installing_esphome)
> [!TIP] > [!TIP]
+4 -2
View File
@@ -204,9 +204,11 @@ The Deye inverter sends the ACK (can_id `0x305`) only when it receives the can_i
## Warning & Alarms ## Warning & Alarms
If all BMS have alarms, the alarms are sent to the `CAN bus` as `Protection Alarms`. If all combined BMS have alarms, the alarms are sent to the `CAN bus` as `Protection Alarms`.
If at least one BMS has no alarms, the alarms are sent to the CAN bus as `Warning`. 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`.
Both **text_sensor** `Alarm` and `Warning` show the alarms/warnings currently transmitted to the inverter. Both **text_sensor** `Alarm` and `Warning` show the alarms/warnings currently transmitted to the inverter.
+7 -1
View File
@@ -193,6 +193,10 @@ This function allows you to force a charge from `GRID` :
- when `SoC <= Start SoC` the forced charge start - when `SoC <= Start SoC` the forced charge start
- when `SoC >= Stop SoC` the forced charge stop - 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. Works only with `PYLON`, `LuxPower` and `Victron` protocols.
## Auto functions ## Auto functions
@@ -400,6 +404,8 @@ 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 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 ## Auto EOC
![Image](../../images/YamBMS_Auto_EOC.png "YamBMS Auto EOC") ![Image](../../images/YamBMS_Auto_EOC.png "YamBMS Auto EOC")
@@ -490,7 +496,7 @@ The text sensor `Auto SoC Limit Status` will show the current status of the func
Modes: Modes:
- `Float`: Will set the charging mode from `Bulk` to `Float`. If already at `Float`, nothing will happen. - `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 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 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`.
- `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. - `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. 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,6 +6,26 @@
![GitHub forks](https://img.shields.io/github/forks/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) ![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 : * YamBMS 1.8.1 :
* Set esphome `min_version` to `2026.10.0` * Set esphome `min_version` to `2026.10.0`
* New documentation : * New documentation :
@@ -97,8 +97,9 @@ reading wins; the inference only applies when no balancer reports for this pack.
## 3. Which BMS are concerned ## 3. Which BMS are concerned
The four BMS below shipped a hardcoded `return false;`. The package is now **included by The four BMS below shipped a hardcoded `return false;`. The package is **included by
default** for them — there is nothing to add to your YAML: 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)).
| BMS | Packages | | BMS | Packages |
|---|---| |---|---|
@@ -164,7 +165,7 @@ They now expose it like the others with the following default values:
bms_id: '1' bms_id: '1'
# ... other vars of your BMS ... # ... other vars of your BMS ...
bms_balance_trigger_voltage: '0.010' # V. Your BMS's balancing threshold bms_balance_trigger_voltage: '0.010' # V. Your BMS's balancing threshold
bms_fake_equalizing_enabled: 'true' # Optional : true/fasle, true by default bms_fake_equalizing_enabled: 'true' # Optional : true/false, false by default
bms_fake_equalizing_hysteresis: '0.030' # Optional : 0.030 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 bms_fake_equalizing_delta_hysteresis: '0.002' # Optional : 0.002 by default
``` ```
@@ -179,7 +180,7 @@ defaults are fine for any pack.
| Substitution | Default | Meaning | | Substitution | Default | Meaning |
|---|---|---| |---|---|---|
| `bms_fake_equalizing_enabled` | `'true'` | set to `'false'` to turn the inference off for this BMS | | `bms_fake_equalizing_enabled` | `'false'` | set to `'true'` to turn the inference on 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_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 | | `bms_fake_equalizing_delta_hysteresis` | `0.002` | how far below the trigger voltage the spread may fall before balancing stops |
@@ -187,30 +188,41 @@ 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 `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. the cells are reported at, so a value finer than `0.001` has no effect.
**To disable the inference** on a BMS without editing any package: ### 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:
```yaml ```yaml
bms_fake_equalizing_enabled: 'false' bms_fake_equalizing_enabled: 'true'
``` ```
The flag then reports the constant `false` its package used to hardcode, which is the > [!WARNING]
behaviour you had before this release. Do *not* try to disable it by raising > 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
`bms_balance_trigger_voltage` instead — that value also feeds `Auto CVL`, where it means `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 something else entirely: how far the highest cell may overshoot the per-cell setpoint
before the PI clamps. before the PI clamps.
## 5. What changes for you on upgrade ## 5. What changes for you on upgrade
If you own one of the four BMS above, the `balancing` entity will now turn on at the top 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
of charge as soon as your cells are spread by as much as your BMS's own 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 `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 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 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 intended fix, but it *is* a change in charge termination, so watch a couple of cycles
after updating. after enabling it.
The risk is bounded on the safe side. A false positive can only extend the charge up to 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. A false negative simply restores 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 previous behaviour. the previous behaviour.
## Why not the original pull request ## Why not the original pull request
@@ -28,6 +28,11 @@ have made the changes below.
CAN and RS485 links can run at the same time: keep both blocks, each link with its own CAN and RS485 links can run at the same time: keep both blocks, each link with its own
`canbus_id` or `rs485_id`. The dashboard shows up to 3 CAN links and 3 RS485 links. If you only `canbus_id` or `rs485_id`. The dashboard shows up to 3 CAN links and 3 RS485 links. If you only
use RS485, comment out the CAN block. use RS485, comment out the CAN block.
- **Balancing inferred:** EG4 LL V2, Seplos V1/V2, Seplos V3 and JK RS485 DISPLAY do not report
balancing, and YamBMS now infers it from the cell spread. While a pack is seen as balancing, the
charge only ends when the spread closes or the EOC timer expires, and the SoC stays at 98% until
then. Set `bms_balance_trigger_voltage` to your BMS's actual setting and keep `EOC timer enabled`
ON. See [Fake Equalizing](Changelog_Fake_Equalizing.md).
## How to update from 1.7.0 or 1.8.0 ## How to update from 1.7.0 or 1.8.0
@@ -102,6 +102,10 @@ 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 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. 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 ## Section comments
Large files (`yambms_core.yaml`, `bms_combine.yaml`, the `YamBMS_LP_*` root YAML) are structured Large files (`yambms_core.yaml`, `bms_combine.yaml`, the `YamBMS_LP_*` root YAML) are structured
+76 -5
View File
@@ -42,12 +42,58 @@ 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 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. the inverter. Do not shorten it to a few representative checks.
Note that the checks are not uniform. Most use `has_state()`, but `total_voltage` and Every entity in the condition is mandatory: a BMS with one value missing or `NaN` is not
`battery_capacity` use `> 0` — a BMS reporting zero for those is treated as not ready rather than combined.
as a valid reading. `max_charge_current` and `max_discharge_current` use `>= 0`: `0 A` is a valid
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
limit that a BMS can announce, and it must not take that BMS out of the combination. A `NaN` still 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. 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 ### Combined by contribution, combined continuously, uncombined
Three distinct scopes in the same lambda, and they are not interchangeable: Three distinct scopes in the same lambda, and they are not interchangeable:
@@ -111,6 +157,24 @@ 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 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. 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 ## Frame sequencing
**File:** `packages/yambms/yambms_canbus.yaml` **File:** `packages/yambms/yambms_canbus.yaml`
@@ -348,7 +412,14 @@ 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. 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 `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` 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`. 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.
Do not replace this with reported charge and discharge limits of zero: the inverter would still 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. see a battery, on a link the user believes is off.
@@ -457,7 +528,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` `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. shares it between the nodes of a multi-node setup from the root.
### `flow_control` is enabled by a var, so `min_version` is 2026.10.0 ### `flow_control` is enabled by a var, so `min_version` is at least 2026.10.0
`uart_flow_control_pin` is passed like any other var of the import and reaches the UART file, `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 which includes `board_options_itf_uart_flow_control.yaml` only when it is defined. So no consumer
@@ -57,6 +57,11 @@ packages:
bms_cell_ovp: '3.650' # V Used by 'Auto CCL' functions 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_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 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_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 bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
@@ -79,6 +84,11 @@ packages:
bms_cell_ovp: '3.650' # V Used by 'Auto CCL' functions 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_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 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_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 bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
@@ -101,5 +111,10 @@ packages:
bms_cell_ovp: '3.650' # V Used by 'Auto CCL' functions 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_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 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_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 bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
@@ -40,6 +40,11 @@ packages:
## BMS address must start at 2 with EG4 LLV2, ID 1 is a special case and has different output. ## 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_address: 2 # BMS 1 modbus address
bms_balance_trigger_voltage: '0.030' # V. Cell spread at which the BMS balances, set yours 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_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
bms2: !include bms2: !include
@@ -49,6 +54,11 @@ packages:
bms_name: 'EG4-BMS 2' bms_name: 'EG4-BMS 2'
bms_address: 3 # BMS 2 modbus address bms_address: 3 # BMS 2 modbus address
bms_balance_trigger_voltage: '0.030' # V. Cell spread at which the BMS balances, set yours 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_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
bms3: !include bms3: !include
@@ -58,4 +68,9 @@ packages:
bms_name: 'EG4-BMS 3' bms_name: 'EG4-BMS 3'
bms_address: 4 # BMS 3 modbus address bms_address: 4 # BMS 3 modbus address
bms_balance_trigger_voltage: '0.030' # V. Cell spread at which the BMS balances, set yours 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_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 # Updated : 2026.11.11
# Version : 1.1.5 # Version : 1.1.6
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -32,7 +32,6 @@ packages:
sniffer1: !include sniffer1: !include
file: packages/bms/bms_combine_JK_RS485_Modbus_sniffer.yaml file: packages/bms/bms_combine_JK_RS485_Modbus_sniffer.yaml
vars: vars:
sniffer_protocol: 'JK02_32S'
sniffer_uart_id: 'uart_esp_1' sniffer_uart_id: 'uart_esp_1'
# uart_flow_control_pin: ${talk_pin} # WS-RS485-CAN and other RS485 boards with a flow_control_pin # uart_flow_control_pin: ${talk_pin} # WS-RS485-CAN and other RS485 boards with a flow_control_pin
@@ -1,5 +1,5 @@
# Updated : 2026.02.16 # Updated : 2026.11.11
# Version : 1.1.5 # Version : 1.1.6
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -32,7 +32,6 @@ packages:
sniffer1: !include sniffer1: !include
file: packages/bms/bms_combine_JK_RS485_Modbus_sniffer.yaml file: packages/bms/bms_combine_JK_RS485_Modbus_sniffer.yaml
vars: vars:
sniffer_protocol: 'JK02_32S'
sniffer_uart_id: 'uart_esp_1' sniffer_uart_id: 'uart_esp_1'
# uart_flow_control_pin: ${talk_pin} # WS-RS485-CAN and other RS485 boards with a flow_control_pin # uart_flow_control_pin: ${talk_pin} # WS-RS485-CAN and other RS485 boards with a flow_control_pin
@@ -1,5 +1,5 @@
# Updated : 2026.02.16 # Updated : 2026.11.11
# Version : 1.1.5 # Version : 1.1.6
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -32,7 +32,6 @@ packages:
sniffer1: !include sniffer1: !include
file: packages/bms/bms_combine_JK_RS485_Modbus_sniffer.yaml file: packages/bms/bms_combine_JK_RS485_Modbus_sniffer.yaml
vars: vars:
sniffer_protocol: 'JK02_32S'
sniffer_uart_id: 'uart_esp_1' sniffer_uart_id: 'uart_esp_1'
# uart_flow_control_pin: ${talk_pin} # WS-RS485-CAN and other RS485 boards with a flow_control_pin # uart_flow_control_pin: ${talk_pin} # WS-RS485-CAN and other RS485 boards with a flow_control_pin
@@ -47,6 +47,11 @@ packages:
bms_cell_ovp: '3.650' # V. Used by 'Auto CCL' functions 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_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 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_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
bms2: !include bms2: !include
@@ -64,6 +69,11 @@ packages:
bms_cell_ovp: '3.650' # V. Used by 'Auto CCL' functions 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_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 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_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
bms3: !include bms3: !include
@@ -81,4 +91,9 @@ packages:
bms_cell_ovp: '3.650' # V. Used by 'Auto CCL' functions 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_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 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_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
@@ -48,6 +48,11 @@ packages:
bms_cell_ovp: '3.650' # V. Used by 'Auto CCL' functions 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_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 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_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
bms2: !include bms2: !include
@@ -64,6 +69,11 @@ packages:
bms_cell_ovp: '3.650' # V. Used by 'Auto CCL' functions 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_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 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_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
bms3: !include bms3: !include
@@ -80,4 +90,9 @@ packages:
bms_cell_ovp: '3.650' # V. Used by 'Auto CCL' functions 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_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 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_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
@@ -61,6 +61,11 @@
bms_cell_ovp: '3.650' # V Used by 'Auto CCL' functions 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_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 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_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 bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
@@ -83,6 +88,11 @@
bms_cell_ovp: '3.650' # V Used by 'Auto CCL' functions 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_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 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_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 bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
@@ -105,5 +115,10 @@
bms_cell_ovp: '3.650' # V Used by 'Auto CCL' functions 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_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 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_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 bms_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
@@ -44,6 +44,11 @@
## BMS address must start at 2 with EG4 LLV2, ID 1 is a special case and has different output. ## 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_address: 2 # BMS 1 modbus address
bms_balance_trigger_voltage: '0.030' # V. Cell spread at which the BMS balances, set yours 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_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
# BMS 2 # BMS 2
- path: 'packages/bms/bms_combine_EG4_LLV2_RS485_bms_full.yaml' - path: 'packages/bms/bms_combine_EG4_LLV2_RS485_bms_full.yaml'
@@ -52,12 +57,22 @@
bms_name: 'EG4-BMS 2' bms_name: 'EG4-BMS 2'
bms_address: 3 # BMS 2 modbus address bms_address: 3 # BMS 2 modbus address
bms_balance_trigger_voltage: '0.030' # V. Cell spread at which the BMS balances, set yours 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_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
# BMS 3 # BMS 3
- path: 'packages/bms/bms_combine_EG4_LLV2_RS485_bms_full.yaml' - path: 'packages/bms/bms_combine_EG4_LLV2_RS485_bms_full.yaml'
vars: vars:
bms_id: '2' # must be a number bms_id: '3' # must be a number
bms_name: 'EG4-BMS 3' bms_name: 'EG4-BMS 3'
bms_address: 4 # BMS 3 modbus address bms_address: 4 # BMS 3 modbus address
bms_balance_trigger_voltage: '0.030' # V. Cell spread at which the BMS balances, set yours 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_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 # Updated : 2026.11.11
# Version : 1.1.5 # Version : 1.1.6
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -34,7 +34,6 @@
# RS485 Sniffer # RS485 Sniffer
- path: 'packages/bms/bms_combine_JK_RS485_Modbus_sniffer.yaml' - path: 'packages/bms/bms_combine_JK_RS485_Modbus_sniffer.yaml'
vars: vars:
sniffer_protocol: 'JK02_32S'
sniffer_uart_id: 'uart_esp_1' sniffer_uart_id: 'uart_esp_1'
# uart_flow_control_pin: ${talk_pin} # WS-RS485-CAN and other RS485 boards with a flow_control_pin # uart_flow_control_pin: ${talk_pin} # WS-RS485-CAN and other RS485 boards with a flow_control_pin
# BMS 1 # BMS 1
@@ -1,5 +1,5 @@
# Updated : 2026.02.16 # Updated : 2026.11.11
# Version : 1.1.5 # Version : 1.1.6
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -34,7 +34,6 @@
# RS485 Sniffer # RS485 Sniffer
- path: 'packages/bms/bms_combine_JK_RS485_Modbus_sniffer.yaml' - path: 'packages/bms/bms_combine_JK_RS485_Modbus_sniffer.yaml'
vars: vars:
sniffer_protocol: 'JK02_32S'
sniffer_uart_id: 'uart_esp_1' sniffer_uart_id: 'uart_esp_1'
# uart_flow_control_pin: ${talk_pin} # WS-RS485-CAN and other RS485 boards with a flow_control_pin # uart_flow_control_pin: ${talk_pin} # WS-RS485-CAN and other RS485 boards with a flow_control_pin
# BMS 1 # BMS 1
@@ -51,6 +51,11 @@
bms_cell_ovp: '3.650' # V. Used by 'Auto CCL' functions 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_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 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_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
# BMS 2 # BMS 2
- path: 'packages/bms/bms_combine_SEPLOS_V1_V2_RS485_bms_full.yaml' - path: 'packages/bms/bms_combine_SEPLOS_V1_V2_RS485_bms_full.yaml'
@@ -67,6 +72,11 @@
bms_cell_ovp: '3.650' # V. Used by 'Auto CCL' functions 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_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 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_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
# BMS 3 # BMS 3
- path: 'packages/bms/bms_combine_SEPLOS_V1_V2_RS485_bms_full.yaml' - path: 'packages/bms/bms_combine_SEPLOS_V1_V2_RS485_bms_full.yaml'
@@ -83,4 +93,9 @@
bms_cell_ovp: '3.650' # V. Used by 'Auto CCL' functions 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_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 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_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
@@ -52,6 +52,11 @@
bms_cell_ovp: '3.650' # V. Used by 'Auto CCL' functions 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_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 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_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
# BMS 2 # BMS 2
- path: 'packages/bms/bms_combine_SEPLOS_V3_RS485_bms_full.yaml' - path: 'packages/bms/bms_combine_SEPLOS_V3_RS485_bms_full.yaml'
@@ -67,6 +72,11 @@
bms_cell_ovp: '3.650' # V. Used by 'Auto CCL' functions 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_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 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_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
# BMS 3 # BMS 3
- path: 'packages/bms/bms_combine_SEPLOS_V3_RS485_bms_full.yaml' - path: 'packages/bms/bms_combine_SEPLOS_V3_RS485_bms_full.yaml'
@@ -82,4 +92,9 @@
bms_cell_ovp: '3.650' # V. Used by 'Auto CCL' functions 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_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 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_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable
@@ -1,5 +1,5 @@
# Updated : 2025.12.23 # Updated : 2026.11.08
# Version : 1.1.1 # Version : 1.1.2
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -23,3 +23,4 @@ esphome:
devices: devices:
- id: balancer_${bms_id} - id: balancer_${bms_id}
name: "${balancer_name}" name: "${balancer_name}"
relation: via
+13 -2
View File
@@ -1,5 +1,5 @@
# Updated : 2026.08.31 # Updated : 2026.11.14
# Version : 1.2.9 # Version : 1.3.0
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -68,6 +68,8 @@ esphome:
- lambda: |- - lambda: |-
// Register System // Register System
id(global_register_led)(${CAT_SYSTEM}, ${board_fault_device_id}, id(${board_status_led_id})); 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: time:
# https://esphome.io/components/time/homeassistant # https://esphome.io/components/time/homeassistant
@@ -159,6 +161,15 @@ text_sensor:
if (!t.is_valid()) return {}; if (!t.is_valid()) return {};
return t.strftime("%Y-%m-%d %H:%M:%S"); 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 # https://esphome.io/components/text_sensor/version
- platform: version - platform: version
name: ESPHome version name: ESPHome version
+4 -4
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.05 # Updated : 2026.11.08
# Version : 1.8.1 # Version : 1.8.2
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # 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>. # along with this program. If not, see <http://www.gnu.org/licenses/gpl.html>.
substitutions: substitutions:
yambms_version: "1.8.1" yambms_version: "1.8.2"
esphome: esphome:
name: ${hostname} name: ${hostname}
@@ -28,4 +28,4 @@ esphome:
project: project:
name: Sleeper85.YamBMS name: Sleeper85.YamBMS
version: ${yambms_version} version: ${yambms_version}
min_version: 2026.10.0 min_version: 2026.11.0
+3 -2
View File
@@ -1,5 +1,5 @@
# Updated : 2025.12.22 # Updated : 2026.11.08
# Version : 1.1.2 # Version : 1.1.3
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -26,3 +26,4 @@ esphome:
devices: devices:
- id: ${board_id} - id: ${board_id}
name: "${friendly_name} board" name: "${friendly_name} board"
relation: via
@@ -1,5 +1,5 @@
# Updated : 2025.12.22 # Updated : 2026.11.08
# Version : 1.1.2 # Version : 1.1.3
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -23,3 +23,4 @@ esphome:
devices: devices:
- id: sniffer_${sniffer_uart_id} - id: sniffer_${sniffer_uart_id}
name: "${sniffer_name}" name: "${sniffer_name}"
relation: via
+3 -2
View File
@@ -1,5 +1,5 @@
# Updated : 2025.12.23 # Updated : 2026.11.08
# Version : 1.1.1 # Version : 1.1.2
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -23,3 +23,4 @@ esphome:
devices: devices:
- id: bms_${bms_id} - id: bms_${bms_id}
name: "${bms_name}" name: "${bms_name}"
relation: via
+43 -36
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.05 # Updated : 2026.11.10
# Version : 1.8.1 # Version : 1.8.2
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# This YAML is free software: you can redistribute it and/or # This YAML is free software: you can redistribute it and/or
@@ -46,39 +46,6 @@ binary_sensor:
name: "Can be combined" name: "Can be combined"
id: bms${bms_id}_can_be_combined id: bms${bms_id}_can_be_combined
device_id: bms_${bms_id} 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:
- interval: ${yambms_update_interval} - interval: ${yambms_update_interval}
@@ -90,8 +57,48 @@ interval:
// BMS number to combine ? // BMS number to combine ?
if (id(yambms${yambms_id}_var_to_combine_bms_number) == ${bms_id}) 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 ? // The BMS can be combined ?
if (id(bms${bms_id}_can_be_combined).state) if (can_be_combined)
{ {
// +-----------------------------------------------+ // +-----------------------------------------------+
// | Installed battery capacity contribution | // | Installed battery capacity contribution |
@@ -1,5 +1,5 @@
# Updated : 2026.11.05 # Updated : 2026.11.15
# Version : 2.0.3 # Version : 2.0.5
# GitHub : https://github.com/RAR/esphome-eg4-bms # GitHub : https://github.com/RAR/esphome-eg4-bms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -22,7 +22,7 @@ substitutions:
eg4_modbus_id: modbus_eg4 eg4_modbus_id: modbus_eg4
external_components: external_components:
- source: github://RAR/esphome-eg4-bms@v1.1.0 - source: github://RAR/esphome-eg4-bms@v1.1.4
refresh: 0s refresh: 0s
packages: packages:
@@ -1,5 +1,5 @@
# Updated : 2026.11.05 # Updated : 2026.11.19
# Version : 1.2.4 # Version : 1.2.5
# GitHub : https://github.com/syssi/esphome-jk-bms # GitHub : https://github.com/syssi/esphome-jk-bms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -35,8 +35,8 @@ packages:
substitutions: substitutions:
# (V) cell spread at which this BMS starts balancing. Not readable over the display # (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 # port, so declare your unit's actual setting at import. Used by 'Auto CVL' and, when
# bms_options_fake_equalizing.yaml is included, as the spread reference for the # Fake Equalizing is enabled (bms_fake_equalizing_enabled), as the spread reference
# inferred balancing flag. # for the inferred balancing flag.
bms_balance_trigger_voltage: '0.01' bms_balance_trigger_voltage: '0.01'
# +--------------------------------------+ # +--------------------------------------+
@@ -1,5 +1,5 @@
# Updated : 2026.08.14 # Updated : 2026.11.11
# Version : 1.3.5 # Version : 1.3.6
# GitHub : https://github.com/txubelaxu/esphome-jk-bms # GitHub : https://github.com/txubelaxu/esphome-jk-bms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -44,9 +44,6 @@ jk_rs485_bms:
switch: switch:
- platform: jk_rs485_bms - platform: jk_rs485_bms
jk_rs485_bms_id: jk_rs485_bms${bms_id} jk_rs485_bms_id: jk_rs485_bms${bms_id}
precharging:
device_id: bms_${bms_id}
name: "precharging"
charging: charging:
id: bms${bms_id}_charge_switch id: bms${bms_id}_charge_switch
device_id: bms_${bms_id} device_id: bms_${bms_id}
@@ -256,12 +253,6 @@ text_sensor:
errors: errors:
device_id: bms_${bms_id} device_id: bms_${bms_id}
name: "errors" 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: total_runtime_formatted:
device_id: bms_${bms_id} device_id: bms_${bms_id}
name: "total runtime formatted" name: "total runtime formatted"
@@ -1,5 +1,5 @@
# Updated : 2026.11.05 # Updated : 2026.11.11
# Version : 1.3.5 # Version : 1.3.6
# GitHub : https://github.com/txubelaxu/esphome-jk-bms # GitHub : https://github.com/txubelaxu/esphome-jk-bms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -36,7 +36,7 @@ logger:
# +--------------------------------------+ # +--------------------------------------+
external_components: external_components:
- source: github://Sleeper85/esphome-components@main - source: github://Sleeper85/esphome-components@dev
refresh: 60min refresh: 60min
components: [ jk_rs485_sniffer , jk_rs485_bms ] components: [ jk_rs485_sniffer , jk_rs485_bms ]
# - source: # - source:
@@ -45,7 +45,6 @@ external_components:
jk_rs485_sniffer: jk_rs485_sniffer:
- id: ${sniffer_id} - id: ${sniffer_id}
protocol_version: ${sniffer_protocol}
rx_timeout: 500ms rx_timeout: 500ms
uart_id: ${sniffer_uart_id} uart_id: ${sniffer_uart_id}
@@ -58,7 +57,7 @@ switch:
device_id: sniffer_${sniffer_uart_id} device_id: sniffer_${sniffer_uart_id}
name: "Broadcasting BMS settings to all BMS" name: "Broadcasting BMS settings to all BMS"
icon: "mdi:cast" icon: "mdi:cast"
restore_mode: RESTORE_DEFAULT_OFF restore_mode: RESTORE_DEFAULT_ON
optimistic: true optimistic: true
entity_category: config entity_category: config
turn_on_action: turn_on_action:
@@ -1,5 +1,5 @@
# Updated : 2026.09.02 # Updated : 2026.11.11
# Version : 1.3.4 # Version : 1.3.5
# GitHub : https://github.com/txubelaxu/esphome-jk-bms # GitHub : https://github.com/txubelaxu/esphome-jk-bms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -23,6 +23,10 @@ substitutions:
packages: packages:
modbus_sniffer: !include bms_base_sniffer_sub_device.yaml 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: logger:
tx_buffer_size: 1024 tx_buffer_size: 1024
@@ -41,7 +45,6 @@ external_components:
jk_rs485_sniffer: jk_rs485_sniffer:
- id: ${sniffer_id} - id: ${sniffer_id}
protocol_version: ${sniffer_protocol}
rx_timeout: 500ms rx_timeout: 500ms
uart_id: ${sniffer_uart_id} uart_id: ${sniffer_uart_id}
@@ -54,7 +57,7 @@ switch:
device_id: sniffer_${sniffer_uart_id} device_id: sniffer_${sniffer_uart_id}
name: "Broadcasting BMS settings to all BMS" name: "Broadcasting BMS settings to all BMS"
icon: "mdi:cast" icon: "mdi:cast"
restore_mode: RESTORE_DEFAULT_OFF restore_mode: RESTORE_DEFAULT_ON
optimistic: true optimistic: true
entity_category: config entity_category: config
turn_on_action: turn_on_action:
@@ -1,5 +1,5 @@
# Updated : 2026.11.05 # Updated : 2026.11.11
# Version : 1.3.4 # Version : 1.3.5
# GitHub : https://github.com/txubelaxu/esphome-jk-bms # GitHub : https://github.com/txubelaxu/esphome-jk-bms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -36,7 +36,7 @@ logger:
# +--------------------------------------+ # +--------------------------------------+
external_components: external_components:
- source: github://Sleeper85/esphome-components@main - source: github://Sleeper85/esphome-components@dev
refresh: 0s refresh: 0s
components: [ jk_rs485_sniffer , jk_rs485_bms ] components: [ jk_rs485_sniffer , jk_rs485_bms ]
# - source: # - source:
@@ -45,7 +45,6 @@ external_components:
jk_rs485_sniffer: jk_rs485_sniffer:
- id: ${sniffer_id} - id: ${sniffer_id}
protocol_version: ${sniffer_protocol}
rx_timeout: 500ms rx_timeout: 500ms
uart_id: ${sniffer_uart_id} uart_id: ${sniffer_uart_id}
talk_pin: ${sniffer_talk_pin} talk_pin: ${sniffer_talk_pin}
@@ -59,7 +58,7 @@ switch:
device_id: sniffer_${sniffer_uart_id} device_id: sniffer_${sniffer_uart_id}
name: "Broadcasting BMS settings to all BMS" name: "Broadcasting BMS settings to all BMS"
icon: "mdi:cast" icon: "mdi:cast"
restore_mode: RESTORE_DEFAULT_OFF restore_mode: RESTORE_DEFAULT_ON
optimistic: true optimistic: true
entity_category: config entity_category: config
turn_on_action: turn_on_action:
@@ -1,5 +1,5 @@
# Updated : 2025.12.22 # Updated : 2026.11.10
# Version : 2.0.1 # Version : 2.0.2
# GitHub : https://github.com/RAR/esphome-eg4-bms # GitHub : https://github.com/RAR/esphome-eg4-bms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -43,6 +43,7 @@
# Bit 10 Charge Under Temp 0000 0100 0000 0000 0x0400 # Bit 10 Charge Under Temp 0000 0100 0000 0000 0x0400
# Bit 11 Discharge Under Temp 0000 1000 0000 0000 0x0800 # Bit 11 Discharge Under Temp 0000 1000 0000 0000 0x0800
# Bit 12 Low Capacity 0001 0000 0000 0000 0x1000 # 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 # Bit 13 Discharge SC 0010 0000 0000 0000 0x2000
# +--------------------------------------+ # +--------------------------------------+
@@ -79,8 +80,11 @@ sensor:
- throttle: 10s - throttle: 10s
- delta: 1 - delta: 1
lambda: |- lambda: |-
uint32_t bms_errors_bitmask = id(bms${bms_id}_errors_bitmask).state; // The component publishes NaN for a register block that has gone stale (no bits)
uint32_t bms_protection_bitmask = id(bms${bms_id}_protection_bitmask).state; 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;
uint16_t yambms_errors_bitmask = 0; uint16_t yambms_errors_bitmask = 0;
if (bms_errors_bitmask > 0) if (bms_errors_bitmask > 0)
@@ -100,11 +104,12 @@ sensor:
if (bms_protection_bitmask & 0x0010) yambms_errors_bitmask |= 0x0100; if (bms_protection_bitmask & 0x0010) yambms_errors_bitmask |= 0x0100;
if (bms_protection_bitmask & 0x0020) yambms_errors_bitmask |= 0x0080; if (bms_protection_bitmask & 0x0020) yambms_errors_bitmask |= 0x0080;
if (bms_protection_bitmask & 0x0100) yambms_errors_bitmask |= 0x0020; 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 & 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 & 0x2000) yambms_errors_bitmask |= 0x0400;
if (bms_protection_bitmask & 0x0040) yambms_errors_bitmask |= 0x0001; if (bms_protection_bitmask & 0x0040) yambms_errors_bitmask |= 0x0001;
if (bms_protection_bitmask & 0x0080) 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; return yambms_errors_bitmask;
+25 -12
View File
@@ -1,5 +1,5 @@
# Updated : 2026.08.29 # Updated : 2026.11.19
# Version : 1.1.0 # Version : 1.1.1
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -47,7 +47,7 @@
# | max cell < setpoint - hysteresis the pack dropped off the setpoint # | max cell < setpoint - hysteresis the pack dropped off the setpoint
# | OR (max - min) < trigger - delta hyst. the spread closed back below it # | OR (max - min) < trigger - delta hyst. the spread closed back below it
# | # |
# | Nothing is configurable but an on/off switch and the two hysteresis margins, so # | Nothing is configurable but an on/off switch (off by default) and the two hysteresis margins, so
# | the inference tracks the hardware instead of a constant that would fit no BMS in # | the inference tracks the hardware instead of a constant that would fit no BMS in
# | particular : the # | particular : the
# | balance trigger voltage is 10 mV on a JK or a Seplos, 30 mV on an EG4. A pack that # | balance trigger voltage is 10 mV on a JK or a Seplos, 30 mV on an EG4. A pack that
@@ -81,9 +81,18 @@
# | V3, EG4 LL v2 and JK RS485 DISPLAY all work that way. Declare your unit's actual # | 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. # | setting there : it is what this package compares the spread against.
# +--------------------------------------------------------------------------------+ # +--------------------------------------------------------------------------------+
# | Included by default - these BMS need nothing added to your YAML # | Included by default, DISABLED by default - set the var to enable it
# +--------------------------------------------------------------------------------+ # +--------------------------------------------------------------------------------+
# | # |
# | 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 # | EG4 LL V2 bms_combine_EG4_LLV2_RS485_bms_full.yaml
# | bms_modbus_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 # | Seplos V1 V2 bms_combine_SEPLOS_V1_V2_RS485_bms_full.yaml
@@ -95,7 +104,8 @@
# | # |
# | The four real BMS above declared `bms_equalizing` as a hardcoded # | 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 # | `return false;` : they do balance, they just never say so. The Fake BMS used
# | to carry an inline voltage comparison, which this package replaces. # | to carry an inline voltage comparison, which this package replaces. Disabled,
# | the flag reports that constant false again.
# +--------------------------------------------------------------------------------+ # +--------------------------------------------------------------------------------+
# | Adding it to another BMS - once for each bms_id # | Adding it to another BMS - once for each bms_id
# +--------------------------------------------------------------------------------+ # +--------------------------------------------------------------------------------+
@@ -121,7 +131,7 @@
# bms_id: '1' # bms_id: '1'
# # ... other vars of your BMS ... # # ... other vars of your BMS ...
# bms_balance_trigger_voltage: '0.010' # V. Your BMS's balancing threshold # bms_balance_trigger_voltage: '0.010' # V. Your BMS's balancing threshold
# bms_fake_equalizing_enabled: 'true' # Optional : true/fasle, true by default # bms_fake_equalizing_enabled: 'true' # Optional : true/false, false by default
# bms_fake_equalizing_hysteresis: '0.030' # Optional : 0.030 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 # bms_fake_equalizing_delta_hysteresis: '0.002' # Optional : 0.002 by default
# #
@@ -129,7 +139,7 @@
# | balancing threshold, it also feeds 'Auto CVL', and the rest is fine as it is. # | 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. # | Or set them once for every BMS in the root `substitutions:` block.
# | To turn the inference off on one BMS : bms_fake_equalizing_enabled: 'false' # | To turn the inference on for one BMS : bms_fake_equalizing_enabled: 'true'
# +--------------------------------------------------------------------------------+ # +--------------------------------------------------------------------------------+
@@ -141,11 +151,14 @@ substitutions:
# | The spread anchor is `bms_balance_trigger_voltage`, from the BMS itself. # | 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. # | What is left is an on/off switch and the two hysteresis margins.
# +--------------------------------------------------------------------------------+ # +--------------------------------------------------------------------------------+
# 'true' / 'false'. Set to 'false' to turn the inference off for this BMS : the flag # 'true' / 'false'. Off by default : the flag reports the constant false its package
# goes back to the constant false its package used to report. Needed because the # used to hardcode. Set to 'true' to turn the inference on for this BMS. A switch is
# package is included by default for the BMS that cannot report the flag, and a # needed because the package is included by default for the BMS that cannot report
# Remote Packages user cannot edit a package to drop it. # the flag, and a Remote Packages user cannot edit a package to drop it.
bms_fake_equalizing_enabled: 'true' # 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'
# (V) how far below the bulk setpoint the max cell may fall before balancing stops. # (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. # Without it the state toggles on every tick while the max cell sits on the setpoint.
bms_fake_equalizing_hysteresis: '0.030' bms_fake_equalizing_hysteresis: '0.030'
@@ -1,5 +1,5 @@
# Updated : 2026.11.05 # Updated : 2026.11.08
# Version : 1.1.8 # Version : 1.1.9
# GitHub : https://github.com/GHswitt/esphome-yambms # GitHub : https://github.com/GHswitt/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -29,6 +29,7 @@ esphome:
devices: devices:
- id: deye_${deye_id} - id: deye_${deye_id}
name: "${deye_name}" name: "${deye_name}"
relation: via
globals: globals:
- id: deye${deye_id}_send_flag - id: deye${deye_id}_send_flag
@@ -1,5 +1,5 @@
# Updated : 2026.11.05 # Updated : 2026.11.08
# Version : 1.1.8 # Version : 1.1.9
# GitHub : https://github.com/GHswitt/esphome-yambms # GitHub : https://github.com/GHswitt/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -29,6 +29,7 @@ esphome:
devices: devices:
- id: deye_${deye_id} - id: deye_${deye_id}
name: "${deye_name}" name: "${deye_name}"
relation: via
globals: globals:
- id: deye${deye_id}_send_flag - id: deye${deye_id}_send_flag
@@ -1,5 +1,5 @@
# Updated : 2026.08.29 # Updated : 2026.11.19
# Version : 2.0.5 # Version : 2.0.8
# GitHub : https://github.com/RAR/esphome-eg4-bms # GitHub : https://github.com/RAR/esphome-eg4-bms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -25,8 +25,8 @@ packages:
substitutions: substitutions:
# (V) cell spread at which this BMS starts balancing. Not readable over the protocol, # (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 # so declare your unit's actual setting at import. Used by 'Auto CVL' and, when
# bms_options_fake_equalizing.yaml is included, as the spread reference for the # Fake Equalizing is enabled (bms_fake_equalizing_enabled), as the spread reference
# inferred balancing flag. # for the inferred balancing flag.
bms_balance_trigger_voltage: '0.030' bms_balance_trigger_voltage: '0.030'
# +--------------------------------------+ # +--------------------------------------+
@@ -34,7 +34,7 @@ substitutions:
# +--------------------------------------+ # +--------------------------------------+
external_components: external_components:
- source: github://RAR/esphome-eg4-bms@v1.1.0 - source: github://RAR/esphome-eg4-bms@v1.1.4
refresh: 0s refresh: 0s
eg4_bms: eg4_bms:
@@ -1,5 +1,5 @@
# Updated : 2026.07.02 # Updated : 2026.11.11
# Version : 1.3.7 # Version : 1.3.8
# GitHub : https://github.com/txubelaxu/esphome-jk-bms # GitHub : https://github.com/txubelaxu/esphome-jk-bms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -39,9 +39,6 @@ jk_rs485_bms:
switch: switch:
- platform: jk_rs485_bms - platform: jk_rs485_bms
jk_rs485_bms_id: jk_rs485_bms${bms_id} jk_rs485_bms_id: jk_rs485_bms${bms_id}
precharging:
device_id: bms_${bms_id}
name: "precharging"
charging: charging:
id: bms${bms_id}_charge_switch id: bms${bms_id}_charge_switch
device_id: bms_${bms_id} device_id: bms_${bms_id}
@@ -522,12 +519,6 @@ text_sensor:
errors: errors:
device_id: bms_${bms_id} device_id: bms_${bms_id}
name: "errors" 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: total_runtime_formatted:
device_id: bms_${bms_id} device_id: bms_${bms_id}
name: "total runtime formatted" name: "total runtime formatted"
@@ -1,5 +1,5 @@
# Updated : 2026.03.15 # Updated : 2026.11.11
# Version : 1.3.7 # Version : 1.3.8
# GitHub : https://github.com/txubelaxu/esphome-jk-bms # GitHub : https://github.com/txubelaxu/esphome-jk-bms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -39,9 +39,6 @@ jk_rs485_bms:
switch: switch:
- platform: jk_rs485_bms - platform: jk_rs485_bms
jk_rs485_bms_id: jk_rs485_bms${bms_id} jk_rs485_bms_id: jk_rs485_bms${bms_id}
precharging:
device_id: bms_${bms_id}
name: "precharging"
charging: charging:
id: bms${bms_id}_charge_switch id: bms${bms_id}_charge_switch
device_id: bms_${bms_id} device_id: bms_${bms_id}
@@ -402,12 +399,6 @@ text_sensor:
errors: errors:
device_id: bms_${bms_id} device_id: bms_${bms_id}
name: "errors" 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: total_runtime_formatted:
device_id: bms_${bms_id} device_id: bms_${bms_id}
name: "total runtime formatted" name: "total runtime formatted"
@@ -1,5 +1,5 @@
# Updated : 2026.11.1 # Updated : 2026.11.09
# Version : 1.2.3 # Version : 1.2.4
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -170,9 +170,5 @@ display:
- platform: mipi_rgb - platform: mipi_rgb
id: my_display id: my_display
model: ESP32-S3-TOUCH-LCD-4.3 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 update_interval: never
auto_clear_enabled: false auto_clear_enabled: false
@@ -1,5 +1,5 @@
# Updated : 2026.11.1 # Updated : 2026.11.09
# Version : 1.2.3 # Version : 1.2.4
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -146,9 +146,5 @@ display:
- platform: mipi_rgb - platform: mipi_rgb
id: my_display id: my_display
model: ESP32-S3-TOUCH-LCD-4.3 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 update_interval: never
auto_clear_enabled: false auto_clear_enabled: false
@@ -1,5 +1,5 @@
# Updated : 2026.11.1 # Updated : 2026.11.09
# Version : 1.2.3 # Version : 1.2.4
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -171,11 +171,5 @@ display:
- platform: mipi_rgb - platform: mipi_rgb
id: my_display id: my_display
model: ESP32-S3-TOUCH-LCD-7-800X480 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 update_interval: never
auto_clear_enabled: false auto_clear_enabled: false
+3 -2
View File
@@ -1,5 +1,5 @@
# Updated : 2025.12.23 # Updated : 2026.11.08
# Version : 1.1.1 # Version : 1.1.2
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -23,3 +23,4 @@ esphome:
devices: devices:
- id: shunt_${shunt_id} - id: shunt_${shunt_id}
name: "${shunt_name}" name: "${shunt_name}"
relation: via
+21 -3
View File
@@ -1,4 +1,4 @@
# Updated : 2026.06.27 # Updated : 2026.11.10
# Version : 1.7.0 # Version : 1.7.0
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
@@ -69,7 +69,6 @@ binary_sensor:
name: "Can be combined" name: "Can be combined"
id: shunt${shunt_id}_can_be_combined id: shunt${shunt_id}_can_be_combined
device_id: shunt_${shunt_id} device_id: shunt_${shunt_id}
lambda: return (id(shunt${shunt_id}_switch_combine).state && id(shunt${shunt_id}_online_status).state);
text_sensor: text_sensor:
# Show diagnostic state and reason for combine/uncombine # Show diagnostic state and reason for combine/uncombine
@@ -91,8 +90,27 @@ interval:
// Shunt number to combine ? // Shunt number to combine ?
if (id(yambms${yambms_id}_var_to_combine_shunt_number) == ${shunt_id}) 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 ? // The Shunt can be combined ?
if (id(shunt${shunt_id}_can_be_combined).state) if (can_be_combined)
{ {
// +-----------------------------------------------+ // +-----------------------------------------------+
// | Check if all connected BMS are online | // | Check if all connected BMS are online |
@@ -1,6 +1,6 @@
# Updated : 2024.12.23 # Updated : 2026.11.19
# Version : 1.1.1 # Version : 1.1.2
# GitHub : https://github.com/Fabian-Schmidt/esphome-victron_ble # GitHub : https://github.com/darek-margas/esphome-victron_ble
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -1,6 +1,6 @@
# Updated : 2024.12.23 # Updated : 2026.11.19
# Version : 1.1.1 # Version : 1.1.2
# GitHub : https://github.com/Fabian-Schmidt/esphome-victron_ble # GitHub : https://github.com/darek-margas/esphome-victron_ble
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -1,5 +1,5 @@
# Updated : 2026.11.05 # Updated : 2026.11.19
# Version : 1.1.9 # Version : 1.2.0
# GitHub : https://github.com/Sleeper85/esphome-junctek_khf # GitHub : https://github.com/Sleeper85/esphome-junctek_khf
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -30,7 +30,7 @@ packages:
external_components: external_components:
- source: github://Sleeper85/esphome-junctek_khf@main - source: github://Sleeper85/esphome-junctek_khf@main
refresh: 0s refresh: 60min
# - source: # - source:
# type: local # type: local
# path: components # path: components
@@ -1,6 +1,6 @@
# Updated : 2026.02.05 # Updated : 2026.11.19
# Version : 1.1.7 # Version : 1.1.8
# GitHub : https://github.com/Fabian-Schmidt/esphome-victron_ble # GitHub : https://github.com/darek-margas/esphome-victron_ble
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -25,8 +25,8 @@ packages:
# +--------------------------------------+ # +--------------------------------------+
external_components: external_components:
- source: github://Fabian-Schmidt/esphome-victron_ble - source: github://darek-margas/esphome-victron_ble
refresh: 0s refresh: 60min
esp32_ble_tracker: esp32_ble_tracker:
@@ -1,6 +1,6 @@
# Updated : 2026.11.05 # Updated : 2026.11.19
# Version : 1.2.0 # Version : 1.2.1
# GitHub : https://github.com/KinDR007/VictronMPPT-ESPHOME # GitHub : https://github.com/GHswitt/VictronMPPT-ESPHOME
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -31,7 +31,7 @@ packages:
external_components: external_components:
- source: github://GHswitt/VictronMPPT-ESPHOME@main - source: github://GHswitt/VictronMPPT-ESPHOME@main
refresh: 60s refresh: 60min
victron: victron:
- uart_id: ${shunt_uart_id} - uart_id: ${shunt_uart_id}
@@ -1,6 +1,6 @@
# Updated : 2026.11.05 # Updated : 2026.11.19
# Version : 1.1.8 # Version : 1.1.9
# GitHub : https://github.com/KinDR007/VictronMPPT-ESPHOME # GitHub : https://github.com/GHswitt/VictronMPPT-ESPHOME
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -31,7 +31,7 @@ packages:
external_components: external_components:
- source: github://GHswitt/VictronMPPT-ESPHOME@main - source: github://GHswitt/VictronMPPT-ESPHOME@main
refresh: 60s refresh: 60min
victron: victron:
- uart_id: ${shunt_uart_id} - uart_id: ${shunt_uart_id}
+7 -3
View File
@@ -1,5 +1,5 @@
# Updated : 2026.08.11 # Updated : 2026.11.17
# Version : 1.2.0 # Version : 1.2.1
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -140,7 +140,11 @@ interval:
// Reset values // Reset values
float_v = bulk_v; float_v = bulk_v;
time_count = 0; time_count = 0;
id(yambms${yambms_id}_var_auto_float) = 0.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}_auto_float_v).publish_state(float_v); id(yambms${yambms_id}_auto_float_v).publish_state(float_v);
id(yambms${yambms_id}_auto_float_v_delta).publish_state(0.0); id(yambms${yambms_id}_auto_float_v_delta).publish_state(0.0);
return; return;
+12 -2
View File
@@ -1,5 +1,5 @@
# Updated : 2026.06.29 # Updated : 2026.11.14
# Version : 1.1.6 # Version : 1.1.7
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -177,6 +177,16 @@ interval:
return; 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 // Update in 60s intervals only
static uint32_t last_execution_ms = 0; static uint32_t last_execution_ms = 0;
uint32_t current_ms = millis(); uint32_t current_ms = millis();
+44 -40
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.05 # Updated : 2026.11.14
# Version : 2.7.2 # Version : 2.7.5
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -61,6 +61,7 @@ esphome:
devices: devices:
- id: canbus_${canbus_id} - id: canbus_${canbus_id}
name: "${yambms_name} ${canbus_name}" name: "${yambms_name} ${canbus_name}"
relation: via
globals: globals:
- id: canbus${canbus_id}_send_canbus_data - id: canbus${canbus_id}_send_canbus_data
@@ -634,9 +635,11 @@ interval:
if (errors_bitmask_alarm & 0x0010) can_mesg[0] |= 0x10; // Under Temp Protection 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 & 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 & 0x0080) can_mesg[0] |= 0x80; // Discharge Over Current Protection
if (errors_bitmask_alarm & 0x0100) can_mesg[1] |= 0x80; // Charge Over Current Protection if (errors_bitmask_alarm & 0x0100) can_mesg[1] |= 0x01; // Charge Over Current Protection
if (errors_bitmask_alarm & 0x0800) can_mesg[1] |= 0x08; // BMS Internal Error if (errors_bitmask_alarm & 0x0800) can_mesg[1] |= 0x08; // BMS Internal Error
if (errors_bitmask_alarm & 0x1000) can_mesg[1] |= 0x10; // UnBalanced Cell // 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).
} }
// +---------------------------+ // +---------------------------+
@@ -653,9 +656,10 @@ interval:
if (errors_bitmask_warning & 0x0010) can_mesg[2] |= 0x10; // Under Temp Protection 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 & 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 & 0x0080) can_mesg[2] |= 0x80; // Discharge Over Current Protection
if (errors_bitmask_warning & 0x0100) can_mesg[3] |= 0x80; // Charge Over Current Protection if (errors_bitmask_warning & 0x0100) can_mesg[3] |= 0x01; // Charge Over Current Protection
if (errors_bitmask_warning & 0x0800) can_mesg[3] |= 0x08; // BMS Internal Error if (errors_bitmask_warning & 0x0800) can_mesg[3] |= 0x08; // BMS Internal Error
if (errors_bitmask_warning & 0x1000) can_mesg[3] |= 0x10; // UnBalanced Cell // 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).
} }
// +---------------------------+ // +---------------------------+
@@ -730,49 +734,49 @@ interval:
uint16_t errors_bitmask_alarm = id(yambms${yambms_id}_errors_bitmask_alarm).state; 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; 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 | // | Alarm : byte 0 to 3 |
// +---------------------------+ // +---------------------------+
// YamBMS alarm ? can_mesg[0] = field(errors_bitmask_alarm, 0x0001) // General alarm
if (errors_bitmask_alarm > 0) | field(errors_bitmask_alarm, 0x0002) << 2 // Battery high voltage alarm
{ | field(errors_bitmask_alarm, 0x0004) << 4 // Battery low voltage alarm
if (errors_bitmask_alarm & 0x0001) can_mesg[0] |= 0x0001; // General alarm | field(errors_bitmask_alarm, 0x0008) << 6; // Battery high temperature alarm
if (errors_bitmask_alarm & 0x0002) can_mesg[0] |= 0x0004; // Battery high voltage alarm can_mesg[1] = field(errors_bitmask_alarm, 0x0010) // Battery low temperature alarm
if (errors_bitmask_alarm & 0x0004) can_mesg[0] |= 0x0010; // Battery low voltage alarm | field(errors_bitmask_alarm, 0x0020) << 2 // Battery high temperature charge alarm
if (errors_bitmask_alarm & 0x0008) can_mesg[0] |= 0x0040; // Battery high temperature alarm | field(errors_bitmask_alarm, 0x0040) << 4 // Battery low temperature charge alarm
if (errors_bitmask_alarm & 0x0010) can_mesg[1] |= 0x0001; // Battery low temperature alarm | field(errors_bitmask_alarm, 0x0080) << 6; // Battery high discharge current alarm
if (errors_bitmask_alarm & 0x0020) can_mesg[1] |= 0x0004; // Battery high temperature charge alarm can_mesg[2] = field(errors_bitmask_alarm, 0x0100) // Battery high charge current alarm
if (errors_bitmask_alarm & 0x0040) can_mesg[1] |= 0x0010; // Battery low temperature charge alarm | field(errors_bitmask_alarm, 0x0200) << 2 // Contactor alarm
if (errors_bitmask_alarm & 0x0080) can_mesg[1] |= 0x0040; // Battery high discharge current alarm | field(errors_bitmask_alarm, 0x0400) << 4 // Short circuit alarm
if (errors_bitmask_alarm & 0x0100) can_mesg[2] |= 0x0001; // Battery high charge current alarm | field(errors_bitmask_alarm, 0x0800) << 6; // BMS internal alarm
if (errors_bitmask_alarm & 0x0200) can_mesg[2] |= 0x0004; // Contactor alarm can_mesg[3] = field(errors_bitmask_alarm, 0x1000); // Cell imbalance alarm, bits 2-7 reserved
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 | // | Warning : byte 4 to 7 |
// +---------------------------+ // +---------------------------+
// YamBMS warning ? can_mesg[4] = field(errors_bitmask_warning, 0x0001) // General warning
if (errors_bitmask_warning > 0) | field(errors_bitmask_warning, 0x0002) << 2 // Battery high voltage warning
{ | field(errors_bitmask_warning, 0x0004) << 4 // Battery low voltage warning
if (errors_bitmask_warning & 0x0001) can_mesg[4] |= 0x0001; // General warning | field(errors_bitmask_warning, 0x0008) << 6; // Battery high temperature warning
if (errors_bitmask_warning & 0x0002) can_mesg[4] |= 0x0004; // Battery high voltage warning can_mesg[5] = field(errors_bitmask_warning, 0x0010) // Battery low temperature warning
if (errors_bitmask_warning & 0x0004) can_mesg[4] |= 0x0010; // Battery low voltage warning | field(errors_bitmask_warning, 0x0020) << 2 // Battery high temperature charge warning
if (errors_bitmask_warning & 0x0008) can_mesg[4] |= 0x0040; // Battery high temperature warning | field(errors_bitmask_warning, 0x0040) << 4 // Battery low temperature charge warning
if (errors_bitmask_warning & 0x0010) can_mesg[5] |= 0x0001; // Battery low temperature warning | field(errors_bitmask_warning, 0x0080) << 6; // Battery high discharge current warning
if (errors_bitmask_warning & 0x0020) can_mesg[5] |= 0x0004; // Battery high temperature charge warning can_mesg[6] = field(errors_bitmask_warning, 0x0100) // Battery high charge current warning
if (errors_bitmask_warning & 0x0040) can_mesg[5] |= 0x0010; // Battery low temperature charge warning | field(errors_bitmask_warning, 0x0200) << 2 // Contactor warning
if (errors_bitmask_warning & 0x0080) can_mesg[5] |= 0x0040; // Battery high discharge current warning | field(errors_bitmask_warning, 0x0400) << 4 // Short circuit warning
if (errors_bitmask_warning & 0x0100) can_mesg[6] |= 0x0001; // Battery high charge current warning | field(errors_bitmask_warning, 0x0800) << 6; // BMS internal warning
if (errors_bitmask_warning & 0x0200) can_mesg[6] |= 0x0004; // Contactor warning can_mesg[7] = field(errors_bitmask_warning, 0x1000); // Cell imbalance warning, bits 2-7 reserved
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]); 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]}; 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]};
+225 -169
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.08 # Updated : 2026.11.17
# Version : 1.8.1 # Version : 1.8.2
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # 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>. # along with this program. If not, see <http://www.gnu.org/licenses/gpl.html>.
substitutions: substitutions:
yambms_version: "1.8.1" yambms_version: "1.8.2"
# YamBMS services # YamBMS services
yambms_update_service: 'true' # Set to false to disable update checks 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 yambms_telemetry_service: 'true' # Set to false to disable the sending of telemetry data
@@ -243,6 +243,11 @@ globals:
type: std::string type: std::string
restore_value: no restore_value: no
initial_value: '"Init"' 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 # 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 # 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. # link, so an unresolved link writes "None" and never an empty string.
@@ -362,6 +367,7 @@ esphome:
devices: devices:
- id: yambms_yambms${yambms_id} - id: yambms_yambms${yambms_id}
name: "${yambms_name}" name: "${yambms_name}"
relation: via
# Execute once # Execute once
on_boot: on_boot:
@@ -524,11 +530,12 @@ interval:
// +-----------------------------------------------+ // +-----------------------------------------------+
// Alarm // Alarm
// Alarm - all BMS are in alarm ? // Alarm - all combined BMS are in alarm ?
if (id(yambms${yambms_id}_var_errors_bitmask_counter) == id(yambms${yambms_id}_var_bms_counter)) // 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))
id(yambms${yambms_id}_errors_bitmask_alarm).publish_state(id(yambms${yambms_id}_var_errors_bitmask)); id(yambms${yambms_id}_errors_bitmask_alarm).publish_state(id(yambms${yambms_id}_var_errors_bitmask));
// At least one BMS is not in alarm // At least one combined BMS is not in alarm
else id(yambms${yambms_id}_errors_bitmask_alarm).publish_state(0); else id(yambms${yambms_id}_errors_bitmask_alarm).publish_state(0);
// Warning // Warning
@@ -850,22 +857,27 @@ interval:
// +-----------------------------------------------+ // +-----------------------------------------------+
// | STEP 3 - YamBMS Logic | // | STEP 3 - YamBMS Logic |
// +-----------------------------------------------+ // +-----------------------------------------------+
if ((id(yambms${yambms_id}_bms_combined).has_state()) && // Entered only while at least one BMS is combined and every value read below
(id(yambms${yambms_id}_total_voltage).has_state()) && // is real. A sensor keeps has_state() after a NaN is published, so the
(id(yambms${yambms_id}_current).has_state()) && // sensors are tested with isnan() or a comparison, as in can_be_combined.
(id(yambms${yambms_id}_power).has_state()) && // The live counter is used rather than bms_combined, which STEP 2 only
(id(yambms${yambms_id}_battery_soc).has_state()) && // publishes once per round.
(id(yambms${yambms_id}_battery_soh).has_state()) && if ((id(yambms${yambms_id}_var_to_combine_bms_counter) > 0) &&
(id(yambms${yambms_id}_battery_capacity).has_state()) && (id(yambms${yambms_id}_total_voltage).state > 0) &&
(id(yambms${yambms_id}_equalizing).has_state()) && (!std::isnan(id(yambms${yambms_id}_current).state)) &&
(id(yambms${yambms_id}_max_cell_voltage).has_state()) && (!std::isnan(id(yambms${yambms_id}_power).state)) &&
(id(yambms${yambms_id}_max_charge_current).has_state()) && (!std::isnan(id(yambms${yambms_id}_battery_soc).state)) &&
(id(yambms${yambms_id}_max_discharge_current).has_state()) && (!std::isnan(id(yambms${yambms_id}_battery_soh).state)) &&
(id(yambms${yambms_id}_cell_ovp).has_state()) && (id(yambms${yambms_id}_battery_capacity).state > 0) &&
(id(yambms${yambms_id}_cell_uvp).has_state()) && (id(yambms${yambms_id}_equalizing).has_state()) && // binary_sensor
(id(yambms${yambms_id}_cell_count).has_state()) && (!std::isnan(id(yambms${yambms_id}_max_cell_voltage).state)) &&
(id(yambms${yambms_id}_charging_allowed).has_state()) && (id(yambms${yambms_id}_max_charge_current).state >= 0) &&
(id(yambms${yambms_id}_discharging_allowed).has_state())) (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
{ {
ESP_LOGD("yambms_debug", "===> STEP 3 : Entering YamBMS logic... <==="); ESP_LOGD("yambms_debug", "===> STEP 3 : Entering YamBMS logic... <===");
@@ -920,6 +932,17 @@ 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 | // | Force Bulk Logic |
// +-----------------------------------------------+ // +-----------------------------------------------+
@@ -1052,8 +1075,7 @@ interval:
{ {
ESP_LOGD("yambms_debug", "Entering the Bulk phase..."); ESP_LOGD("yambms_debug", "Entering the Bulk phase...");
// Stop timer // Stop timer
if (id(yambms${yambms_id}_script_eoc_timer).is_running()) id(yambms${yambms_id}_script_eoc_timer).stop(); id(yambms${yambms_id}_script_stop_timers).execute();
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 // Balancing : the BMS is equalizing the cells
if (id(yambms${yambms_id}_equalizing).state) id(yambms${yambms_id}_var_charge_status) = "Balancing"; if (id(yambms${yambms_id}_equalizing).state) id(yambms${yambms_id}_var_charge_status) = "Balancing";
// Bulk // Bulk
@@ -1094,14 +1116,27 @@ interval:
} }
} }
// Charging not allowed (BMS or YamBMS) // 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) else if (id(yambms${yambms_id}_var_bms_charging_logic) == true)
{ {
ESP_LOGD("yambms_debug", "Charging not allowed !"); ESP_LOGD("yambms_debug", "Charging not allowed !");
if (!id(yambms${yambms_id}_switch_charging).state) id(yambms${yambms_id}_var_charge_status) = "Wait"; 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";
}
} }
else else
{ {
ESP_LOGD("yambms_debug", "Charging not allowed !"); 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"; id(yambms${yambms_id}_var_charge_status) = "Wait";
} }
@@ -1155,142 +1190,146 @@ interval:
// leaves the counter at 0. Clamp to 1 to prevent division by 0. // 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)); const int comm_interfaces_count = std::max(1, id(yambms${yambms_id}_var_comm_interfaces_count));
// At least one BMS combined // +-----------------------------------------------+
if (id(yambms${yambms_id}_var_to_combine_bms_counter) > 0) // | 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)
{ {
// +-----------------------------------------------+ const float soc = id(yambms${yambms_id}_battery_soc).state;
// | Requested Charge Voltage (CVL) | 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;
// Bulk // Between Start and Stop SoC (or NaN SoC): keep the current state (hysteresis)
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 += 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 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
// 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
else 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)
{ {
// Publishing sensors to NAN ESP_LOGD("yambms_debug", "Entering Requested CCL...");
id(yambms${yambms_id}_requested_charge_voltage).publish_state(NAN); ESP_LOGD("yambms_debug", "Charging instruction : %s", charging_instruction.c_str());
id(yambms${yambms_id}_requested_discharge_voltage).publish_state(NAN);
id(yambms${yambms_id}_requested_charge_current).publish_state(NAN); // Charging Not Allowed
id(yambms${yambms_id}_requested_discharge_current).publish_state(NAN); 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;
} }
// +-----------------------------------------------+ // +-----------------------------------------------+
// | End Of STEP 3 : YamBMS initialized ? | // | End Of STEP 3 : YamBMS initialized ? |
// | The datas can be communicated to the inverter | // | The datas can be communicated to the inverter |
// +-----------------------------------------------+ // +-----------------------------------------------+
if ((id(yambms${yambms_id}_bms_combined).state > 0) && if ((id(yambms${yambms_id}_var_charge_status) != "Init") &&
(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}_min_temperature).state < 100) &&
(id(yambms${yambms_id}_max_temperature).state > -100) && (id(yambms${yambms_id}_max_temperature).state > -100) &&
(id(yambms${yambms_id}_requested_charge_voltage).state > 0) && (id(yambms${yambms_id}_requested_charge_voltage).state > 0) &&
@@ -1302,6 +1341,23 @@ interval:
} }
else id(yambms${yambms_id}_var_initialized) = false; // Communication with the inverter stops. 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 | // | DEBUG LOGS |
@@ -1346,12 +1402,17 @@ script:
then: then:
- delay: ${yambms_cutoff_timer}s - delay: ${yambms_cutoff_timer}s
- script.execute: yambms${yambms_id}_script_eoc - 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 - id: yambms${yambms_id}_script_eoc
then: then:
- lambda: |- - lambda: |-
// Stop timer // Stop timer
if (id(yambms${yambms_id}_script_eoc_timer).is_running()) id(yambms${yambms_id}_script_eoc_timer).stop(); id(yambms${yambms_id}_script_stop_timers).execute();
if (id(yambms${yambms_id}_script_cutoff_timer).is_running()) id(yambms${yambms_id}_script_cutoff_timer).stop();
// EOC script // EOC script
if (id(yambms${yambms_id}_switch_float).state) id(yambms${yambms_id}_var_charge_status) = "Float"; 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"; else id(yambms${yambms_id}_var_charge_status) = "EOC";
@@ -1430,6 +1491,11 @@ switch:
restore_mode: RESTORE_DEFAULT_OFF restore_mode: RESTORE_DEFAULT_OFF
optimistic: true optimistic: true
entity_category: config 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 | # | binary_sensor |
@@ -1478,16 +1544,6 @@ binary_sensor:
device_id: yambms_yambms${yambms_id} device_id: yambms_yambms${yambms_id}
icon: mdi:battery-charging-low icon: mdi:battery-charging-low
trigger_on_initial_state: true 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 | # | number |
@@ -2081,7 +2137,7 @@ sensor:
const float delta = 1.0f; const float delta = 1.0f;
${rate_limit_filter} ${rate_limit_filter}
# Alarm - errors_bitmask bitwise AND (16bit) # Alarm - errors_bitmask bitwise OR, published only when all combined BMS are in alarm (16bit)
- platform: template - platform: template
id: yambms${yambms_id}_errors_bitmask_alarm id: yambms${yambms_id}_errors_bitmask_alarm
device_id: yambms_yambms${yambms_id} device_id: yambms_yambms${yambms_id}
@@ -2427,13 +2483,13 @@ text_sensor:
entity_category: diagnostic entity_category: diagnostic
icon: mdi:battery-alert icon: mdi:battery-alert
lambda: |- lambda: |-
// Error Bitmask ? // Shows what is sent to the inverter : alarm bits if all combined BMS are in alarm,
// otherwise Warning if at least one is.
uint16_t errors_bitmask = id(yambms${yambms_id}_errors_bitmask_alarm).state; 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 // At least one BMS in alarm
if ((eb_counter > 0) && (eb_counter < id(yambms${yambms_id}_var_bms_counter))) return {"Warning"}; if ((errors_bitmask == 0) && (id(yambms${yambms_id}_errors_bitmask_warning).state > 0)) return {"Warning"};
// All BMS are in alarm // All combined BMS are in alarm
else if (errors_bitmask > 0) else if (errors_bitmask > 0)
{ {
if ((errors_bitmask & 0x0002)) return {"OVP"}; // Over Voltage Protection if ((errors_bitmask & 0x0002)) return {"OVP"}; // Over Voltage Protection
+3 -2
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.05 # Updated : 2026.11.08
# Version : 1.1.2 # Version : 1.1.3
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -75,6 +75,7 @@ esphome:
devices: devices:
- id: rs485_${rs485_id} - id: rs485_${rs485_id}
name: "${yambms_name} ${rs485_name}" name: "${yambms_name} ${rs485_name}"
relation: via
globals: globals:
# Protocol actually applied on this link, resolved from the `Protocol` select # Protocol actually applied on this link, resolved from the `Protocol` select
+8 -3
View File
@@ -1,5 +1,5 @@
# Updated : 2026.11.05 # Updated : 2026.11.11
# Version : 1.1.1 # Version : 1.1.2
# GitHub : https://github.com/Sleeper85/esphome-yambms # GitHub : https://github.com/Sleeper85/esphome-yambms
# YamBMS ( Yet another multi-BMS Merging Solution ) # YamBMS ( Yet another multi-BMS Merging Solution )
@@ -81,6 +81,11 @@ interval:
then: then:
- lambda: |- - lambda: |-
bool active = id(rs485${rs485_id}_active_protocol) == ${YB_PROTO_RS485_VOLTRONIC_LIB}; 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 // 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. // it once per transition, so a CAN link on the same node keeps owning it.
@@ -90,7 +95,7 @@ interval:
id(inverter_com_status).publish_state(false); id(inverter_com_status).publish_state(false);
} }
id(rs485${rs485_id}_modbus_server).set_address(active ? 1 : 248); id(rs485${rs485_id}_modbus_server).set_address(serve ? 1 : 248);
modbus: modbus:
- uart_id: ${rs485_uart_id} - uart_id: ${rs485_uart_id}