HA renamed ESPHome entities after removing and adding a device

Accidentely I removed one ESPHome device via the HA integration page from ESPHome and readded it after it was newly detected. So far so good.

Then I detected that all the entities of this device were renamed from e.g. binary_sensor.l2_bathroom01a_reed_01 to binary_sensor.l2bathroom01a_l2_bathroom01a_reed_01 . I do not know where the compressed prefix “l2bathroom01a” comes from. I only remember that I came across an option to prefix an entity with the device name in ESPHome. But as I did not change the firmware of the device nor HA it remains a puzzle to me.

I recompiled the firmware before removing the ESPHome device, but not change nor recompile the YAML between the remove/readd. I use the latest HA version and the latest docker image of ESPHome btw.

Has anyone an idea how it came or how I can undo this?

It is the name of the device. This is how entity ids (and names) are generated when you add a device now. domain.<device_name>_<sensor_name>

It is stupid and unneeded but this is how all other integrations work so ESPHome has to fall in line too. :roll_eyes:

There are mitigations planned for the ESPHome Builder config but they are not released yet.

There’s another topic here: HA 2025.5 ESPHome device names now on frontend

You can manually edit the names and entity_ids in Home Assistant. Be thankful it is only one device. This has affected people with thousands of names to change.

1 Like

Thanks for the reply and the link!

I shall share a secret with you: I have more than one ESP device and successfully f-d up three of them to prove the that’s a feature and not a bug. :wink:

I somehow feel compelled to send out a special thank you to the HA team for not warning ppl efficiently. :sweat_smile: