Closed OutOfSync1 closed 1 year ago
@idstein maybe you can take a look at this?
Currently, I’m very busy, but the cycle capacity can be read via the factory mode at the beginning as we read the max current.
There is no rush. If you have some spare time in the next weeks :-)
This should be resolved by the open PR.
The PR was merged.
Describe the bug
The new SOC calculation leads to different SOC values shown in the Xiaoxiang app (via bluetooth on iOS) and in dbus-serialbattery. https://github.com/Louisvdw/dbus-serialbattery/blob/86a6b956e15bee21d5a298283c9d121f0eb82a02/etc/dbus-serialbattery/bms/lltjbd.py#L405 I think the issue here is that two values can be set for the capacity in the BMS: "total battery capacity" (in my case 280 Ah) and "total cycle capacity" (in my case 260 Ah). The JBD-BMS uses the cycle capacity as 100% SOC value, e.g. when 260 Ah is the remaining capacity and 260 Ah is set as "total cycle capacity" then the SOC is 100%. The calculation in serialbattery however uses the total capacity value as 100% SOC value, in this case 280 Ah. As a result the calculation in the example is 260 Ah/280 Ah which leads to 92.7% SOC. In this case 100% is never reached. This can lead to multiple problems, e.g. charge current is not reduced although battery is already full etc.
Unfortunately the serial data read via command_general only includes "total battery capacity" and not "total cycle capacity". A workaround may be to set both total and cycle capacity to the same value in the BMS.
I suggest to revert this change and use the soc reported by the BMS although it is an integer value. Otherwise provide a recommendation to set cycle and total capacity to the same value.
How to reproduce
Steps to reproduce the behavior:
Expected behavior
SOC reported via BMS and calculated in serial-battery should be the same
Driver version
1.0.20230531
Venus OS device type
Raspberry Pi
Venus OS version
3.00
BMS type
Smart BMS (LLT, JBD, Overkill Solar)
Cell count
16
Connection type
Serial USB adapter to RS485
Config file
Relevant log output
Any other information that may be helpful
No response