With the Year of the Voice and all the excitement around voice assistants, I’m starting to use “Areas” to group my devices and entities. I have several yaml-based integrations (e.g. Envisalink) that do not include the “unique_id” field.
What is the best way to add a unique_id to these integrations? Should I create a template that mirrors the state of the device/entity? Are there easier ways?
I have used Manual Customization to add attributes to existing entities (or change their existing entity_id). The documentation doesn’t show an example of adding a unique_id but it’s worth a try. Be sure to restart Home Assistant after you have made your changes.
Worst case is that the customization will be displayed as a new attribute called unique_id and is not handled as an internal means of uniquely identifying the entity. In other words, if Home Assistant doesn’t allow you to change some of the entity’s properties via the UI, that means the entity doesn’t have a functional unique_id.
Thank you for the suggestion, unfortunately it didn’t work. As you suspected, the customization only showed up as a new attribute, not a true unique_id.
For the record, here is what I put in customize.yaml:
Yeah Pete’s right you won’t be able to ‘add’ a unique_id to the existing entities without the underlying code changing (i also run envisalink and it’s a pain they really need to update that integration to add it)
You can of course template every entity coming out of an integration and add unique id’s to those. But tbh… I never bothered. Way too much work for too little rewards in my particular setup.
You can open a feature request in the core github against the integration. (although for envisalink there might be one already)
Thanks for taking the time to confirm my suspicion. unique_id is used internally to uniquely identify the entity so it makes sense that it must be defined as part of the integration as opposed to “tacked on” independently via Manual Customization. Anyway, given how easy it is to test, it was worth trying.
FWIW, you can’t add friendly_name via Manual Customization either. It’ll appear as an attribute but it won’t represent the entity’s actual friendly_name property.
Ive seen comments on git where they were working on it.
I believe there’s also a drop in custom replacement on HACS now that does provide the unique ID I was considering moving to it because I can’t label anything that is not editable in the UI which includes anything without a unique ID.