Entity name_override or device name displayed in Lovelace Entities card

Hi,

Entities card (and others such as Glance card) displays:

  • the entity_name_override if defined
  • the device_name_type-entity (device which owns the entity), otherwise

I would expect entity_id in this last case. Am I missing a hidden logic to do this way ?

1 Like

Not sure what you are asking.

If you provide name in the entity row:

- type: entities
  entities:
  - entity: sensor.my_blah_blah
    name: My Sensor

the name will override sensor.my_blah_blah's friendly_name in the ui.

friendly_name is created by the user. If not, it defaults to the object_id of sensor.my_blah_blah, which is my_blah_blah.

I have no idea where you’re getting: entity_name_override, device_name_type, or name_override as those are not valid entries/fields for entity inside entities or glance configurations.

2 Likes

Thanks you to help me.

Let say I have a device named my_device and the corresponding entity named switch.toto with the override name my_switch.
In this case entity card displays my_switch.
If there is no override name, entity card displays my_device_switch instead of switch.toto.

it will display my_device. Nothing in the UI will ever show the entity_id unless you specify that as the friendly_name.

Well, override name just above the entity id into the entity dialog windows let believe it is an override of the name of the entity, not the name of the device.

NB. It displays my_device_switch, not just my_device.

It is not. It overrides the friendly name. If you want to override the entity_id you use the entity_id field below it. It’s pretty clear about that.

I understood : I though the override name was the friendly name…

Yes it is… I’ve said that bout 400000000000 times now. What are you not understanding?

item description example
domain type of the device, i.e. light, switch, etc. light
object_id unique name inside the <domain> living_room
entity_id <domain>.<object_id>: A unique identifier that is unlike all other entity_id’s. light.living_room
friendly_name attribute that holds the name inside a state object. This is what you see in the UI Living Room Light
Override Name This is where you set the friendly_name in the UI. Living Room Light
name This is only inside the configuration of the device in lovelace or in the integration itself Living Room Light

friendly_name attribute, override name in UI, name in configurations are all the same and have nothing to do with the domain, object_id, or entity_id. These “names” are what you see in the UI.

Thank you for the very clear explanation !

Hi, is it possible to automatically change the friendly name of a card based on a sensor?
Thank you

based on a sensor value?

yes.

for example add a sensor value to friendly name

You’d have to use the (custom)100% template card, (custom) jinja template card, or make a template sensor.

will check, thank you

That’s how it always worked for me.
Now that I switched to a ui-lovelace file instead of managing it directly in the browser, something seems to have broken this logic.

Sensors shown on these cards show the entity_id.

At first I thought that I messed up the customizations. But when I click a card, it does show a configured friendly name for the sensor. Screenshot_2020-06-05 Home Assistant

Another option was that the custom mini graph card I’m using doesn’t handle friendly names, but even adding the default Sensor card shows the same entity_id instead of friendly name.

That doesn’t more info look correct. The attribute should appear on the left and the attributes value will be on the right.

You’ll have to show your configuration for these

In my configuration.yaml:

homeassistant:
  packages: !include_dir_named integrations
  customize: !include_dir_named customizations/entities

In the entities directory I have a .yaml for each entity I wanted a customized name. So for the living room sensor the file name is sensor.aqara_thp_living_room.yaml with the following contents:

sensor.aqara_thp_living_room:
  friendly_name: Temperatuur

UPDATE
Issue resolved. I needed to use include_dir_merge_named instead of include_dir_named.

@pedro ironic I am speaking to you on two forums.

Question related to this, on the default entities card, when a card’s name is specified by the area, it takes away the area’s name from any entities that share that (like Living Room Light becomes just “Light” in the Living Room card). I am trying to replicate this on my light dashboard. Do you know how I can accomplish this? I’ve not done too much digging so feel free to just link me in the right direction.

Edit: real-world I want to remove "Dining Room: from each of these:

1 Like

Bump, does anyone know how the default lovelace setup removes the area name from the cards when named with the area in the device name (see prior post).

You can remove that text and the toggle to the right by deselecting the “header toggle”.