Why do areas only have one tier?

Areas would be a lot more useful if they had different tiers.

Example:
My house has an open floor plan downstairs, with a big room containing kitchen, living room and dining room. For some use cases I need to have them as separate areas, but for other use cases it would be nice to have all the devices and entities in those areas also belong to a “downstairs” area. I also have a need to have the different sides of the outside of the house in separate areas (driveway, patio, garden) but it would be awesome to group those areas in a larger “outdoors” area.

The problem with that is that areas are designed to represent a device in a single physical space (as well, they can’t be in 2 places at once).

I’ve been playing with providing an additional, more free system of categorization for that reason: Labels.

It would allow for both cases. A physical representation in areas and a user define catalog/categorization as well.

Some explanation can be found here: Add label support by frenck · Pull Request #69996 · home-assistant/core · GitHub

33 Likes

Area inside another area would be really useful like an area “1st floor” and then area for every room on that floor. Could be label or something like that as well as long as all entities can be somehow addressed together.

7 Likes

I think areas only have one tier because they physically can only be in one room, which is what the function of areas is. However, I like the added functionality you mentioned, and I think it should be added as a zone or label like frenck mentioned. Then I could have my dining room light in the dining room area, but tagged with labels/included in zones “Main Floor” and “Indoors”.

2 Likes

As a relative n00b, being able to have more coarse divisions – e.g., indoor/outdoor, or basement/upstairs – would be really nice as I work to expand ad improve my HA setup.

1 Like

That having a house with rooms and more than 1 floor is not supported in any sensible manners (as far as I can see) is the most wtf home assistant thing imho.

1 Like

Sounds like Home Assistant is more like a Flat Assistant :smiley:

10 Likes

I agree that entities should only be in one area at once. A good way to solve this problem would be to add area groups for things like 1st Floor, Ground Floor, etc.

Alternatively, go full-out with a proper tag system (integrated with the areas system) so that we could group devices logically (“Mobile Phones”) as well as physically (“Dining Room”).

2 Likes

I use old style groups in YAML which can contain other groups.

1 Like

FWIW, I am experimenting with being able to use arbitrary data in attributes for purposes like this:

In your customize.yaml you would set a new attribute, tag_locations to be a list of the logical groups/areas that you’d want to place an entity.

For example:

light.kitchen_light:
  tag_locations: ["interior", "kitchen", "firstFloor"]

light.hallway_lights:
  tag_locations: ["interior", "entryWay", "firstFloor"]

light.bathroom_lights:
  tag_locations: ["interior", "bathroom", "secondFloor", "masterBedroomSuite"]

light.bedroom_led_strips:
  tag_locations: ["interior", " "secondFloor", "masterBedroomSuite"]

light.bedroom_fan_light :
  tag_locations: ["interior", "secondFloor", "masterBedroomSuite"]

You can then use some jinja to - for example - turn off only the lights on the first floor:

service: light.turn_off
  data_template:
    entity_id: >-
        {% set toTurnOff = states.light 
                    | selectattr('attributes.tag_locations', 'defined') 
                    | selectattr('attributes.tag_locations', 'search', 'firstFloor') 
                    | map(attribute='entity_id') | list %}
        {{ toTurnOff }}

Hope that helps!

4 Likes

In HomeKit these are called “Zones”, now we already have zones in HA, but the idea is at least already in use in one system people come from, I would love to have something like this.

1 Like

An area hierarchy would fit the bill just fine i.m.o. That way an entity is still only in one area, but could also be considered part of the parent areas as well. Rooms are on floors, floors are in a home, the patio can be in the back garden, all gardens are outside, as is the shed. That is how other Home automation systems work as well.

2 Likes

We find that we have many devices that are considered to be in two places at once. It all comes down to how you categorize them. We have outside lights that are in the Garden but are also in the Front Yard or the Backyard. We have lights that are in our Backyard and our Porch.

I know I can simply make Porch an Area of its own but if I had a second tier (a child inside an parent Area) I could put Porch inside the Backyard. I have Garage light switches that are not in the garage. I have driveway lights that are not in the driveway. My Halloween lights are not really anywhere specific (they’re everywhere). Perhaps a second tier would work here.

Then there are fixtures… another topic for another time.

David

1 Like

Would this move groups, zones and areas to tags then? Seems super flexible

1 Like

I really like this, as long as they would be able to be used in the same manner as areas are now?

I still do think that some kind of hierarchy/tree structure would be absolutely needed, as to not need to manually label everything with thousands (yes, I exaggerate :smiley: ) of labels.

My point is, if you take this example structure from another post, you shouldn’t need to label the Hallway devices/entities with Hallway, Downstairs and Inside to be able to target them with any of the labels, if that makes sense? I still do believe that nestable areas would make the most sense from how our homes are built. If I put a sensor physically in my hallway it is automatically both downstairs and inside…

  • Inside
    • Basement
    • Downstairs
      • Kitchen
      • Living room
      • Dining room
      • Hallway
    • Upstairs
      • Bedroom 1
      • Bedroom 2
      • Bedroom 3
      • Study
      • Bathroom
    • Attic
  • Outside
    • Front
      • Porch
      • Driveway
    • Side
      • Garage
      • Side garden
    • Rear
      • Rear garden
      • Patio
      • Greenhouse
13 Likes

Will these support automations too? Seems like that would fix a lot of complaints.

I would love to be able to instead of assign a device or entity only to an area be able to tag it instead. That way you could create arbitrary groupings of entities and devices.

1 Like

Why do devices/entities have to be assigned to only one area?

Can devices/entities change their own area based on triggers/events?

2 Likes

Rather than hierarchy, it seems like grouping areas together would help something. E.g. cases where you are grouping by the following and then doing automations based on some group of areas:

  • floor
  • indoor
  • outdoor
  • areas with speakers
  • private areas
  • kids areas
2 Likes

If the labels are going to eliminate the areas to take care of both uses, I think that’s great. However, if we are to continue to have areas and labels, for me the ideal case in a home automation application or web would be to use both, hierarchy and labels, but with different uses:

A - Order of areas through hierarchy. With the limitation that an area could only be within a single area, but could have several sub-areas.

I would use this to order the areas in a hierarchical way (one within another) and the purpose would be to obtain a physical order in the house.

In this way, large houses, with exterior land or with various heights could be better organized.
In my vision, it would be ideal for example to automatically group devices/entities. For example, turning off all the outside lights, or seeing if there is any movement upstairs, or lowering all the blinds in the house, or knowing the average of the outside temperature sensors. Without having to create manual groups that later have to be maintained (Don’t misunderstand, I love groups) but I would try to manage them as much as possible by areas and sub-areas autonomously, just by changing one area within another).

  • The whole house:
    • Exterior:
      • Front garden
      • Back garden
      • Front porch
      • Living room terrace
        * Spa:
        * Jacuzzi
        * Sauna
        * Solarium
      • Terrace Kitchen
        * Barbecue
        * Chill out zone
      • Garage
        * Bathroom Garage
        * Workshop
        * Parking
      • Swimming pool
      • Outside entrance.
    • Inside:
      • Low level
        * Entrance hall
        * Living room
        * Cellar
        * Office
        * Bathroom Office
      • Middle floor
        * Guest Bedroom
        * Bathroom kitchen
        * Kitchen
        * Corridor Kitchen
      • Top floor
        • Ladders
        • Landing
        • Gym
        • Balcony gym
        • Main bedroom
          * Main bathroom
          * Dressing room
          * Corridor Master Bedroom

B - Order by labels. This would be as purpose or similarities.
For example:

Tags:

  • Water Zones:
    • Toilets
    • Kitchen
    • Swimming pool
    • Spa
  • Toilets
    • Bathroom Garage
    • Bathroom kitchen
    • Main bathroom
  • Parkland:
    • chill-out
    • Front garden
    • back garden
    • Terrace Kitchen
    • Living room terrace
  • Christmas:
    • Devices or entities used during the Christmas holidays.
  • Halloween:
    • Devices or entities used in Halloween decorations.
  • Fire alarm:
    • The devices or entities used in the detection and warning of fire.
  • Intrusion alarm:
    • The devices or entities used in intrusion detection and warning.
  • Children’s areas.
  • Guest areas.
  • Escape Harry Potter:
    • All those devices/entities/automations that I have used to temporarily turn my house into an Escape Room (Yes, call me a geek :stuck_out_tongue_closed_eyes: :sweat_smile: :joy:).
3 Likes