Hi @mfalkvidd and others.
Yesterday after work I tried to get my head around code suggestions but somehow I cold not make them work so I did some google search and after some time I find something that I implemented in my nodes for testing.
Interestingly it works as expected for two of my nodes, but one still keeps jumping around, not that often, but that's still strange, I will compare code to other two to see what I've done wrong there.
So I used Hysteresis approach by doing this.
#define HYSTERISIS 0.5 // Hysteresis for sensor
...
float temperature = dht.getTemperature();
if (isnan(temperature)) {
Serial.println("Failed reading temperature from DHT!");
} else if (abs(temperature - lastTemp ) > HYSTERISIS) {
// Only send temperature if it changed since the last measurement or if we didn't send an update for n times
lastTemp = temperature;
if (!metric) {
temperature = dht.toFahrenheit(temperature);
}
And the same for humidity.
Still not sure that this will work as expected in long run, but will see.
But now it is way better than before. Thanks.