How does this happen? Two devices with the same name?

Any guess how this happens and how to fix it? This device is still on my workbench, so deleting and reflashing is no problem, but curious how this happens?

Hi Stephen, try to reload the ESPHome integration or restart HA.
I have experienced this too when fiddling with the ESP devices.

I’ve tried restarting Home Assistant. It even restarts for me at random times. But with 85 devices, am I risking anything by reloading the integration? Won’t some of the _2 entities that I have learned to live with lose their annoying _2 ID, breaking a number of automations?

esphome

I think what you see is the friendly name and that might not be unique.
The underlying name is probably different and not the same on the two devices.

2 Likes

In my case, it was something in the lines of updating the configuration of a ESP device and when I uploaded this config, I had a new discovered device that was discovered + the existing one was still there.
It was a little confusing and one of the aforementioned options solved it for me.

This is in the ESPHome integration right?
Have you checked the ESPHome app?

There is only one device. I made four of the boards for the DFRobot modules, and they are identical, but each has a different name. It is entirely possible that there were two devices with the same name online at once, but I have been pretty careful to avoid that.

Checked for what?

But, is there any risk to my ESPHome devices to reinstall ESPHome? My concern is all the devices with _2 and some _3 entity ID’s changing.

You might have been careful to avoid having multiple boards online at the same time, but that does not prevent it.
You might have disconnected a board, but due to the way a network works where there is no function to tell a network that a board is disconnected. That means the network will have to figure it out when a board has not responded for a while and in that time you switched boards and now got another board online, maybe even with the same IP address and/or mDNS name, so the network now thinks that both the current and the previous board is online.

Can no one answer this question?

No risk whatsoever. The addon is completely separate from the integration. The integration communicates directly with the devices, not the addon. Which is why reinstalling the addon is unlikely to fix your issue with the integration.

Uninstalling the addon does not delete the config/esphome directory (where your device files are), but if you want to be 100% sure copy it elsewhere before reinstalling.

Do both the duplicate devices contain valid entities?

If not just delete the device with no valid entities.

Actually looking closer, one of the duplicates contains only entities and no device. Check if that one actually has valid entities. If not then delete it from the integration (three dot icon to the right). If it does have valid entities, work out which device it is. Delete it from the Home assistant Integration, fix the config and re-upload it to the device. The valid device should then be discovered.

As Homer more appropriately says, “Doh!”.

My concern is because months ago there was discussion of how to remove the _2 suffixed entities. The solution was, according to my notes, to delete and reinstall the integration. I have many _2 devices that are represented in automations that I am wary of breaking.

OTOH, I do daily backups…

You mentioned you were going to

Which I took to mean the add-on not the integration. Though looking closer the context does indeed point to you talking about the integration.

Re-install the devices in the integration (delete and re-add) not the whole integration. This will not create duplicates as the original devices and entities are deleted are deleted first.

Were there any valid entities in the ESPHome integration instance with no device only entities?

Thanks, I will try this.