This entity does not have a unique ID

An example: With an unique id you can rename the sensor in the frontend.
But you are right: these are problems on a very high level.

Interesting. You are right. For the command_line sensor the attribute is not working .

That is why it has a name: configuration variable.

@nickrout It does not cause any operational issues, but it is just one of those imperfections that I trip over. When I saw it the first time, I spend a fair amount of time trying to find a solution. Turns out I’m not the only one, this discussion exists solely for that same reason. And this will continue to confuse many to come in future.

Perhaps all this can be avoided if the message saying that the entity cannot be managed because it does not have an entity_id (which it obviously has, as you also stated), simply say that entities of this type can’t be managed in the Entities view and must be customized using the Customizations menu instead. Simple, not confusing and actually helpful.

2 Likes

What I would ask devs for is, why they invented another unique identifier which is redundant to entity name (ie light.kitchen). Why the latter cannot be used by Lovelace?

Can you clarify?

domain.entity makes unique identifier across whole HA.
entity id this thread os about is something added later for some reasons. It breaks paradigm of one unique identifier needed to identify every object in the system.

I would like to know motivation, which btw leads to further issues and missleadings.

I don’t see any troubles here if you just use the UI, in that case the entity ID and unique ID are auto generated when you set up an integration. Personally I don’t bother adding the unique_id field. And entity IDs came before unique IDs.

I think this thread proves opposite.
Anyway I asked different question and provided clarification when you asked for. It was about why the application needs 2 unique redundant identifiers.

An entity_id is not a unique identifier. You can change entity_id and you can get a new switch and name it the same as an old one.

unique_id is unique.

unique_id is unique for entities which have this identifier set. As we know it doesn’t apply for all entities therefore cannot be used as object identifier.
But for ALL devices, entity_id is the valid unique identifier.
Why one would want to ensure an uniqueness of idents of objects which don’t co-exist at the same time? So far the only feature making use of that is renaming of entity_id. But this can be done several ways without breaking patterns.

So far we have a system (HA) which have:

  1. an object identifier which is not being accepted by part of the system (ie GUI)
  2. an object identifier which is missing from a lot of entities

Not sure you see my the point.
Again: I would like to know what was the motivation for such approach.

Try @mentioning core devs or creating a new topic.

No, do not @ people in please.

I suspect it is an historical artefact. The unique_id was introduced to make GUI configuration stuff work. It has not existed and was not needed before that.

1 Like

It not needed to user, so it should be removed. (Or make it invisible in some storage file, not in yaml) Items which created in yaml and added as new integration must work same. It’s very strange, when you have only smartphone, want to move item in another room, and it doesn’t work because of such Id. Everything must have names, names must work as Id. Maybe some old integration without names must received timestamp internal Id, and user should see warning: please fill name

I have no idea what you are talking about any more. If you think something should change, submit a PR.

In the meantime please note that demands to the community or the devs just shouldn’t happen, eg

1 Like

We don’t know, why developers made entity_id, to develop something, because developers are at github. Also, to change the implementation of such basic things as entity_id, you need to be not just a developer, but an architect. Therefore, it is better to transfer the discussion of such feature requests to Github, so there are more developers, and we will understand why certain things were done.

Can someone please provide the proper configuration.yaml code needed for me to assign unique IDs to four Leviton light switches?

The entity IDs are:
light.den
light.upstairs
light.tree
light.entry

The Leviton integration entry in my current configuration.yaml:

light:
  - platform: decora_wifi
    username: [email protected]
    password: my_leviton_password_xxxx

Hey gilbert-grape,
Can you please help with the proper syntax to use for adding the unique_id to the configuration.yaml file? I have 4 light switches that do not have an intergration for them and had to add to configuration.yaml manually:

Just add the attribute unique_id. Here an example of my light bulb:
the file configuration.yaml change from:

light:
  - platform: mystrom
    host: 192.168.1.120 # Mac: 60:01:94:2C:50:AF
    mac: 6001942C50AF

to new with unique_id:

light:
  - unique_id: 123light123
    platform: mystrom
    host: 192.168.1.120 # Mac: 60:01:94:2C:50:AF
    mac: 6001942C50AF

BUT: It looks like the integration must provide or accept the unique_id. So sometimes it works. Or in my example I get an error. So first check unter the menu Configuration->Server Control “Check configuration”. You get then an error if the integration do not accept your attribute.
Good luck!

Thanks!!

Are you controlling this device locally and not through its native web host?