From a7e190b8e13a23b282334301d34c902608974bd7 Mon Sep 17 00:00:00 2001 From: Andrew Rankin Date: Mon, 16 Nov 2026 14:50:55 -0500 Subject: [PATCH] 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) --- documents/README/changelog/Changelog.md | 2 ++ packages/bms/bms_combine_EG4_RS485_modbus.yaml | 6 +++--- .../bms_errors_bitmask_EG4_LLV2_RS485_Modbus.yaml | 15 ++++++++++----- .../bms/bms_sensors_EG4_LLV2_RS485_bms_full.yaml | 6 +++--- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/documents/README/changelog/Changelog.md b/documents/README/changelog/Changelog.md index 61b2da6..aa46338 100644 --- a/documents/README/changelog/Changelog.md +++ b/documents/README/changelog/Changelog.md @@ -9,6 +9,8 @@ * 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 : diff --git a/packages/bms/bms_combine_EG4_RS485_modbus.yaml b/packages/bms/bms_combine_EG4_RS485_modbus.yaml index 4d81230..c72a078 100644 --- a/packages/bms/bms_combine_EG4_RS485_modbus.yaml +++ b/packages/bms/bms_combine_EG4_RS485_modbus.yaml @@ -1,5 +1,5 @@ -# Updated : 2026.11.09 -# Version : 2.0.4 +# Updated : 2026.11.15 +# Version : 2.0.5 # GitHub : https://github.com/RAR/esphome-eg4-bms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -22,7 +22,7 @@ substitutions: eg4_modbus_id: modbus_eg4 external_components: - - source: github://RAR/esphome-eg4-bms@v1.1.1 + - source: github://RAR/esphome-eg4-bms@v1.1.4 refresh: 0s packages: diff --git a/packages/bms/bms_errors_bitmask_EG4_LLV2_RS485_Modbus.yaml b/packages/bms/bms_errors_bitmask_EG4_LLV2_RS485_Modbus.yaml index da53d85..dc5b905 100644 --- a/packages/bms/bms_errors_bitmask_EG4_LLV2_RS485_Modbus.yaml +++ b/packages/bms/bms_errors_bitmask_EG4_LLV2_RS485_Modbus.yaml @@ -1,5 +1,5 @@ -# Updated : 2025.12.22 -# Version : 2.0.1 +# Updated : 2026.11.10 +# Version : 2.0.2 # GitHub : https://github.com/RAR/esphome-eg4-bms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -43,6 +43,7 @@ # Bit 10 Charge Under Temp 0000 0100 0000 0000 0x0400 # Bit 11 Discharge Under Temp 0000 1000 0000 0000 0x0800 # Bit 12 Low Capacity 0001 0000 0000 0000 0x1000 + # (held while a full pack has stopped charging, so it is not mapped to an alarm) # Bit 13 Discharge SC 0010 0000 0000 0000 0x2000 # +--------------------------------------+ @@ -79,8 +80,11 @@ sensor: - throttle: 10s - delta: 1 lambda: |- - uint32_t bms_errors_bitmask = id(bms${bms_id}_errors_bitmask).state; - uint32_t bms_protection_bitmask = id(bms${bms_id}_protection_bitmask).state; + // The component publishes NaN for a register block that has gone stale (no bits) + float bms_errors = id(bms${bms_id}_errors_bitmask).state; + float bms_protection = id(bms${bms_id}_protection_bitmask).state; + uint32_t bms_errors_bitmask = std::isnan(bms_errors) ? 0 : (uint32_t) bms_errors; + uint32_t bms_protection_bitmask = std::isnan(bms_protection) ? 0 : (uint32_t) bms_protection; uint16_t yambms_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 & 0x0020) yambms_errors_bitmask |= 0x0080; if (bms_protection_bitmask & 0x0100) yambms_errors_bitmask |= 0x0020; + if (bms_protection_bitmask & 0x0200) yambms_errors_bitmask |= 0x0008; if (bms_protection_bitmask & 0x0400) yambms_errors_bitmask |= 0x0040; + if (bms_protection_bitmask & 0x0800) yambms_errors_bitmask |= 0x0010; if (bms_protection_bitmask & 0x2000) yambms_errors_bitmask |= 0x0400; if (bms_protection_bitmask & 0x0040) yambms_errors_bitmask |= 0x0001; if (bms_protection_bitmask & 0x0080) yambms_errors_bitmask |= 0x0001; - if (bms_protection_bitmask & 0x1000) yambms_errors_bitmask |= 0x0001; } return yambms_errors_bitmask; diff --git a/packages/bms/bms_sensors_EG4_LLV2_RS485_bms_full.yaml b/packages/bms/bms_sensors_EG4_LLV2_RS485_bms_full.yaml index 7b8a0c8..aefdd46 100644 --- a/packages/bms/bms_sensors_EG4_LLV2_RS485_bms_full.yaml +++ b/packages/bms/bms_sensors_EG4_LLV2_RS485_bms_full.yaml @@ -1,5 +1,5 @@ -# Updated : 2026.11.09 -# Version : 2.0.6 +# Updated : 2026.11.15 +# Version : 2.0.7 # GitHub : https://github.com/RAR/esphome-eg4-bms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -34,7 +34,7 @@ substitutions: # +--------------------------------------+ external_components: - - source: github://RAR/esphome-eg4-bms@v1.1.1 + - source: github://RAR/esphome-eg4-bms@v1.1.4 refresh: 0s eg4_bms: