Bulk/Script Renaming Devices and Entities

Hi,
coming from FHEM I just started to use HA and I must say, that it is a game changer !

I have a setup where I connect HA to a Homematic CCU2. For various reasons I do not want to change the devicenames within the CCU… but the naming scheme of the devices in the CCU is chaos which is now automatically imported into HA.
Therefore I would like to change the device names and corresponding entities within HA (friendly name) using a proper naming scheme. Problem is that I am talking about 50+ devices.

in FHEM this was pretty straight forward as I had a CLI where I could just enter: “rename device_xyz to device_nicename” that way i could take my excel sheet and generate the commands to rename all devices in seconds.

Now I still have my Excel sheet with the names used in the CCU and the names I would like to use in HA. e.g.: Column A: device_xyz Column B: device_nicename Column C: command to rename device_xyz to device_nicename

Can anyone tell me, if there is an easy way to use this in HA. Either using a script, or executing a command to rename the devices and of course the corresponding entities.

I would like to do this in the very beginning to safe me some trouble later.

Help is much appreciated

1 Like