Page 1 of 1

Make BaseModule ignore erroneous sensor values?

Posted: 17 May 2018 16:51
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 4711 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.

Re: Make BaseModule ignore erroneous sensor values?

Posted: 21 May 2018 11:01
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.

Re: Make BaseModule ignore erroneous sensor values?

Posted: 22 May 2018 00:38
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.

Re: Make BaseModule ignore erroneous sensor values?

Posted: 22 May 2018 19:42
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. :(

Re: Make BaseModule ignore erroneous sensor values?

Posted: 23 May 2018 13:11
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