ZHA & Naming

I have been using ZHA for years and every time I add a new device it starts a naming odyssey.

  1. i start the search for new devices
  2. i start the pairing mode of the socket
  3. the search finds the socket
  4. i name the outlet as "cinema

I would have expected this naming to show up in the resulting sensors, instead the sensors are all named ‘sensor.tz3000_amdymr7l_ts011f_bebe0b58_electrical_measurement’ etc.

This makes it quite cumbersome to find the matching sensors…
Is there anything I can do to make this better?

Greetings, pattyland

The simplest way for me is to add the device and instead of trying to rename it on the subsequent pop up device window, simply go back to ZHA devices, find the new device, click on it to load the device page and then edit the name, when you click update it should pop up with the following prompt:

Do you also want to rename the entity IDs of your entities?

Job done.

1 Like

I’ve found that most times that doesn’t seem to work well (especially for ZHA devices?) and I end up having to manually rename all of the child entities.

Weird as seems to always work for me.

First of all, thank you for the answer! I also had in mind that there was this dialogue, but no longer knew when it comes.
Unfortunately, this method seems to work exclusively with controls. My sockets have one control, 5 sensors and 3 diagnostics units…

1 Like

This works for the names but not the entity_ids right? Just considering a migration to ZHA when I move to a SkyConnect stick… but this isn’t impressing me.

1 Like

agree this is an issue, the entity id’s need to be renamed individually and its not exactly friendly depending how you are using a device or entity the names are different and need to be manually changed in several different places, it would be ideal if when you added the device, the name you chose there was propagated to all of the entities etc…

So what I do is this. Let’s say the name comes up as Lumi Light and the entities are like light.lumi_light_switch and such.

I first rename the DEVICE to lumi_light, aka the prefix they are all using. When the popup comes up asking if I want to rename the entities, I say NO.

Now I rename the device again to what I want like Office Light. This time when it prompts to rename all the entities, I select YES.

This renames all of the entities, such as our Lumi Light device is named Office Light and the switch entity is named Office Light Switch and light.office_light_switch.

This works for me every time. Just name the device with the default prefix, and then name it and all the entities to what you want.

It is worth noting if one or two entities don’t get named right, just change them. You’ll lose the history so far but if you just set it up, it doesn’t matter.

1 Like

@zSprawl :raised_hands:

This is the way to go but hopefully one day this won’t be necessary!
The workflow for new devices will get a little better with time… Thanks to the code contributors!