smartboxchannel / SONOFF-SNZB-02-Temperature-and-humidity-sensor

An alternative firmware version for the SONOFF SNZB-02 temperature and humidity sensor. Adjustable sleep interval via zigbee network, thermostat and hydrostat functionality, standard temperature and humidity clusters, binding support.
74 stars 18 forks source link

Sometimes bad measurement (124.99, -40 C temp and 99.99% hum) #3

Closed tamas2001 closed 1 year ago

tamas2001 commented 1 year ago

I have checked certain similar issues reported:

https://github.com/closedcube/ClosedCube_HDC1080_Arduino/issues/11 https://github.com/closedcube/ClosedCube_HDC1080_Arduino/issues/13

Tried to add user_delay_ms(20) at two place in the code, but no success so far.

smartboxchannel commented 1 year ago

Hi, I have not encountered anything like this on this sensor. In the user part, there is a delay between the temperature request and the readings. https://github.com/smartboxchannel/SONOFF-SNZB-02-Temperature-and-humidity-sensor/blob/f7364cea28ee7245c4ccc99cfbb88bbd20c00d80/PROJECT%20SOURCE/TH_SONOFF/Source/zcl_app.c#L295

And in the driver, I left a comment in the reading function about the need for a delay, this is for those who will use the driver in their applications. https://github.com/smartboxchannel/SONOFF-SNZB-02-Temperature-and-humidity-sensor/blob/f7364cea28ee7245c4ccc99cfbb88bbd20c00d80/PROJECT%20SOURCE/TH_SONOFF/Source/hdc1080.c#L43

Post a debug here with data and battery voltage level.

By the way, today I posted a new firmware, a lot has been changed there, try it, although nothing has changed there in part hdc1080. (For this firmware, you need to use the new z2m converter)

https://github.com/smartboxchannel/SONOFF-SNZB-02-Temperature-and-humidity-sensor/tree/main/PROJECT%20SOURCE/TH_SONOFF/firmwares

https://github.com/smartboxchannel/SONOFF-SNZB-02-Temperature-and-humidity-sensor/blob/main/Z2M%20CONVERTER/SNZB-02_EFEKTA.js

tamas2001 commented 1 year ago

Thanks very much for the details. Good to know that it should not caused by any timing issue, but probably any poor quality battery. So the battery is on 100%/3000v. Now I have replaced with a brand new energizer battery. Let's see if it could fix it. It is very interesting as I have few other devices with lower battery (even 24%) reported and no issue is observed there. It could happen that there is only problem with that particular device hardware. I will let you know tomorrow. What are the differences/new features in your new firmware compared to the old one?

tamas2001 commented 1 year ago

I can confirm the issue is fixed with brand new quality battery!