I am using an ESP01 with an integrated DHT11 sensor, which works through the ESPHome integration.
It appeared that the given temperature value is always more than 2 degrees off, so I created a calibrated copy of the sensor like this in configuration.yaml:
This normally gives a reasonably good value, but there is one problem: at every restart of Home Assistant the calibrated sensor apparently gets a value of zero from the original sensor, so shows a value of -2.3 degrees in that case. The original ESPHome sensor output however does not show those zero values.
This are some example graphs of the original and the calibrated sensor:
You can clearly see the downward spikes at every restart of HA.
I could add a filter to ignore values of zero, but then there is a problem when the real value is exactly zero.
So is there a solution for this?
Thank you
That is looking exactly as to what I need, so I will try it out.
However, in the mean time I probably found another solution as well?
It appears that the calibration can be added directly to the ESPHome node.
So this is what I did now in ESPHome:
OK, I added both solutions to my configuration, and indeed both work as expected:
The original sensor is now showing the values with an -2.3 degrees offset, and the calibrated sensor is not sparking down anymore at several restarts of HA.
Can we conclude that “my” solution is the preferred solution in this case, because it precludes getting any ‘unknown’ or ‘unavailable’ values?