Renaming Devices

I’ve been using default device names/entity names for all my motion detectors. I already have dozens of automations and scripts in place related to these motion detectors.

I just renamed the device names for each motion detector to make it easier to identify them. However, I was too scared to select “rename” the respective entity names when prompted with the question below:

Questions:

  1. If I were to rename the respective entities in the screenshot above, would this immediately break all my current scripts, automations, and Lovelace cards related to these entities… requiring me to change every single occurrence that mentions these entities?

  2. If I choose to rename all the entity names in the screenshot above, is there an easy way to fix all my scripts, automations, and Lovelace cards, etc… still referring to all the old entity names? I’m guessing if there isn’t an easy way to do this, most people would simply choose to NOT rename entity names, only device names.

  3. If I already renamed the device names, but didn’t rename respective entity names… but, later decide I want to rename the entity names to match the device names (and willing to change all my scripts, automations, cards, etc), what’s the easiest way to do that?

You can always open the files (configuration, automations and so on) in notepad and do a search and replace then reboot HA.
That way every instance of the names will be changed. Just be sure that you don’t have some very similar names that could cause issues

  1. Yes

  2. No

  3. If you decide to rename the entities later then you could rename the device twice and take the option to rename the entities on the second time.

My advice would be to take the short term pain now to get nicely named entities. For each new device type that I have I get myself a naming standard. The usual suspects are the battery levels which I always rename to battery_level

examples of mine

device: Master Bedroom Motion Sensor

entity: Master Bedroom Motion Sensor
binary_sensor.master_bedroom_motion_sensor

entity: Master Bedroom Motion Sensor Battery Level
sensor.master_bedroom_motion_sensor_battery_level

Having all types named the same way really helps when you do filters etc

1 Like

Thanks. I’m not motivated to create additional work for me. I already spend WAY too much time keeping up with breaking changes in HA and respective integrations; which seem to happen regularly. For example, I haven’t migrated all my z-wave devices/entities to z-wave JS.

1 Like