Names, IDs, and Usability

Is it just me or does the underlying model for HA conflate and confuse “IDs” and “names”? In my experience, an ID should be unique, (largely) immutable, and internal - that is, never shown in the UI (voice assistance is a non-visual UI). In contrast, “names” are things that change easily and are appropriate for using in UIs.

In this context, it’s odd that the “ID” is exposed to the Alexa voice assistant rather than the name. Can someone explain how I should think about the relationship between these two concepts in HA?

That is how Home Assistant uses Unique IDs.

Names, and in most instances entity ids are user configurable.

If it exposed the name the link would break if the name was changed.

I’m relatively new to HA and struggled with this also, especially because I migrated other integrations from another system and had names for things. I had a few false starts with how the names work and I tripped a little not understanding it:

  • Device Name – The name of the physical device (e.g., the whole smart plug or sensor). The familiar, friendly name

  • Entity Name – The name of each individual entity the device exposes (e.g., switch, sensor, battery). Can have a manufacturer provided prefix like light. , switch., fan. etc
    This is the specific name you automations use like:
    fan.master_bath
    It has limitations like no spaces, only certain characters.

  • Area – The room or location you assign the device to (e.g., Kitchen, Bedroom). This is a key concept to HA, Figure that out, what you want the names to be

I’m pretty new to the ecosystem so this may be naive, but I would expect the voice assistant integration to be able to detect such changes and automatically update them - or, if not, that we could remove the voice assistant, (unexpose?) and then restore it under the new name. (I would like things to remain consistent, so I’d like the same name in HA in my dashboards and in Alexa, so I don’t want to change the names in Alexa.)

I’m using Aqara H2 switches, so each device has two “switch” entities, and it’s the switch entities I need to expose to voice assistant. Each entity also has both an ID and a name, and as best I can figure through experimentation, the name is more or less ignored by the voice assistant UI.

You still have not told us if this is the unique id or entity id.

Totally fair. That’s largely because I was unaware there was a difference! (Sorry) I was referring to the entity ID and name.

What is the “unique ID”?

It is what enables you to change the entity id. The unique id never changes. You don’t get to see it. It is used in the hidden device registry.

If you are using HA Cloud, you can un-expose an entity, update it’s name, then re-expose it, and Alexa will usually pick up the new name. You may need to initiate a device discovery. I’m not sure if the other exposure methods (i.e. not HA Cloud) allow the same kind of operation.

Just FYI, Alexa has a history of poor handling of “devices”, so the old ones don’t always get removed automatically. Occasionally devices can’t be removed at all unless you take the nuclear option and remove all devices. This is a long-standing issue unrelated to HA.