Problems with mDNS resolution for ESPHome

Background: trying to get 2 switchbot curtains working. On first setup they auto discovered and worked a bit, but lose connection quickly or if anything is restarted. I had been using a USB bluetooth dongle which was relatively plug-and-play, but had frequent issues due to the known kernel bug, so I went down the path of making an ESPHome bluetooth proxy.

Problem - HA container has a hard time finding the ESPHome device. Seems like an issue with mDNS not getting to the container.

Diagnostic steps:
ping btproxy.local on my windows laptop, works fine
ping on my windows laptop, works fine
SSH into the server running HA
ping btproxy.local on server, works fine
ping on server, works fine
docker exec -it homeassistant bash to run inside the HA container
ping btproxy.local on server, get back ping: bad address ‘btproxy3.local’
ping on server, works fine

But this means the HA container can’t seem to find the ESPHome device because it’s looking via the mDNS name. Every once in a while if I delete the device from HA, it will auto discover and be usable for a few commands, then go back unavailable. Other times it discovers but doesn’t show the LED switch I put in the ESPHome config so it’s not even registering correctly. Previously I was getting “Temporary failure in name resolution (APIConnectionError)” a lot.

1 Like

Same for me since the last couple of months, moved to a static ip configuration for my esphome devices because of it.