How to rename an entity?

I have entities with auto generated names, such as Zigbee sensors. I would like to make sure I know which sensor refers to which “physical place”.

I found two places where I can rename these entities (“rename” is probably not the right word, it is rather an alias or a friendly name (depending on the place) as the original name is still available).

The first one is via the “Entity Registry” in “Configuration” on the front-end. It seems that the name is changed in an internal database ./.storage/core.entity_registry

The second one is via “Personnalisation” (same place). The friendly name is added to customize.yaml.

Which one should be used?
Are they equivalent?
Do both cover all the places names appear?

All the tools for renaming entity_id’s and friendly names are now accessible from the UI. No need to modify entity registry files.

image

Sorry for shitty handwriting.

2 Likes

Thank you. So that would be a third way to set this up.
It looks like it combines the others. From the same path as in your step-by-step images (thanks for that, the handwriting is fine :)) I see

image

loggia_battery was set in Configuration --> Personnalisation

loggia batterie was set in Configuration --> Entity Registry

I will try to remove all the personnalisation / friendly naming I did and go your way to see how this is reflected in the frontend. EDIT: it is reflected perfectly.

1 Like

This works as long as your entity generates a unique ID. More and more platforms do that now.
In case you come accross one that doesn’t, I am looking at you efergy, you can fall back to the way you started out.

1 Like

For anyone else who gets here through the same misunderstandings as me…

For some reason you can’t change some entity names in the UI (for me they’re MQTT ones through Mosquitto, perhaps that’s it).
You CAN change them in customize.yaml
It took me a while to realise that this doesn’t exist by default.
Create it in the same folder as the others.
Add this to config.yaml:

homeassistant:
  customize: !include customize.yaml

Then add things like this to customize.yaml:

thermostat.family_room:
   entity_picture: https://example.com/images/nest.jpg
   friendly_name: Nest

Any way to change the entity name (not the friendly name) in the yaml file? I have all my coolmaster devices listed with just numbers, and i rather rename them to the actual rooms.

That depends on the integration. Some allow you to change the entity_id, some don’t.

Thank you for showing how to rename via UI.

But if I try it this way, I’ll get the message “Invalid entity ID”, when I try to save it. (HAOS on x86)

Any ideas why?

What are you renaming it to? There are some rules regarding symbols you arent allowed to use.

Yes, you’re probably using spaces or invalid charactesr. entity_id’s can only be the following characters:

abcdefghijklmnopqrstuvwxyz_

Nothing else, that includes spaces, capitals, and odd characters.