"Entities" (and "Devices") should be organized as a tree

It’s very confusing (and hard to manage) devices that come with lots of entities. The entity list can be quite long even for a simple home, as every lightbulb might have a few entities.

I think it would be so much easier if you would see a tree instead of a list. Note that an entity might have more than one parent, e.g. if you create a group that entity could appear twice in the tree. I also wish Devices would be part of this list, as their own root entity that has its entities underneath. The difference between Devices and Entities is quite confusing.

This should also affect entity naming. Right now, entity names are essentially arbitrary, they just have to be unique per HA instance. But what if the “.” notation would have semantic significance and allow you to refer to entities according to their place in the tree? Note that because entities could appear more than once in the tree if you create groups, you could refer to the same entity with a different path name. This is actually quite good, because it allows users to create their own semantic namespace. E.g. you might refer to a lightbulb as “zha.sengled1” or “living_room.sengled1”.

One consequence could be that the “.” would be reserved, meaning you cannot use it in names, because it has semantic meaning for looking up an entity by its path in the tree.

By the way, the current convention is actually the opposite of this! You would have something like “binary_sensor.sengled1” but I am suggesting that it should be “sengled1.binary_sensor”.

Additional added problem, is that a single device can be provided by multiple integrations, while that single device contains multiple entities provided by different integrations.

It is a graph, but not a full tree.

For example, your ESP chip/device could be provided by the ESPHome integration and the UniFi integration at the same time.

1 Like

You’re right, but by creating your own groups (nodes in the tree) you could at least organize your devices as you see fit.

I’m not saying this is trivial to do. :slight_smile: But to me this is the biggest negative of HA right now.

I agree with the overall concept here, as a new user to HA I was surprised at how little heirarchy there is in the sensor values.

“Device” seems almost unused as a concept, since you end up having to work directly with entities. Then very quickly you end up creating template sensors to process the raw entities into useful data, and those template sensors can’t be associated with your original device again (correct me if I’m wrong, please).

On the other side, Attributes seems like a very useful feature of entities that is underutilized. A single sensor that has a few different properties (or maybe even the same property in different units!) needs to have multiple entities to be used.

So all said and done, we are mostly expected to just work with a giant bucket of undifferentiated entities, without benefiting from higher levels of organization, or lower levels of organization.

1 Like

Attributes are mostly overused and phased out. In many cases those attributes should have been their own entities of a device.

3 Likes

If not custom orgs, maybe create devices to act as ‘classes’ for things like people, device_trackers, automations etc, so they can show up in the devices view. Its inconsistent and can be confusing that some things can be accessed through both device (drilling down to entities within the device) and entity views, but others only through the entity view.