DHT22 and deep sleep question

I have a number of WEMOS D1 Mini’s using DHT11’s and 22’s. All seem to work as expected. I have a couple that I use power with batteries using deep sleep. One is acting weird and I’m looking for suggestions. I have it set for sleep_duration of 60min and run_duration of 60s. My DHT22 has an update_interval of 10s. The temperature reading is captured every hour as expected. The humidity which is my primary need is randomly reporting. Sometimes its every hour as expected and other times it may go for 4-5 hours before I see a new reading. Haven’t tried a different DHT22 yet but do plan on trying that today. Any other thoughts? reflash the D1 maybe?

That is the “poor mans” version. Better is to have the esphome node directly to sleep after the temperature reading was successfully delivered to HA.

Check the deep_sleep.enter Action and best combine it with a run_duration too for the (hopefully rare) case the deep_sleep.enter is never reached.

I’ve tried to get this figured out from reading this and doing some searches on deep_sleep.enter but am still not getting it.

Regarding this from the ESPHome document…
on_...: then: - deep_sleep.enter: id: deep_sleep_1 sleep_duration: 20min

what exactly is the on_…: ?

Here is my .yaml at this point.

`esphome:

name: “humidor1”

esp8266:

board: esp01_1m

Enable logging

logger:

Enable Home Assistant API

api:

ota:

deep_sleep:

run_duration: 10s

id: deep_sleep_1

sleep_duration: 5min

wifi:

ssid: !secret wifi_ssid

password: !secret wifi_password

Enable fallback hotspot (captive portal) in case wifi connection fails

ap:

ssid: "Esphome-Web-7Adcf8"

password: "Pc3Vdb3As7at"

captive_portal:

sensor:

  • platform: dht

    pin: GPIO4

    temperature:

    name: “Temperature”

    humidity:

    name: “Humidity”

    update_interval: 5s

    model: DHT22
    `

Sorry…messed up to formatting.

esphome:

  name: "humidor1"

esp8266:

  board: esp01_1m

# Enable logging

logger:

# Enable Home Assistant API

api:

ota:

deep_sleep:

  run_duration: 10s

  id: deep_sleep_1

  sleep_duration: 5min

wifi:

  ssid: !secret wifi_ssid

  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails

  ap:

    ssid: "Esphome-Web-7Adcf8"

    password: "Pc3Vdb3As7at"

captive_portal:

sensor:

  - platform: dht

    pin: GPIO4

    temperature:

      name: "Temperature"

    humidity:

      name: "Humidity"

    update_interval: 5s

    model: DHT22

Hi,
I am new in Home Assistant and ESPHome. I wanted to play a bit with the ESPHome so I took a battery powered ESP32 and loaded ESPHhome, wired up three DHT22 sensors and configured it in the yaml. It works.
But when it comes to deep sleep → it works weird as already mentioned by @kevin59. I enabled deep sleep for 5 minutes, then wake up for 2 minutes. When I am watching log of the esp32 I see it wakes up and also I see this 2 minutes interval is long enough for sending the temperature and humidity values from all the 3 sensors twice (I have 60 seconds defined for the sensor). But in Home Assistant I see some temperature or humidity values are not there for long time (20 minutes or more).

Before I would go into more complex and proper solutions, can anybody help me understanding the concept?
How does the submitting of the measured sensor valued work? Is ESP32 actively submitting it to Home Assistant? I assume not as I do not define home assistant’s IP or hostname in the ESP32’s yaml.
So I assume Home Assistent is probing the adopted remote ESP32’s. Is it probing in some defined time interval? Can it happen 2 minutes of wake up is not sufficient for the Home Assistant to fetch the values?

I have another D1 Mini that I plan to use as a voltage monitor. No deep sleep on this and I have it set to update every 10 seconds. Right now I have it just monitoring a 18650 battery with no load. I was seeing that it was not updating the value on a regular basis. I have other DI Mini’s that behave similar. In most cases I use them for temperature and humidity. The temperature values seem to update more frequently.

I did another search today and stumbled on a comment that essentially said it the value did not change, HA would not update it. So I think this might be my reason I’m not seeing these updating. The values are not changing. For my initial question I posted I think the humidity in my cigar humidor just doesn’t change very much. I’m going to try and validate this on my other sensors, but I’m betting this resolves what I thought was a problem.

Good point. I was thinking you could easily test it opening the door in between readings, or adding a small tray of distilled water in between each readings to force a change.

My built-in sensors on my electric humidor just died so I was going to build the same sensor setup you have here.

My humidor has a really annoying issue where if it looses power, it sets the temp to 55 (i.e. the temp isn’t stored and restored on power loss), so I’ll use these sensors to alert me to this issue so I know to go change the temp back.