Community
OpenEnergyMonitor

OpenEnergyMonitor Community

Don't log out of range values - filter input

I am using EMONCMS to log temperature and humidity readings coming from ESP8266. The Arduino code running on the ESP8266 filters most of the out of range data. However I have still had data logged on the EMONCMS that is clearly not right. How can I set up a filter on the input of EMONCMS that prevents logging of out of range data?

For example T >10 and <70.

The only filter I have found is “positive” and “negative”.

What sort of values are you getting? If using the ds18b20 1-wire temperature sensors, there is a fault indication of 85°C, so if you are seeing any 85°C values that you consider “out of range” for the environment being monitored then you most likely have an intermittent fault possibly a bad connection.

Although It may well be wiser to find and eliminate the source of the errors, you can do what you ask and filter the range using the “conditional” processes when using a local instance of emoncms, but I don’t think you will be able to do it on emoncms.org as those processes are not available

1 Like

Thanks for your response Paul.

The issue wasn’t restricted to just the ds18b20.

Thanks for the tip about the conditional process only being available on the local instance. I had only been looking on the emoncms.org version.

Here’s a trick to set a limit on an input:

subtract the limit value by adding it as a negative value.
Allow negative
add the limit value

Example 1: value is 490 and the limit is 250:

490 + (-250) = 240
Allow negative = 0
0 + 250 = 250

Example 2: value is 137 and the limit is 250:

137+ (-250) = -113
Allow negative = -113
-113 + 250 = 137

It ain’t pretty but seems to work. Min/Max functions would be nice.

My calculator says -133 + 250 = 117 :sunglasses:

I need one of those calculators. Thanks for pointing out the typo, I’ve fixed it.

1 Like