From 6085e6ff247831fe138a81a304e95d4bc9bcee99 Mon Sep 17 00:00:00 2001 From: Sleeper85 Date: Sat, 14 Nov 2026 19:43:02 +0100 Subject: [PATCH] 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. --- documents/README/changelog/Changelog.md | 1 + documents/README/dev/Design_decisions.md | 6 ++++++ packages/yambms/yambms_canbus.yaml | 15 +++++++++------ 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/documents/README/changelog/Changelog.md b/documents/README/changelog/Changelog.md index 9fbd997..541e211 100644 --- a/documents/README/changelog/Changelog.md +++ b/documents/README/changelog/Changelog.md @@ -21,6 +21,7 @@ * 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 * YamBMS 1.8.1 : * Set esphome `min_version` to `2026.10.0` diff --git a/documents/README/dev/Design_decisions.md b/documents/README/dev/Design_decisions.md index 8c3526e..758895f 100644 --- a/documents/README/dev/Design_decisions.md +++ b/documents/README/dev/Design_decisions.md @@ -157,6 +157,12 @@ because they share a CAN ID — that would break both protocols at once. Byte order is not uniform either: `0x373` sends min cell voltage before max, `0x361` sends max before min. Both match their respective specifications. Do not "harmonise" them. +### `0x359` does not carry cell imbalance + +PYLON V2 uses byte 1 bit 4 of `0x359` for a communication timeout that stops charge and +discharge, and byte 3 bit 4 is reserved. Cell imbalance used to be sent on both, so an imbalance +alarm could stop the inverter. It is only sent on `0x35A` now. Do not put it back in `0x359`. + ## Frame sequencing **File:** `packages/yambms/yambms_canbus.yaml` diff --git a/packages/yambms/yambms_canbus.yaml b/packages/yambms/yambms_canbus.yaml index 171f841..3836cc9 100644 --- a/packages/yambms/yambms_canbus.yaml +++ b/packages/yambms/yambms_canbus.yaml @@ -1,5 +1,5 @@ -# Updated : 2026.11.08 -# Version : 2.7.3 +# Updated : 2026.11.14 +# Version : 2.7.4 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -635,9 +635,11 @@ interval: if (errors_bitmask_alarm & 0x0010) can_mesg[0] |= 0x10; // Under Temp Protection if (errors_bitmask_alarm & 0x0040) can_mesg[0] |= 0x10; // Charge Under Temp Protection if (errors_bitmask_alarm & 0x0080) can_mesg[0] |= 0x80; // Discharge Over Current Protection - if (errors_bitmask_alarm & 0x0100) can_mesg[1] |= 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 & 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). } // +---------------------------+ @@ -654,9 +656,10 @@ interval: if (errors_bitmask_warning & 0x0010) can_mesg[2] |= 0x10; // Under Temp Protection if (errors_bitmask_warning & 0x0040) can_mesg[2] |= 0x10; // Charge Under Temp Protection if (errors_bitmask_warning & 0x0080) can_mesg[2] |= 0x80; // Discharge Over Current Protection - if (errors_bitmask_warning & 0x0100) can_mesg[3] |= 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 & 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). } // +---------------------------+