How to fast rename multiple entities

Hi, I’m setting up assistant for comercial facility which requaires few hundred of entities coming from devices sensors. How can I configure them effectively? Lets say I come up with new naming or icon convention and want to reconfigure all from scratch. I dont want to open a dialog window for each row from the UI but rather deal with it in a file controlled from VS Code or Notepad++.

Or perhaps annother/additional solution:
When adding Zigbee devices throught ZHA integration I see there is something which tells assistant what default names and other properties to generate. Where can I find the file responsible for that and can I edit it?

Or there is a way to overwrite default UI configuration in configuration.yaml? If yes how?
I’m new, not sure how things works yet so far.
Thanks

If you want to reconfigure a large number of entities in your home assistant setup, the best way to do so would be to use a configuration file. In Home Assistant, the configuration file is typically called configuration.yaml and it is located in the config directory.

It’s important to note that the configuration.yaml file is just one of the many files that make up the Home Assistant configuration. There may be other files, such as secrets.yaml or automations.yaml, that contain additional configuration information. Additionally, some integrations may use their own configuration files, which you can also edit to customize their behavior.

If you are adding new custom entities, you will need to add the appropriate entries to the configuration file. For example, if you are adding new sensors, you will need to add a sensor entry to the configuration file for each sensor you want to add. Each entry should include the relevant details, such as the name and type of the sensor.

As for the default names and properties that are generated when adding Zigbee devices through the ZHA integration, these are typically defined in the ZHA integration itself. You can find the relevant files for the ZHA integration in the custom_components directory of your Home Assistant installation. However, it is not recommended to modify these files directly, as doing so could cause issues with the integration.

If you want to customize the default names and properties that are generated for your Zigbee devices, you can do so by adding the appropriate entries to your configuration.yaml file. For example, you could add a zha entry to the configuration file, where you can specify the default names and properties for your Zigbee devices.

In summary, the configuration file is a powerful tool for managing and customizing your Home Assistant setup. By editing the configuration.yaml file and any other relevant configuration files, you can customize the behavior of your Home Assistant entities and integrations to suit your needs. However, it’s important to be careful when making changes to these files, as errors could cause issues with your system.

It’s also worth mentioning that, while editing the configuration file manually can be a powerful and flexible way to customize your Home Assistant setup, it can also be prone to errors. If you make a mistake in the configuration file, it could cause issues with your Home Assistant setup. For this reason, it’s important to make backups of your configuration files and to test any changes you make before applying them to your live system.

1 Like

Thank you for response Juan :slight_smile:
I actually didn’t look into my post in here last few days as I haven’t seen any response coming down for a while and started to dig it on by myself a bit.

So, yeah I got you.
Your solution works for me except I cant configure certain things the way I want: for example I would like humidity sensor to round up/down the values.
I’m currently using templates for it like that:

  - platform: template
    sensors:
      gr_humidity: {friendly_name: "Grow Room", value_template: "{{ (states('sensor.a01_humidity') | float - 0) | round(0) }}"}

So that works but its like I’m creating an extra sensor for each actual one. That makes the config file messy and doubles everything. Beside that I’m big fan of Object Oriented Programing so I would prefer to have the code encapsulated as far as possible.

I saw people using templating directly in config without creating another template sensor on top of existing one but getting lost with it. Could you or others please help me on that.

Could you share an example of this so that we can see what you mean?

That was custom-ui add on. I have tried it 2 weeks ago but as newbie I couldn’t wrap my mind around it. If remember correctly I couldn’t understand how to install it. Maybe it just doesn’t work with Home Assistant Core 2022.12.7 or Home Assistant Operating System 9.4 ?

@kd2000 as far as I’m aware the modification of entity values can only be done by way of templates. I do understand your frustration regarding recreating the same entity twice…

PS: regarding customization of the UI, in 2022.12.4 release, there were some issues cited in the forum. This topic may be of assistance:

@bastero I took a glimpse of that topic but it mentions nothing about Custom UI add-on. It’s mostly about changing icon colors which in fact is changing a value but underlaying issue seams to be different.
I will take a better look if I can get Custom UI work and post again if I’m able to get something out of it.

While restructuring my smart home I wanted a safer and easier way to rename entities, so I made a script to bulk rename using regular expressions:

2 Likes