Open JustEnoughDucks opened 2 weeks ago
The device does not do the connecting. HA connects to the device. If it doesn't know that the device is sleeping, it will keep attempting to connect with increasing back-off. The dashboard logs use the api as well, so the device doesn't know the difference between that and HA connecting, which is why it immediately thinks it has sent the data when you connected for logs. Is MDNS working? Did you add the device before or after you included the deep sleep option? There are several things you could improve with the config and you didn't include enough logs. Come ask on discord.
The problem
I am making a dumb doorbell. The only requirements is that it
The problem is that upon installing the config to the ESP32-C3, the device will consistently work until it goes to sleep for more than 10 minutes, then it will be extremely inconsistent and never work completely correctly again.
The behavior after the 10 minute period is as follows:
WARNING Can't connect to ESPHome API for dumb-doorbell @ 192.168.1.124: Timeout while connecting to [AddrInfo(family=<AddressFamily.AF_INET: 2>, type=<SocketKind.SOCK_STREAM: 1>, proto=6, sockaddr=IPv4Sockaddr(address='192.168.1.124', port=6053))] (TimeoutAPIError)
*** I think this is an important because it indicates that it is a problem on the ESPhome end and not the device config. If ESPHome listens for a connection (or whatever it is doing when the log screen is up) then it connects right away. Then after the error message, it still connects, but ESPHome is the one that doesn't seem to relay the sensor values to Home Assistant
Maybe it would work better to simply broadcast an MQTT message instead of trying to couple with the API if the API doesn't seem to like handling very infrequent connections? It shouldn't be an networking issue because my other ESPHome devices that don't drop off the network have absolutely no problem sending simple sensor values and I have a DSMR reader that hands over values every 10 seconds.
Which version of ESPHome has the issue?
2024.4.2
What type of installation are you using?
Docker
Which version of Home Assistant has the issue?
<=2024.5.0
What platform are you using?
ESP32
Board
SEEED Xiao ESP32-C3
Component causing the issue
deep sleep or esphome api itself
Example YAML snippet
Anything in the logs that might be useful for us?
Additional information
No response