How to remove ESPHome entities?

I am cleaning up some entities that were left behind after some changes in my devices. Specifically, I used to have an Sonoff Basic flashed with ESPHome that I added via the ESPHome integration. It worked great.

I replaced the switch by a MEROSS one (which also works great) but I now have the old entity as unavailable. This is understandable as the Sonoff is not there anymore (for now at least).

How can I delete that entity?

I see it on the integration screen:

image

When clicking on the device, I see it in the list (note: I chnaged its name when I was using it to something more descriptive)

Finally choosing that device I get to its main configuration screen:

I expected to find under the upper-right cog a “delete” entry, but there is none:

So how to delete this leftover entity?

I was wondering whether that should be done on the first screen, this screen has a delete entry but I am afraid to delete the WHOLE ESPHome integration, with all the other devices that rely on it. Would this delete only that entry?

If you delete an esphome device you can always add it back (integrations: ip address).

I do it all the time. Changing something on my esphome config, entity changes… delete esphome in integration and add it back.

3 Likes

@sender Thanks - so choosing “delete” removes only the entity that is displayed, right? Not the whole integration with all its entities? (which I would like to keep - just remove that one)

It remove the device yes, and thus the entities.

See it as “every esphome device is it’s own integration”.

I have around 40 devices, rhus integeafion and when I click 1 devices and delete it all entities of that devide are deleted.

Some devices have 16 entties with me…

Thank you. it is clear. I meant “devices” when writing “entities”.

I just tried it and it works - I will not spend the light reconfiguring the whole house

Thank you! I had no idea this was how it was done. I was knocking my head trying to figure out why ESPHome wasn’t auto-detecting the device after removal and assumed “Add Integration” was not the right path as the integration was already added; I was trying to add a device.

1 Like

Although the OP was happy, I couldn’t replicate this. But I figured it out.
To manually add a esphome device add the ESPHome integration and use the device/node name + .local.
For example if the esp device is called esphome-web-cf1748, use esphome-web-cf1748.local.

Or IP address of the Esphome node

My problem was with the ability to remove ESPHome devices and it boiled down to the definition of “delete integration” (which I thought to be “remove ESPHome from HA entirely”, while it means “remove the ESPHome device”).

Your problem is not with ESPHome or HA but with the way devices’s names are recognized (and ultimately converted into IP addresses). a device name hello will be recognized only if there is, in the network configuration shared by all devices, a way to convert the device name into a “full name” (called FQDN - Fully Qualified Domain Name), which in turn can be translated to an IP address (which is the actual way devices talk to each other).

Some configurations “tell” devices that they need to add such and such domain name to device names when trying to resolve them (convert the name into an IP address). Some don’t.
If yours don’t, you need to explicitly use the full name (hello.local in your case, where .local is the domain name).

It is alwaysÂą a good idea to use FQDNs instead of device names (and hope for the best, that is to have this automatic domain postfixing).


¹ as with everything in life, “always” does not work all the time. One case where you would be better of not using FQDNs is if you change your whole domain (say, .local to mydomain.example.com) - you would need to reconfigure all devices that used the old FQDN. But this is really a marginal situation and what bites you is usually the inability to resolve because of the short names. This becomes a nightmare in setups that live for a time.

Yeah, very good.
To be complete: I actually started with the same problem as the OP (how to remove entities/devices) and understood that removing the “integration” was the solution. But how to manually add? I tried localhost as host, but of course the mindshift to esp-device rather than esp-addon means you need the esp-device-ip (or name).