How can I filter out data that falls out of range from getting persisted?

Hi folks, I am using a MySensors node that is getting temperature reading from my pool via a floating sensor that transmits readings every few minutes to my OpenHab system via an MQTT Mysensors Gateway. Every once in a while I will get a random reading that is way out of range that is skewing my data. I have updated my code on the temp node so that it won’t transmit any values that are out of range. I think the issue happens randomly during transmission from my temp node to my MQTT gateway resulting in these erroneous large values. I persist the data to be able to use it in Grafana and use those graphs in my sitemaps.

The Grafana graphs should look like this.

But when this error happens it looks like this

I’d like to filter what gets put into my innodb db if at all possible when OH gets the data. Is there any way to do this? The sensor I am using is the DS18B20 which has a temp range of -55 degrees C to + 128 degrees C. If I limit it to that range, I should be ok.

Here is the node I am using https://www.mysensors.org/build/temp

If you want to stop persistence seeing a value, you’ll need to stop it at the channel level before it gets to Item.
You might use a transform profile that passes acceptable values or substitutes UNDEF (UNDEF states are not persisted).
Or something similar in the channel config, if the binding allows transforms.

Related

Awesome thanks I’ll chase that down! Thanks for the quick response.