ESPHome integration with HA not working

I’ve been having this problem with ESPHome for a long time now and i’m about to give up.

It started with new devices not beeing discovered in HA after connecting them to ESPHome, only the sensors. Simple chips like the Sonoff SV that I already have many of is not discovered as switch and no other device I add get discovered in HA. I never get a notification i HA any more when adding a device in ESPHome.

Today one of my nodemcu-led-controllers turned unavailable in HA but still is online in ESPHome, logs looks fine. I first tried to update it to latest version with no luck and after that delete the integration from HA and add it again, it’s not coming back.

I’ve tried to uninstall the ESPHome addon and reinstall it several times, but nothing changes.

It’s frustrating and i’m about to give up so I hope someone here can give me some help :slight_smile:

When you add the integration you press the + button in integrations and then esphome?

Yes, i’ve tried that too. It adds the device, but still switch, light, camera etc is not working. Shows as unavailable. Only sensors working.

Normally, or before, it allways discovered new devices instantly, but now nothing.

What do your logs say?

HA logs? I could not find anything related. It’s been a while since I looked so I don’t really remember.

Can do a test.

And esp logs

Nothing about devices that should work or is working in the HA-logs. Only find “Can’t connect to ESPHome API…” related to offline devices . Nothing about the device i’m currently trying to fix.

No error in the ESPhome plugin-log

Device log lists normal

I have similar experiences from about 2 days. Some ESPhome my switch shows as unavailable after restart. Now im on core-2021.9.6 - instalation on proxmox.

For me help next restart homeassistant but im looking for better way.

Hi Mathias,

are you using DHCP or fixed IP addresses ? When on DHCP, try fixed IP please and let us know ( you may need to add your ESP again to HA) .
There is a serious problem with the mDNS / DNS services in HA that the responsible guy is refusing to fix, according to other topics.
Let us know !

Hi :slight_smile:

I’m on fixed IP on my HA. But my ESPHome devices are not. It may look like I have been able to get it working again. It seems like it’s related to that some of my devices is configures new in ESPHome, but has been used before in an other integration used some time ago. Some kind of re-use problem, maybe. I haven’t really investigated it well, but it may be caused by HA using IP and not the device address.

One of my devices suddenly got unavailable i HA while still online in ESPHome. Deleting it in HA and adding it again with address and not IP it started working again.

Looking at my logs I eventually found one thing that was a bit weird. HA tried to connect to a device with the wrong IP-address so it seems like it was using IP and not the generated device_name.local address.

Also worth to mention that I installed ESPHome 2021.9.0 today before trying to fix the problem. Have no idea if this has anything to do with it.

Anyways, I think the DHCP issue you mention probably has something to do with this.

That is a weird thing to say without a pointer to the evidence.

That is a weird thing to say without a pointer to the evidence.

I can agree with that

I’ll mark my own post as solution even if it’s not actually a solution.

There is an issue with mDNS…
But probably it is my network; I use my own DNS and DHCP.

However, I did overcome the connecting issue with ESPHome by adding the domain to ESPHome config:

wifi:
  ssid: !secret wifi_ssid1
  password: !secret wifi_password
  domain: .home.my

On top of that, I use IP reservation on my DHCP server…

Again no evidence.

It will take too much time to figure it out…
it is just that some ESPhome modules cannot be found on the network using

esp-name.local

(weird is…some, not all)
I can ping them by ip, but not by local name.

When I added domain to the config, the units respond fine to

esp-name.home.my

Never took the effort to debug, as specifying the domain works for me.

@nickrout However, it does proof to me that mDNS doesn’t work flawless

I used DHCP for all my esphome. This problem in my installation is very rar so i cant confirm this will help.

Oh, but there is, it is just being ignored ! :frowning:

just read the issues in Issues · home-assistant/plugin-dns (github.com)

or my own issue : .local named devices (i.e. ESPHOME devices) only resolve for a few minutes after booting HA

You’ll find answers like : if you don’t like it, use HA Container instead of Home Assistant Operating System which IS the Recommended installation method so asking to fix that, is not that crazy is it ?
Or : make a pull request (sure, like we are all capable of that !)
Or blocking the agitator …

same issue with the (unwanted) hardcoded link to external DNS’s , it’s just not beeing taken care off !

The above is SO NOT HomeAssistant worthy ! Other issues are taken care off with full enthusiasm , DNS is just being neglected :frowning:

This claimed (not by you)

This needs clarifying

1 Like

also have a look in the DNS log under supervisor / system / logbooks