ESP32 connected, but unavailable in frontend

Ok thanks, I will try your steps tomorrow.

The main question I think about is why HA will lose contact with the integration. I dont get any errormessages but I really would like to understand why HA is consider it Unavailable?? Could it be a missmatch on IP addr, hostname, or unable to logon to the esphome via api???

Lote of potential reasons:

  • Wifi dropout
  • bug in esphome code (update to 1.15dev)
  • esp32 cams can be flaky. They transmit an awful lot of data for an esp, and I get the impression it’s just all too much.
  • they also get very hot and sometimes need a heatsink.

Ok thanks for the suggestions!
In my situation with just a esp32, sonoff s20 outlet I believe it is something else and related to the HA integration especially as I can turn on/off via the switch and also access it through the EspHome application.
Now to what I did to get it back into HA:
I deleted the integration via the Configuration+Integrations GUI.
Got back to Configurations+Integrations GUI and selected the (+) icon, selected EspHome, entered the device IP adress plus the API password.
And voila, it was back under HA again!!
I have understood that HA keep track on all entity, even old, not used so the new entityID was all ended with a number 2 to diffentiate from the old one - but I can live with that or change it manually if neccessary.

1 Like

I found big differences in Wi-fi sensitivity between supposedly the same module but purchased from different suppliers.
Ref…

Hi, what would your recommendation be if not deleting the integration and re-adding it ? I have the same problem, in Esphome everything looks healthy, data is visible in the live logs, but the entities are always unavailable for one device. Another device works fine. What would your steps be to fix this ?

You likely have network problem. Is mDNS working?

Hi, thanks for coming back. I do not think this is a network problem.
In Home Assistant (:8123), Esphome tab, I can open the log window to this device. That log window shows regular data updates. I can also upload a new compiled configuration to the device. So there is network connectivity. What I failed to mention is that it all has worked. It is just a DHT11 humidity and temperature measurement using an ESP8266.
For me the problem is in the entity list. It sticks to an old version of the entities under the ESPHome integration and they are forever unvailable. This is why I think throwing away and reinstalling Esphome may help. But I think it is a stupid method. How can I ‘refresh’, rebuild, the entities list ? Or debug / troubleshoot it ? I have removed the homeassistant.xxxx.db (which is automatically rebuilt) and that did not help anything. I also changed the names of my entities in the specific device’s configuration (yaml), with upload, and that is not reflected either.
I am running Home assistant OS 4.15, core 0.116.4 on a RPi 3B.

What happens if you delete it in ha|intergrations and then re-add it?

If I understand correct, you need to remove the entities from Home Assistants register?

I’m not in front of my set up so I can’t double check this, but you should be able to remove them from core.entity_registry file.

It’s under folder “config” then subfolder “.storage”

Just copy it to another folder first as backup, and then carefully remove the entity. Usually each entity will start with curly bracket { and will end with curly bracket and comma },

So

{
bla
blabla
bla
},

Then restart and hopefully it works.

Hope that helps.

Thanks for instructions. I am pretty sure this is exactly what I need. Only thing is, the .storage folder is not accessible from the file editor. Do I need to connect monitor and keyboard to the Rpi and login there ? Or is there a more practical way ? Thanks again.

I guess you can do it that way, or SSH.

The way I prefer is with Samba share, it allows you to access the folders over network.
It’s an add-on you can install here : “Supervisor --> Add-on Store --> Samba Share”.
That way you can also copy the files over to your Windows/Mac for backup, before editing them.

For me, using a Mac, it looks like this ;

.Storage is a hidden folder, so you need to allow windows/mac to show hidden folders. Quick google search shows how.

Thanks again, I am on my way with terminal now as well. I have the Samba add on, thought it was limited to a media folder. I’ll try to ask no more newby questions.

Hi, I’m having the exact same issue with an esp8266 outlet. It becomes unavailable from HA, but in Esphome tab it is available and working on the network as intended as well. The one thing I can do to make it available in HA again is a simple restart of HA. Restarting the outlet makes no difference.

So from my end it seems like there is something internal in HA that is failing.

I have about 11 of the same outlets and it is only one of them that are doing this randomly.

Dont know if any one still struggles with the problem that the ESP entities stay unavailable.
I found another fix that did the trick for me with a few ESP entities which wouldnt want to listen :slight_smile:

In Settings -> Integration -> ESPhome there you will find you entities of your ESPhome setup.

Going deeper inside and selecting/pressing the affected entity , you can change the internal settings: (sorry for the dutch picture but you will get the idea :wink: )


So switch off the entity here. Press the adjust/save button.

After that do the procedure again by switching the entity on again. Save it and you will get a nice pop up with a notify that says it will be re-added within 30 secs.

image

That’s how I got a couple of mine ESP back in the air.

4 Likes

Thank you for bringing this out!
Worked for me on ESP32 bluetooth node (Xiaomi BLE temp sensors were unavailable in the UI, but in ESPHome log mode the node read the sensor infos)
Sad thing is, that after every server restart, the sensors info becomes unavailable again.

Hmmm strange behavior , I also have Xiaomi BLE sensor readout through ESP32 with BLE.
I only experience sometimes that it takes a while to load the entity after a server restart.
Not that it fully comes unavailable.

There will not be a sensor value until the xiaomi sends one.

I’m having the same issues wrt to this topic, esp8266 (wemos d1, or sonoff’s) have been migrating from tasmota to esphome, it’s going very well, but do get these issues, the esphome logs show the device is up and reporting sensor values, but the integration is showing in-available, deleting the integration, adding it in again “fixes” the problem but it occurs randomly on different devices at different times… I suspect ( not an expert here) if may be an mdns issue but I don’t know why… should there be only one mdns “server” on my home network? And how would I know? Any and all suggestions would be very welcome before starting to think about learning wireshark and seeing what’s going on on ggf network… ( I know mdns is “working” on my network as I get ping responses from : ping homeassistant.local from various different machines)

Same issue: I have several esphome instances. They all work, except one for which all entities are suddenly unavailable. Use to work for years, and when it stopped I had not made any changes to my HomeAssistant configuration in several month.

I’ve already tried deleting and re-adding the instance, no help. I can connect just fine, upload code, etc, it’s just that the entities show unavailable.

Suggestions for diagnosing this problem would be most appreciated!

I managed to fix the issue by deleting the integration from the Configuration page, rather than ESPHome. Verified that all entities are gone. Now recreated the application from ESPHome and manually (since I use a static ip) added it from Integrations.

1 Like