I confirm mDNS traffic leads to a lot of issues on esp32/8266 and ESPHOME.
I am not sure if it has anything to do with ESPHOME or is ESPs themselves but my shellies (esp8266 based, stock firmware) are much more solid)
On ESPHOME behavior is consistent and happening more often on devices with lower signal quality.
I am not a network expert but I suspect it has something to do with the poor wifi bandwidth ESPs have which makes them dropping connection.
Also ESPHOME devices act as servers and if you perform a wire shark log you will see they broadcast packets which by my (poor) understanding is not ideal.
I seem to have the same issue that you are all describing here, and it seems to be affecting my whole 2.4 GHz Wifi stability. I have around 20 ESPHome devices there - mix of ESP32 (4 of them Wired), Shellys and Sonoff devices + BlitzWolf and Avatto plugs - and depending on their Wifi connection quality they can disconnect from once a day to few times an hour.
I read a few workarounds here, like turn off ESPHome in HA when you donāt use it - but I suppose HA canāt communicate with the devices then right? Is fixing the IP solving the disconnection issues as well?
No it does not fix anything having fixed IP: it is just speeding up the re-connection after disconnects as esp doesnāt need to negotiate IP address with DHCP server
For what itās worth, I was having issues with ESPHome devices disconnecting all the time, but since upgrading from my RPi 3B+ running HA over wifi to a bottom of the range NUC over wired LAN, I have had none of those issues at all after a week.
Just one more datapoint - blocking my mdns reflector resolved this issue for me. This issue has plagued me for months and months. My esphome sensors going unavailable every few minutes for a few seconds to a minute. I tried the proposed fix to change my wifi AP channel width from 40MHz to 20MHz. This helped initially, but the problem returned. I realised that any restart on the AP interface resolved the issue for 30 seconds up to 10 minutes.
After reading the suggestions here, I removed my IoT subnet from the domains list of my mdns reflector (avahi-daemon). This has completely resolved the issue for me. Ie, removing (or significantly reducing) mdns traffic from the wifi network (ssid) of the esphome devices.
My devices are connected to wifi normally, however they show as offline only on HomeAssistant.
I am in the latest version of the firmware.
INFO Reading configuration /config/lab.yaml...
INFO Detected timezone 'TZ' with UTC offset -3
INFO Starting log output from lab.local using esphome API
INFO Connecting to lab.local:6053 (xxx)
INFO Successfully connected to lab.local
[12:03:25][I][app:105]: ESPHome version 1.16.2 compiled on Apr 2 2021, 15:52:20
I wanted to add I am having the same issue. I donāt think it is a WiFi issue as Iām using an Olimex board that is PoE- the wifi on this is not configured and it is solely ethernet. I donāt see it drop off of my UDM. It doesnt seem like a connectivity issue in that regard
It seems I have the same issue as mentioned above. My devices (NodeMCUs and Wemos D1) worked fine, until I upgraded home-assistant to version 2021.04.x (Iām not sure about the version, as I did not recognize this as an issue first). All devices are available in ESPHome (v1.19.0) and working as they should - no connections lost, no error messages, sensor data gets send out.
If I integrate the devices into home-assistant (esphome integration with auto discovery), the devices are detected and the sensor data is available.
Until I restart homeassistant, then the devices are unavailable. It shows up as integration and I have to delete the device, and then add it again, every time I restart home-assistant.
My work around for some devices: enable MQTT, this seems to work even when the device is shown as unavailable in home-assistant, so I get at least the data. But I cannot use MQTT for all my devices (tag reader).
What Iām struggeling with is, that it works when adding the device to home-assistant, but not after the restart. I use fixed IPs for each device. I cannot find any error messages in the log files (in home-assistant).
I recently had the same problem. My esp8266 mini would randomly switch to ānot availableā and then back to normal.The solution was to remove the fallback hotspot from my configurationā¦ ā¦