Make BaseModule ignore erroneous sensor values?

Discussions about Z-Way software and Z-Wave technology in general
Post Reply
wavedoff
Posts: 20
Joined: 07 Aug 2017 13:40

Make BaseModule ignore erroneous sensor values?

Post by wavedoff »

So I occasionally get absolutely crazy outputs from the sensors in my Z-wave network. For example, My bedroom has never reached 410 degrees :lol:
zsensorerror.PNG
zsensorerror.PNG (116.66 KiB) Viewed 4705 times
This does not just happen with my Aeotec Multisensors, this also happens with the voltage readings from my Zooz power switches, and a couple of plug in power switches from monoprice. So this does not appear to be a device specific problem. These sorts of readings wind up triggering rules based on these sensors, which is less than ideal. It also completely screws up the auto scaling of my monitoring graphs.

I went digging around, and found that the BaseModule module does have some code that seems related to dealing with these errors, but it is only supposed to print a message in the logs, with dropping the bad value being on the "to-do" list.

Code: Select all

 
// Warn on big level changes - TODO maybe deny too big changes
    if (deviceType === 'sensorMultilevel') {
        var diff = Math.abs(lastLevel-newLevel);
        var probeType = vDev.get('metrics:probeType');
        // Ignore diff for changes of more than 4 hours
        if (modificationTime-lastUpdate > (4*60*60)) {
            diff = 0;
        }
        if (
                (probeType == 'luminosity' && (diff > 250 || newLevel > 1000 || newLevel < 0)) ||
                (probeType == 'temperature' && (diff > 10 || newLevel > 50 || newLevel < -30)) ||
                (probeType == 'humidity' && (diff > 20 || newLevel > 100 || newLevel < 5)) ||
                (probeType == 'ultraviolet' && (diff > 4 || newLevel > 15 || newLevel < -1))
            ) {
            self.error('Unlikely '+probeType+' level change from '+lastLevel+' to '+newLevel+' for '+vDev.id);
        }
    }
Is there any word on when this TODO will be done? I know it's a minor thing, but it drives me nuts, and BaseModule does not seem to have gotten any love in over a year.
piet66
Posts: 266
Joined: 04 Feb 2017 17:00

Re: Make BaseModule ignore erroneous sensor values?

Post by piet66 »

Maybe the reason for such wrong values is sensor polling.
I made this experience with temperature measurement of a qubino device. When periodical polling was switched on I got from time to time huge wrong values. I switched off polling for all multilevel sensors and parametrized all devices to send their values by their own and since that time I've never got such values.
I also suspect other devices (Fibaro, Aeotec), but I haven't prooved that.

I believe that this devices do not always work properly when addressed at an inappropriate moment. But usually you will not notice that.
Raspberry Pi 3 Model B Rev 1.2
Raspbian GNU/Linux 10 (buster, 32bit)
RaZberry by Z-Wave.Me ZW0700 7.20.00 07.38/1766938484 1025/257
Z-Way version v3.2.3 from 2022-04-06 04:56:23 +0300
wavedoff
Posts: 20
Joined: 07 Aug 2017 13:40

Re: Make BaseModule ignore erroneous sensor values?

Post by wavedoff »

Thank you for the response!

I am using periodic sensor polling, so you may have encountered the same thing as me. Sometimes it will be fine for days, and other times it will bug out half a dozen times. I will play around with longer polling intervals and disabling it entirely, and see if the issue improves.
wavedoff
Posts: 20
Joined: 07 Aug 2017 13:40

Re: Make BaseModule ignore erroneous sensor values?

Post by wavedoff »

Removed periodic sensor polling entirely, and setup everything to send reports automatically.

Got a report that it was 4.8 million degrees in my bathroom. :shock: I've also gotten a read of 0 volts out of one of my Zooz wall plugs as well.

It seems that z-way needs some sort of sanity check for this. The devices themselves just seem to send bad data sometimes. :(
enbemokel
Posts: 482
Joined: 08 Aug 2016 17:36

Re: Make BaseModule ignore erroneous sensor values?

Post by enbemokel »

Hi, these findings may be also a explanation for many false alarm of Fibaro Smoke Sensor. Would be good to know
if this:
>Is there any word on when this TODO will be done? I know it's a minor thing, but it drives me nuts, and BaseModule does not seem to have gotten any >love in over a year.
will be checked.
Thanks
Post Reply