How to group devices by home topology?

Hello everyone!

I am trying to group my devices according to my home topology, that is to have a logical path such as home-room1-switch2

So far I just managed to have all switches grouped together (under switch: in the configuration file) but could not find another way to group them.

I could of course use a name like home.room1.switch2 (or with a _ in case the dot is not allowed) but I have seen examples referring to the devices via names like kitchen.light so i was hoping it would be possible to build a hierarchy based on kitchen and then light?

As far as I know you can’t use dots in the entity name. I think what you were seeing is most likely light.kitchen not kitchen.light. When you (or discovery) creates an entity it creates it with the name of the domain first followed by a dot then the name. you can change some of the entity names by creating them correctly initially. for auto created entities some can be changed by using the entity registry others you are stuck with. others you can change the entity names by using the customize section.

The easiest way is to use something like home_kitchen_light_1 or however you want to arrange it. then you will end up with light.home_kitchen_light_1 as the entity name.

You can create UI cards with groupings like Kitchen and all the lights, switches etc that are in the kitchen, Bedroom and all the lights, switches etc in the bedroom and so on. You want to have a look at the docs for groups.

@finity @zarthan thank you for your answers, sorry I was not clear enough with my question.

I currently have, in the only configuration file I use, all devices grouped by “kind” (“domain” in @finity answer). I found the name of the domain through a mixture of reading the docs and luck and therefore have all my switch defined together under the domain switch:, as well as the light: (I did not find other domains).

They are grouped together on cards via the group: directive and I have a very (very) basic version of the screenshot in @zarthan answer.

What I was looking for was a way to break down the definition and grouping into several files (say, kitchen.yaml and bedroom.yaml), each of them being standalone. They would have the relevant switch: (and light: and possibly others once I find them - like the remote in the screenshot), as well as the group:, also relevant to the file.

Doing this effectively creates several instances of switch: , … in the final configuration file (as the other files are just include in a linear fashion.

You can do that with packages.

1 Like