enwi / RNGBridgeDoc

Documentation and guides for RNGBridge the renogy to wifi bridge with PVOutput and MQTT support and much more
16 stars 0 forks source link

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

Closed Doggy77 closed 2 months ago

Doggy77 commented 10 months ago

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.

enwi commented 10 months ago

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

Doggy77 commented 10 months ago

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 commented 9 months ago

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 commented 9 months ago

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

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 commented 9 months ago

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 commented 9 months ago

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 commented 9 months ago

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 commented 9 months ago

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 😅