or if all goes well 1000, 10,000 appliances
I wanted to do this as well, and for my case, a Light group works well, as it is a light that I would like to alias. For those looking, this is how you specify a light group, it isnt as a regular group Group - Home Assistant.
My reason for aliasing is I am a stubborn holdout of the YAML file, and I would like to configure it in the yaml file so that If i need to set it up again, I dont need to remember to rename itā¦ this already happened twice this year, and I would like to automate it my way.
This is in the current beta
Hi!!
+1 to what Martin was saying (long ago).
If you rename an entity, 2 things happen:
- If you happen to have history/data with the original ID, your data will be truncated/splitted/broken
- You depend on the DB and integration to that renaming, so if anything happens there (which it just did for me with Zigbee2MQTT), you lose all those renamings and from that point on, you know what is like.
So an alias entity would solve this, and leaving best dev practices, mutation, etc, aside, at least a hard renaming made in a Yaml file (with point name and destination name) would be more secure and agnostic to any db or integration/addon problem.
No, history now follows the entity_id if you rename the entity_id inside the HA interface.
Did you change something in Z2M? If you change entity_idās through the UI the history will follow on all databases.
IF you mess something up on Z2M discovery by changing names in Z2M, that will not follow because youāre changing the discovery. You should change your names in HA only if you have history you want to preserve.
FYI the entity_id currently is an alias and the request @jms3000 is asking for already exists in the system.
All entities UI have an entry_id
, this is what the UI uses to track things. The entry also contains the database metadata key. This is how the history follows the entity_id when you rename things.
I found this request while looking to solve a similar problem. I have a Broadink IR controller in my living room that provides a temperature reading as well. The entity is named ābroadlink temperatureā and I also want to refer to it as the āliving room temperatureā. My solution is to use a simple sensor Template that provides the right encapsulation:
template:
- sensor:
- name: "Living room temperature"
unique_id: "living-room-temperature"
unit_of_measurement: "Ā°F"
state_class: "measurement"
device_class: "temperature"
state: "{{ states('sensor.broadlink_temperature') }}"
Iām happy with this because it lets me refer to both the physical type of the sensor and its logical use. If they separate in the future, Iāll simply change the template.
it would be a little bit easier if you could write:
alias:
- sensor:
- name: "Living room temperature"
entity_id: sensor.broadlink_temperature