Xiaomi glitches in temperature

Using the Xiaomi binding, with v3 of the gateway and those rectangular temperature/humidity,/pressure sensors.
From time to time I get these glitches:
Rossbuehel_Chart_D

The batteries are newly replaced. Is there something I can do to avoid those?

It’s the peak of 100°C, not the little pause later caused by internet outage.

I get these glitches too, but usually in the negative direction. What I do is set up a “raw” item and check the values in a rule before copying it to the real item I want to monitor. See the rule below for an example. This one happens to convert C to F as well as checking the value.

rule "Outdoor C to F"
when
    Item Outdoor_Temperature_Raw changed
then
    var Number temp
    if (Outdoor_Temperature_Raw.state instanceof DecimalType) temp = Outdoor_Temperature_Raw.state as DecimalType
    if (temp > -100.0) {
        var Number temp2 = (temp * 1.8) + 32
        Outdoor_Temperature.postUpdate(temp2)
    } else {
        logWarn("Temp C to F","ERROR - not updating Outdoor_Temperature to: -100C")
    }
end

1 Like

That’s one way to handle it… :wink:
But I’d like to know if there’s something, which causes these glitches in the first place. What I find most startling is, those glitches won’t come up in the app.


notice: the Peak in humidity is boiling water, the sensor is right by the water boiler

Maybe the app filters them out too? I think I’ve noticed these more often when the battery is weaker, but I can’t say that for sure. The other measurements seem reasonable. Maybe the sensor sends these specific values (+100, -100) when something goes wrong in the sensor? I also got one very high humidity value - well above 100%!

Or maybe this is what happens if the gateway receives a garbled packet from the sensor. And that’s why the app knows to ignore it.

I have one of the new square sensors and several of the old. Using deconz RaspBee + deconz binding. I don’t see any glitches.
I think, there is some “full” package that is only transmitted rarely (maybe every day?), that contain additional data like battery status. Maybe the binding misinterprets that? The normal packages come in every hour (maybe less) when there is no change in the sensor values.

Those seem suspiciously related?

oh. they aren’t. The internet outage was on my home-openHAB, the main openHAB-instance. The xiaomi are on my remote cottage and there internet was always on up there - only thing was, the main-openHAB didn’t receive the information via MQTT… :wink:

yes, I encountered many many more of those glitches before replacing the batteries.
It worked for almost three years, then came the low batteries and the first glitches came. I then replaced all batteries and the glitches are still there - much more rarely, but they’re here…

That’s been my experience as well. My theory is that as the battery gets weaker, a few packets are scrambled and the gateway represents those as +/-100C - an out of range value. But just like you I still get a few bad values even with fresh batteries. And my units are also a few years old. Could they degrade over time?

I think it might be a bug or misbehaving in the code. Since a week on of my sensors isn’t reachable anymore (though I recently replaced the battery). The binding since then plots that sensor with 100 degrees.
I’ll file an issue in github for it.
Rossbuehel_Chart_W