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

Temperatures are a bit weird #1

Open
Zuikkis opened this issue Nov 27, 2023 · 5 comments
Open

Temperatures are a bit weird #1

Zuikkis opened this issue Nov 27, 2023 · 5 comments

Comments

@Zuikkis
Copy link

Zuikkis commented Nov 27, 2023

Hi!

I have been using this to get BMS data from my home energy storage. It works very nice. Only thing bothering me is the temperature readings. I log them to Domoticz home automation. The graphs always look like this:

kuva

To me it looks like the decimal part is somehow inverted. At 16:00, temperature is 5.9C. Then it steadily rises until 18.45 when it drops suddenly from 6.9C to 4.9C. Same goes on and on.

This is not a very big bug, I think 1 degree accuracy is enough.

@KrystianD
Copy link
Owner

Hi, to me it looks like BMS is sending different data type than expected, different byte order or something.

Please play with this line https://github.com/KrystianD/smart_bms/blob/master/smart_bms/SmartBMSClient.py#L83

You can also remove all conversions, like: [(read_from_stream(s, "H") for _ in range(num_temp)] and send here results so I can take a look.

@Zuikkis
Copy link
Author

Zuikkis commented Nov 28, 2023

I'll try, thanks. :)

Could be also a bug in BMS firmware..

Different byte order probably would make much bigger errors. Now I think the measurement is correct at +-1C accuracy..

@KrystianD
Copy link
Owner

KrystianD commented Nov 28, 2023

It was implemented from the doc below.

image

Maybe your BMS sends data in slightly different format, this sharp pattern in your chart with clearly visible steady area usually means some issues with bit/byte order/usage. Something may be shifted, it may be sent as a short float, etc.

image

It would be best if you send raw data that you receive, together with the actual temperature that should be measured (more-less).

@Zuikkis
Copy link
Author

Zuikkis commented Nov 28, 2023

I am quite confident that the integer part of temperature is pretty much correct. Here's the graph for entire year:

image

It looks quite correct, over 20C at summer and about 5C during winter. I have heating on the room at winter time keeping it at >5C..

I have currently a log running with raw values. I'll let it run over night to get a bigger sample.

@Zuikkis
Copy link
Author

Zuikkis commented Nov 29, 2023

https://pastebin.com/w4UpVPAY

Ok here's some log. It's sampled at one minute intervals, 1442 lines.

I think temp3 is the MOSFET temp, it seems to jump a bit based on power (which makes sense). But other sensors are just pack temperature sensors which shouldn't change too quickly.

I'm pretty sure we have to give up on this. It makes no sense. The "jumps" don't happen at same point all the time.

Here we see temp0 jump from 4.7 to 6.7..

temp0:  0xada 2778 4.7   temp1:  0xae0 2784 5.3   temp2:  0xad9 2777 4.6   temp3:  0xaed 2797 6.6
temp0:  0xada 2778 4.7   temp1:  0xadf 2783 5.2   temp2:  0xad9 2777 4.6   temp3:  0xaec 2796 6.5
temp0:  0xaee 2798 6.7   temp1:  0xadf 2783 5.2   temp2:  0xad9 2777 4.6   temp3:  0xaec 2796 6.5
temp0:  0xaee 2798 6.7   temp1:  0xadf 2783 5.2   temp2:  0xad9 2777 4.6   temp3:  0xaed 2797 6.6

But here, temp2 jumps from 4.4 to 6.4:

temp0:  0xaec 2796 6.5   temp1:  0xade 2782 5.1   temp2:  0xad7 2775 4.4   temp3:  0xaec 2796 6.5
temp0:  0xaec 2796 6.5   temp1:  0xade 2782 5.1   temp2:  0xad7 2775 4.4   temp3:  0xaec 2796 6.5
temp0:  0xaec 2796 6.5   temp1:  0xade 2782 5.1   temp2:  0xaeb 2795 6.4   temp3:  0xaeb 2795 6.4
temp0:  0xaec 2796 6.5   temp1:  0xade 2782 5.1   temp2:  0xaeb 2795 6.4   temp3:  0xaeb 2795 6.4

The jump seems to be always exactly 2 degrees. See temp1 here:

temp0:  0xaf0 2800 6.9   temp1:  0xae3 2787 5.6   temp2:  0xaf6 2806 7.5   temp3:  0xb0d 2829 9.8
temp0:  0xaf0 2800 6.9   temp1:  0xaf7 2807 7.6   temp2:  0xaf6 2806 7.5   temp3:  0xb0d 2829 9.8
temp0:  0xaf0 2800 6.9   temp1:  0xae3 2787 5.6   temp2:  0xaf6 2806 7.5   temp3:  0xb0d 2829 9.8
temp0:  0xaf0 2800 6.9   temp1:  0xaf7 2807 7.6   temp2:  0xaf6 2806 7.5   temp3:  0xb0c 2828 9.7
temp0:  0xaf0 2800 6.9   temp1:  0xae3 2787 5.6   temp2:  0xaf6 2806 7.5   temp3:  0xb0c 2828 9.7
temp0:  0xaf0 2800 6.9   temp1:  0xaf7 2807 7.6   temp2:  0xaf6 2806 7.5   temp3:  0xb0c 2828 9.7

But there seems to be no logic when it happens, just random? Must be just some weird bug in BMS firmware..

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

2 participants