DHT22 sensors reporting bad values in ESPHome

I have built a couple of devices with ESP8266 NodeMCU controllers, which I initially programmed myself with the Arduino IDE, but flashed them both with ESPHome.
One has a DHT22 sensor for temp and humidity, and the other has a DHT22 and also a BMP280.

Last night both were working fine, then I did an “update all” to all my ESPHOME devices and this morning the values from the DHT22 sensors are way out:

Box 1, with a DHT22 and a BMP280 (the first temp value is from the BMP280):

[11:38:36][D][sensor:099]: ‘Greenhouse Temperature’: Sending state 25.10000 °C with 1 decimals of accuracy
[11:38:42][D][sensor:099]: ‘DHT Temperature’: Sending state -9.70000 °C with 1 decimals of accuracy
[11:38:42][D][sensor:099]: ‘Greenhouse Humidity’: Sending state 23.00000 % with 0 decimals of accuracy

Box 2, with a DHT22:

[11:40:37][D][sensor:099]: ‘Garden Temperature’: Sending state -6.20000 °C with 1 decimals of accuracy
[11:40:37][D][sensor:099]: ‘Garden Humidity’: Sending state 6.30000 % with 0 decimals of accuracy

They are both sitting on my table indoors at the moment. By comparison, last night the humidity was around 50% and the temp is in the 20’s.

The YAML looks like this:

sensor:
  - platform: bmp280
    temperature:
      name: "Greenhouse Temperature"
      oversampling: 16x
    pressure:
      name: "Greenhouse Pressure"
    address: 0x76
    update_interval: 30s
    
  - platform: dht
    pin: D5
    temperature:
      name: "DHT Temperature"
    humidity:
      name: "Greenhouse Humidity"
    update_interval: 30s

Would this be caused by an ESPHome update? If so, is there a way of a) rolling back to a previous version, and b) reporting the problem?

I’m very new to this, so thanks in advance for any help.

Try adding the model:

  - platform: dht
    pin: D5
    model: DHT22
    temperature:
      name: "DHT Temperature"
    humidity:
      name: "Greenhouse Humidity"
    update_interval: 30s

Auto detect does not work well.

3 Likes

I’m sure that was in there before, no idea why it got deleted.
Problem solved - Thank you so much!!! :grinning:

1 Like

I have just recently had to make a new sensor to subtract 2.3 from humidity and 1.6 from Temperature. to have this sensor match my two BMP280’s. And I have always had the model DHT22 included.

You don’t have to make a new sensor to do that. You can apply an offset filter to the existing sensor in ESPHome.

2 Likes

This thread just saved me from pulling out the few hairs I have left on top of my head. :crazy_face:

1 Like

had the same problem… fixed… thanks guys, thanks @tom_l

1 Like

Same issue here today… Thanks Tom