About D1 Mini Sensors and momentary power losses

Hi all,
I have used D1 minis and DHT-22s to build room temperature and humidity sensors for my house. Recently we had a momentary power loss (less than 1 second) but enough to cycle everything in the house. Later that day I noticed that these sensors were reporting terribly inaccurate numbers. Instead of temps around 70 - 72 degrees F they were reporting 13 - 15 degrees F. I unplugged them for a few minutes and then plugged them back in, restarted home assistant, etc… no luck. Even looking at the logs, the numbers they were reporting were the same. It was only when I went to each device in the HA ESPHome integration, clicked on Edit for each one and re-installed the config, that each one started to report the correct temperatures.

Has anyone else noticed this kind of behavior with the ESP 8266’s and ESPHome ? It’s easy enough to fix, for now, when I only have a few, but I’m thinking as I scale up my use of these it might be more of a pain to fix than its worth. Not to mention it borked my pretty months long running graphs :frowning: LOL

Share your yaml, but I suspect that you have not specified the type of DHT in your config and auto detection is failing.

  • model (Optional, int): Manually specify the DHT model, can be one of AUTO_DETECT, DHT11, DHT22, DHT22_TYPE2, AM2302, RHT03, SI7021, AM2120 and helps with some connection issues. Defaults to AUTO_DETECT. Auto detection doesn’t work for the SI7021 chip.

Zoogara, thanks for the reply! You’re correct, I’m not specifying the model. But if that were what caused\causes the issue, it seems like that would cause the sensor to report the incorrect numbers all the time, not just after a power blip? Why did I have to re-install the config to get it to start reporting the correct number again.

Below is the Sensor section of my yaml…

  - platform: dht
    pin: D2
      name: "Living Room Temperature"
        - lambda: return x * (9.0/5.0) + 30.5;
      unit_of_measurement: "°F"
      name: "Living Room Humidity"
    update_interval: 5s

No, it’s usually intermittent, mostly correct but sometimes wrong. Just try it and see if you can then reproduce the issue.

1 Like

Its interesting you mention that its intermittent. One thing I’ve noticed in the past setting these things up is that every once in a while, the sensor would report odd numbers, and that too, took a re-install of the config. So it sounds like you’ve got me on the right path here.

Zoogara, thanks again for the help. I’ve updated my yaml. We shall see how it goes :+1: