Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SoC calculation for a Supervolt battery group is not correct #155

Closed
Karatzie opened this issue Oct 30, 2023 · 6 comments
Closed

SoC calculation for a Supervolt battery group is not correct #155

Karatzie opened this issue Oct 30, 2023 · 6 comments

Comments

@Karatzie
Copy link

Describe the issue here.
I have add a battery group with my both Supervolt batteries.
Battery 1 has a SoC of 77.1 %
Battery 2 has a SoC of 99.8 %

The SoC of the battery group has a value of 44.23%

The sum of SoC of battery 1 and battery 2 is 77.1% + 99.8% = 176.9%.
This sum should be divided by two. 176.9%/2=88.45%.
In Batmon, the sum is divided by four. 176.9%/4=44.225%.

  • Include exact BMS model name
    Supervolt
  • Query HW and SW numbers from the BMS app
  • Enable verbose_log
Paste log output between BEGIN and END:
BEGIN 
![grafik](https://github.com/fl4p/batmon-ha/assets/98681564/7c62d7a4-7157-43e6-b4f6-91bf2dd7f092)

END
@Karatzie
Copy link
Author

The link of my screenshot does not work.

Here is the log but I am charging the batteries at this moment. The values are not the same as you see in post one.
20:10:31 INFO [sampling] battery_mica: BmsSampl(**49.7%,**U=13.6V,I=12.01A,P=163W,Q=198.9Ah/200,mos=15.0°C)
....
20:10:46 INFO [sampling] batt1: BmsSampl(**98.9%,**U=13.6V,I=7.68A,P=104W,Q=98.9Ah/100,mos=15.0°C)
.....
20:10:56 INFO [sampling] batt2: BmsSampl(100.0%,U=13.6V,I=4.30A,P=58W,Q=100.0Ah/100,mos=14.0°C)

@fl4p
Copy link
Owner

fl4p commented Oct 31, 2023

I can reproduce this. The bug is in

soc=statistics.mean(s.soc * s.capacity for s in samples) / sum(s.capacity for s in samples),

statistics.mean need to be replaced with sum, to correctly compute the weighted sum of SoCs

@fabiomato
Copy link

I23:01:40 INFO [sampling] JK2: BmsSampl(39.4%,U=24.4V,I=-0.18A,P=-5W,Q=118.1Ah/300,mos=0.0°C)
23:01:40 INFO [sampling] JK2 volt=[3487,3486,3487,3487,3487,3487,3487] temp=[13.2, 13.7]
23:01:40 INFO [sampling] JK1: BmsSampl(38.8%,U=24.5V,I=-0.36A,P=-9W,Q=155.2Ah/400,mos=0.0°C)
23:01:40 INFO [sampling] JK1 volt=[3504,3504,3505,3504,3504,3505,3505] temp=[14.1, 14.3]
23:02:10 INFO [sampling] BATTERIA: BmsSampl(19.5%,U=24.5V,I=-0.55A,P=-13W,Q=273.2Ah/700,mos=0.0°C)

i have the same problem.


@fl4p
Copy link
Owner

fl4p commented Nov 10, 2023

ive pushed 1.73, which should fix this

@fl4p
Copy link
Owner

fl4p commented Nov 11, 2023

please re-open if needed

@fl4p fl4p closed this as completed Nov 11, 2023
@Karatzie
Copy link
Author

The issue is solved.

Thanks a lot.

BR

Karatzie

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants