I use node red to run my heating. I have two sensors hooked to esp8266 running mqtt. I average the readings together. Several weeks ago one sensor quit and the heater went full blast as one sensor was zero and the other wasn't. Lesson learned as I now check to make sure data is coming in. But... and I have pondered this a long while, how can I ensure it's good data? If one starts reading high or low, how would you know? I can check for crazy high or low by imposing limits but say it's only 10 degrees or so? Maybe it's just not reasonable and I accept the risk.
The principle is to have a data comparison. Let's imagine your temperature probe sends data every minute. What you need is to compare the received value with the 5 previous values (5 minutes for example). If the comparison value does not exceed a certain threshold, it means the measurement is good, otherwise it is a false measurement (and therefore ignored).
Another principle: let's imagine that you turn the heating on at 18°C and off at 21°C. You will have a timeout (minimum duration), i.e. if you have 20°C at time x then 15°C at time x+1 then 20°C at time x+2..., your bad data (15°C) will be ignored because you only had 15° for 1 minutes instead of 5 (5 for example)
And you can use the smooth node to help with this. Send a copy of your inputs via the smooth node and saved to a flow variable.
Got it, thanks