How to assign area to entity in yaml

It seems, many of my entities (mostly templates) are read-only because they are missing a unique-id. So I can not use the UI configuration to assign areas to them.

How can I assign an area to entities in yaml?
I can’t seem to find anything on this new feature in the docs.


You need a unique id for it to work since the entity has to be in entity registry

I was under the impression this was only true if I want to edit this in the GUI.

1 Like

Yes. That’s true, and you can only assign an area through the ui. Therefore, you need a unique_id.

1 Like

Are we able to assign entities to areas in YAML yet? I’d rather keep my configurations as code than use the GUI. Thanks

1 Like

Areas is a UI only thing

1 Like

Disappointing. I’m all for making HA easier for all (i.e. GUI) but ideally we could manage our entire configuration as code. Well, I guess it’s back to using groups for me then.


I have some entities created by a custom component that don’t have uniqiue_id so thus I can’t set the area. Is there a way to customise the unique_id or do I need to contact the original dev?

Nope, unfortunately.

1 Like

Have there been any updates?

I have 7 tasmotas (devices) that I configured myself. Each tasmota device has different entities (relays, sensors, etc). At it stands it seems I can set an “area” for the device, but not the actual entities.

Some of my tasmotas control entities on different rooms. For example one tasmota controls my living room lights and the half bathroom’s light. So I either show the living room light switches on the bathroom or the bathroom light switch on the living room area.

Any suggestions on a work around?

1 Like

Any updates on this? I need a way to use config or API to update Areas for all of my Insteon devices which is just about 100 devices and 23 areas. This problem is becoming an issue as PLMs die. When you add another PLM all of the friendly names and areas are lost.

1 Like

Im having the same issue with the Tenda SP9 smart plugs I have setup… I can assign areas and friendly names, but they keep defaulting back to the original area and losing the names I have given them! :slightly_frowning_face:

Please vote here: Assign "area" to entities in configuration.yaml

WTH closed almost a year and a half ago. It’s a month long thing that happened in October 2022. Make a Feature Requests for this instead. Please make sure to search for this before creating a new post.

EDIT: Moved it for you.

1 Like

Sure, thanks!