This entity does not have a unique ID

Hello all,

I am getting “This entity does not have a unique ID” on a few switches.

Where can I set these ID’s?

Many thanks
Boyd

2 Likes

entity_id and friendly name of supported entities.

https://www.home-assistant.io/docs/configuration/customizing-devices/#changing-the-entity_id

Thank you. Unfortunately, I’m still at a loss as to what to do.

I’m trying to set ‘entity_id’ 's for devices which are liisted within my config file. I use them for Wake On LAN. They automatically appear within Entities but complain that no unique ID has been allocated.

Here is an example; NAS1 being the device without an entity_id:

‘’’

  • platform: wake_on_lan
    mac: “00-08-9B-BF-61-1A”
    name: “nas1”
    host: “192.168.111.100”
    broadcast_address: “255.255.255.255”
    ‘’’

Could you please give me an example of what code to place into my config to manually set the ID.

Many thanks

Can you post your config file. It’s very hard so say anything without seeing a code.

Where are you seeing this message?

Within Configuration - Entities.

The Wake-On-Lan devices appear there and if I click on them I see ‘This entity does not have a unique ID’.

I believe, however, that this is by design and not an actual fault. I read on one of the release notes that all devices will appear within the entities list even if they do not have a unique ID. So I’m thinking it’s OK for them not to have a unique ID and I was too quick to assume there was a fault.

I appreciate your help.

Thank you.

Back to this, every entity will have an entity_id whether it is configured vi a gui or via configuration.yaml.

The short answer: you can’t set this.

Unique IDs need to be supported by the integration itself and are typically generated from data specific to that integration. Some integrations do generate unique IDs, some - like the wake_on_lan integration - don’t.

2 Likes

I thank everyone who responded. I now understand entities better.
Cheers
Boyd

I have a similar problem with my flux_led finally got them to show up but but get that same message.
And they don’t respond they tell me if on or off. I can turn them off but on is a nother matter

3 Likes

Just so everyone knows:
This error doesn’t mean anything except you need to write in YAML to configure them.

1 Like

@KTibow, thank you for your very helpful explanation.

Id is bug, because it is confusing, especially in other languages, and must be fixed (correct explanation)

1 Like

I agree it’s confusing. Whether to call it a “bug” or not would be a debate not worth having.

Every time I see that message, I wonder whether I should dig deeper and see if there’s any way I can “fix” it so I can configure it from the GUI rather than hard-coding stuff.

Personally, I just muddle through and change what I need to change wherever I can. But if HA is ever going to get to “version 1,” being able to configure things in the GUI will be critical.

4 Likes

this error is givin because the system (Home Assistant) has not set up the Unique device id (randomly generated number, but similar in groups) automatically. you can see the unique ids in your /.storage/core.entity_registration file.

most entities can be configured in the yaml file with a unique_id: ‘what_ever_you_want’ at the platform

3 Likes

In my setup (HA version 0.117.5), ALL the entities in the core.entity_registry have a unique_id, also those entities that can’t be managed in Configuration -> Entities because HA claims they don’t have a unique id.

I noticed though that my only entities that can’t be managed are sensors that don’t have a “config_entry_id”. Helper entities and other non-sensors, e.g. person, also don’t have a config_entry_id, but they can be managed just fine.

Specifying a unique_id for a manually created sensor in configuration.yaml leads to an invalid configuration.

Seen how many users trip over this topic (just search in the forum, and those are only the few who bother to register and write something), this is a missing feature/bug that justifies attention.

1 Like

What do you think you are missing. The message I get is

This entity does not have a unique ID, therefore its settings cannot be managed from the UI.

The key is “from the UI”. There are other ways to “manage”. Are you saying you cannot use them?

just add in the configuration.yaml the attribute
unique_id:
to your sensor and restart home assistant.

1 Like

@gilbert-grape It does not seem to work for all cases. I have a sensor defined in configuration.yaml to monitor the RPi CPU temperature. When I load this sensor in Configuration -> Entitities, HA tells me that I cannot manage the entity because it does not have a unique id. So I tried to add a unique_id as you mentioned (see my yaml attempt below), but I then get a "[unique_id] is an invalid option for [sensor.command_line] " error when validating the yaml file.

sensor:
  # RPi - CPU Temperature 
  - platform: command_line
    unique_id: rpicputemp1
    name: RPi CPU Temp
    command: "cat /sys/class/thermal/thermal_zone0/temp"
    unit_of_measurement: "°C"
    value_template: '{{ value | multiply(0.001) | round(1) }}'

Strangely enough, when I look in the home-assistant_v2.db database, this sensor has a unique_id “sensor.rpi_cpu_temp” when I select its sensor reading records from the states table. So for all I can tell, it has a unique id already.

Why do you care? It still works.

1 Like