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

Battery Temperature below 0°C is shown as -127°C #17

Open
Doggy77 opened this issue Jan 8, 2024 · 8 comments
Open

Battery Temperature below 0°C is shown as -127°C #17

Doggy77 opened this issue Jan 8, 2024 · 8 comments

Comments

@Doggy77
Copy link

Doggy77 commented Jan 8, 2024

Describe the bug
Battery Temperature below 0°C is shown as -127°C, in API and in Web

{"mqttsta":"Disabled","pvosta":"Disabled","o":{"o1":false,"o2":false,"o3":false,"l":true},"up":645037,"he":37992,"rssi":-82,"b":{"ch":95,"vo":13.10000038,"cu":0.620000005,"te":-127,"ge":38,"co":76},"l":{"vo":13.10000038,"cu":0.620000005},"p":{"vo":31.5,"cu":0.25},"c":{"st":2,"er":0,"te":5}}

Bildschirmfoto zu 2024-01-08 15-13-53

(ATM we have ca. -0,6°C where the battery is located)

Original sensor is used. Controller temperature did not fall below 0, but maybe here is the same issue.

Low priority, if this is sent by RNG itself it doesn't matter, I have another (Tasmota) sensor and can live without this.

@Doggy77 Doggy77 changed the title Battery Temperature below 0°C is schown as -127°C Battery Temperature below 0°C is shown as -127°C Jan 8, 2024
@enwi
Copy link
Owner

enwi commented Jan 9, 2024

Thanks for the bug report, I will take a look :)

@Doggy77
Copy link
Author

Doggy77 commented Jan 9, 2024

Addendum: It seems as if -127 equals -0°C, the lower the temp, the higher the value climbs: approx. real -6°C come out as -122.
I conclude: It is not stuck at -127.
Thanks for your work!

@enwi
Copy link
Owner

enwi commented Jan 22, 2024

Ok I think I found the issue. I need to strip off the MSB for it to read correctly.
Taken from the datasheet: Value of TEMP (b7: symbol bit;b0-b6 temperature value).

EDIT: Or do they actually mean sign bit instead of symbol bit, I am confused.

@enwi
Copy link
Owner

enwi commented Jan 22, 2024

As I understand it they are encoding the number as follows:

  • bit 0 through 6 are the absolute temperature value
  • bit 7 is the sign

This does not follow the 2s complement of a standard number, that is why it is going from 0 to -127 instead of -1

@enwi
Copy link
Owner

enwi commented Jan 22, 2024

I built a new binary, can you see if it fixes the issue? (I hope it is still cold enough to test 🤣 )
binary.zip

@Doggy77
Copy link
Author

Doggy77 commented Jan 22, 2024

I downloaded your ZIP and flashed it. It shows 2.12.0 and Update available (which I didn't install yet): settings screen

Unfortunately it isn't cold enough anymore:
main screen but I will have an eye on it.

@Doggy77
Copy link
Author

Doggy77 commented Jan 26, 2024

I can confirm that the issue is solved, both in WebUI and also in API-REST response
Screenshot_20240126-055545
Thank you!
P.S.: It shows "New version available" and if I click this it reverts to 2.11?

@enwi
Copy link
Owner

enwi commented Jan 26, 2024

Great that the issue is resolved, I will release the new version then.

The "new version available" message is another bug, it will be shown if the latest version on GitHub does not match the one on the device 😅

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

No branches or pull requests

2 participants