Basic question of the day - friendly_name

What is the difference between
name: and
friendly_name:?

I don’t think I have ever used friendly_name: so maybe they are both the same?

I searched the Docs but couldn’t find anything (but the Docs search isn’t great in my experience).

Friendly name is something nicer than the name a device may automatically be assigned. Eg: my Xiaomi gateway gets picked up in HA and assigned the name ‘gateway3exejdi4u’ or whatever it is (that’s a random exaggeration) but I have assigned a friendly name of “Xiaomi gateway”.

Yes, but I’ve always used name: to do that and it seems to work.

e.g.

  # Public IP address
  - platform: dnsip      # sensor.myip
    name: Public IP Address

Unless… the difference is that name: will actually change the name of the component whereas friendly_name: only changes what it is actually displayed as in the front end?

In my example the underlying system generated name of the sensor is sensor.myip. Assigining a name as I have done changes the actual sensor name to sensor.public_ip_address.

Does friendly_name: only change what it is displayed as?

Some entities are given names automatically by HA on discovery or by platform or for whatever other reason. In those cases you can give them a friendly name to display it in the GUI in a more …friendly…way. If you don’t give it a friendly name then it will use the default generated name in GUI.

Some are given names by you when you create the entity so those don’t need friendly names since it is assumed that you will give it the name you want to see when you create it.

It’s not entirely consistent on the way it works but that’s generally the gist of it.