Logic for ESPHome api

Hi.
I am a relative new user to HA and ESP-flashing. But with this amazing project its acctually really easy and so much fun!

I have created a simple DHT22 setup and just for the fun of it I have configured it for deep sleep.
I dont use mqtt just HA api.

In my set up the ESP boots, read the values, lives for 120s and then goes for deep sleep for 30m.
I can see from the log that everything works fine, but in HA the sensor values dont get new readings every 30mins?

How does the logic work? Does HA only write newer values and retain the last if the new reading is the same or is there something wrong in my setup or with the ESP module (ESP 12f)?

1 Like

Don’t use the HA native API for deep sleep. HA currently only tries to reconnect to the node every 60 seconds, so the deep sleep cycle can easily be missed. This will be solved in the future with additions to the native API, but it’s not ready yet.

So, for deep sleep please use MQTT for now.

2 Likes

Ahhh.
Thanks !
Well I’ll just have to wait to use my battery powered devices.

What’s wrong with mqtt?

Nothing really, but i found the api more easy and quick!