it might be a stupid question but i am having issues setting “names” and “friendly names” in HA.
I am about to get my template and MQTT sensors out of my main configuration.yaml by using mqtt.yaml and template.yaml. I wanted to “pretty up” the sensors while i was at it… The main goal was to get a sensor name like sensor.livingroom_us_adjust_temp with a corresponding fiendly_name of Eingestellte Temperatur Wohnzimmer. For this i tried it this way:
#### Auslesen Temperatur Wohnzimmer ######################################
- name: Eingestellte Temperatur Wohnzimmer
unique_id: livingroom_us_adjust_temp
unit_of_measurement: °C
device_class: temperature
state: "{{ state_attr('climate.livingroom_us_radiator', 'current_heating_setpoint')}}"
Is it just not possible to do it as i want or am i going at it the wrong way?
The Main reason for this would be, that i wanted clean “unique” names but still use the german words for friendly use.
The entity id will be created from the slugified name. So
name: Eingestellte Temperatur Wohnzimmer
Will produce:
sensor.eingestellte_temperatur_wohnzimmer
To do what you want you have to set the name to the entity_id you want:
- name: livingroom_us_adjust_temp
Which will produce sensor.sensor.livingroom_us_adjust_temp with an unwanted name of “livingroom_us_adjust_temp”.
Then using customise set the friendly name you want:
configuration.yaml
homeassistant:
customize: !include customize.yaml
customize.yaml
sensor.livingroom_us_adjust_temp:
friendly_name: Eingestellte Temperatur Wohnzimmer
Where I did this (due to entity_id backwards compatibility when moving to the new template format) I included a comment in the sensor to remind future me, e.g.