Unique IDs for entities in configuration.yaml

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

Below is the Leviton integration entry in my current configuration.yaml. What specific code do I need to add in order to create unique IDs for them?

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

There’s no option to add unique_id from what I see in the docs.

Why do you need unique id’s ?

I’m just curious as you can use the entity id’s instead

Probably he wants to be able to customize them through the UI, which needs unique_ids.

I’ve never done that, all my customisations are backend and use the entiy id
Is this required for UI customisation via GUI ???

Yes, that’s required for customization through the UI. Lots of integrations provide unique_ids and for some manually configured ones you can set it yourself, like for automations,but unfortunately bot for all of them.

1 Like

Burningstone is correct. If it does not have a formal integration that you can use to create the entities, you end up having entities that cannot be modified through the UI

2 Likes

@Burningstone, thanks for the tip :+1:

@dahill64, well that is just frustrating, presumably it’s on their ‘to do’ list :rofl:

Hi. I know this is a couple years old now but thought I’d chip in incase it helps anyone…
I use yaml to set up sensors. I found out that you CAN add unique ids to sensors which are setup via mqtt or modbus. All you need to do is add ‘unique_id : 1234567890’ where 1234567890 is any unique string of characters, I usually use the devices MAC address + some suffix indicating the sensors function, but I believe anything can be used as long as it is unique within that instance of Home Assistant.
This will give you the ability to add the sensor to an area and other functions…

6 Likes

I just hit https://www.uuidgenerator.net/ and refresh the page each time I need a new UUID.

2 Likes

Thank you ever so much. I was only finding answers and documents that this was not possible (only in templates) but as you said just add
unique_id: d2a2b97d-8794-4d6b-8c81-d5727b683100
(or any other id generated here https://www.uuidgenerator.net/ ), simple as that.
Thanks

Info : this is only working with mqtt or modbus sensor as stated by @leccyrob

1 Like

It’s worth a try with other things. Works with the generic thermostat integration, for example.

does unfortunatey not work with zwave integration