Is there any way to group zones together? I would like to define zones that are not necessarily circular in shape. I can accomplish what I want by overlapping several of them, but I really want to group them together and treat them as one zone. Is this possible?

I suppose I could probably script up a template trigger…

  • just_another_person@lemmy.world
    link
    fedilink
    English
    arrow-up
    3
    ·
    edit-2
    6 days ago

    Can you elaborate on what you mean? Circular?

    Nvm, you’re talking about the map. A zone is just a logical group, like areas. If you want an automation that runs on bot zones, just make both zones the target. Otherwise just use areas and not zones and group your devices like that, or with a group of devices.

    • SteveDinnOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      edit-2
      6 days ago

      Like when you create a zone, it’s a circle. It has a radius. I want a zone that is an arbitrary shape, so I compose it out of several smaller zones. I want to formally make it a single zone in Home Assistant by grouping them. Currently you can’t add zones to groups or create a zone with type: group or anything like that.

      • just_another_person@lemmy.world
        link
        fedilink
        English
        arrow-up
        2
        ·
        6 days ago

        So I think you’re just confused about the organization names. Let me try to clarify:

        • Zone: geographic region, like house1, house 2, office…etc
        • Area: room in a house
        • Group: just a grouping of devices

        These are all simply just representative logical units, and can be whatever you want them to be. An area can be a whole house, or it can be a room in a house, or maybe just a closet in a room. Whatever you assign to that group is then used for triggers:

        “Turn on all lights in bedroom”

        “Turn off all kitchen lights”

        Say you have 12 lights in a garage, you want to separate them into groups. You create a group called “garage-lights-1”, and assign half to that, then another for “garage-lights-2”, and the others there. You can then just create an automation for either group, OR also assign each group to an area called “Garage” if you intend to turn them all on or off at the same time, or create scenes that do different things with different lights. Any entity in HA can be apart of many groups at the same time since it’s just a logical thing to help with organizations.

        • SteveDinnOP
          link
          fedilink
          English
          arrow-up
          2
          ·
          6 days ago

          I am pretty sure I’m not confused. I want to group zones together so they can be used in automation triggers and I can change the group’s membership and not have to change every automation trigger. The group’s state should indicate the number of person entities that were in any zone in the group.

          I’m not talking about areas at all.

          Just to be clear, I don’t believe grouping zones is currently possible. It’s just a want I have.

          • just_another_person@lemmy.world
            link
            fedilink
            English
            arrow-up
            2
            ·
            6 days ago

            Well zones pretty much exist to not be grouped. That’s their organization function, and why I’m confused about what you’re asking.

            Why don’t you just explain exactly what you need to accomplish, and then maybe we can help you.

            • SteveDinnOP
              link
              fedilink
              English
              arrow-up
              1
              ·
              6 days ago

              I…honestly thought I just did that. I want to have an irregularly-shaped zone. I don’t see why they couldn’t logically be grouped, you just aren’t able to do it right now.

              Anyway, thanks for reading what I typed.

              • ShepherdPie@midwest.social
                link
                fedilink
                English
                arrow-up
                1
                ·
                5 days ago

                I think they meant explain the root issue like “I want automation X to trigger if I’m at my cool neighbor’s houses but not if I’m at my lame neighbor’s houses” rather than focusing on your specific train of thought on how to solve said issue.

    • SteveDinnOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      6 days ago

      You don’t get the choice to use more than one zone as your official “home” zone though, do you?

      • just_another_person@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        6 days ago

        It’s just an organizational name. You don’t even need to actually use zones at all I don’t think. Zones are basically used if you have more than one setup across many geographic locations.

        Can you explain a bit more about what you’re trying to accomplish?

  • Claude Flammang@dju.social
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    6 days ago

    @SteveDinn
    Wondering if a template sensor would do the trick?
    Like: sum up the number of people in zone1, 2, 3 …
    Edit: Overlapping probably will result in higher counts though. You could still have qualitative information, like is anybody in the zone collection or not.
    There might still be a way to count, but you would have to check for each person if it is in any of the zones of interest.
    If I had to do that, I would probably create a sensor for each person and sum them up.

  • [email protected]@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    1
    ·
    6 days ago

    I get what you mean and yea I don’t think you can easily use groups for that.
    Zones have a several things going on.
    In no particular order:

    1. A zone’s state is the number of people in it.
    2. Zones can be used as enter/leave triggers in automations.
    3. A person’s state becomes the name of the zone when they’re in them.

    Making a mock entity for #1 is easy enough, a helper number thing whose state is the sum of the group members’ states.
    The other stuff is more complicated.
    #2… Might be easier to add the different zones as multiple triggers, which might be a pain to manage. But then, I assume you’d also want to ignore whenever someone moves between zones in that same group.
    #3… idk, if it’s just for displaying purposes in that person’s “badge” thing, just use the same display name for all zones in group. If it’s for use in an automation, then you probably need to duplicate everything again.

    Might be easier to implement polygonal zones than group normal ones.

    I think nodered might already have that geofencing feature.

    There’s a bit of discussion in here: https://github.com/home-assistant/architecture/discussions/1014

    • SteveDinnOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      6 days ago

      A person’s state becomes the name of the zone when they’re in them.

      In the current version of Home Assistant, if a person is in two overlapping zones, what happens? It’s possible to be in that state today.

      I suppose it doesn’t really matter though. I’ve named all my home zones similarly: home1, home2, etc. It would be easy enough to check for a zone where the object_id starts with “home”

      • [email protected]@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        1
        ·
        6 days ago

        Good question, I’d guess it would be the closest to the center of whichever zone.
        I haven’t tested them, but if they work, it’d be easier to use non circular zones than deal with multiple overlapping ones.