I have a few old automations that are designed to unlock my front door, or open my garage door, depending on how I leave. If I ride my bike or car, it opens my garage, if I leave via front door, it opens the front door. Pretty simple. Except!!! I did this in pieces, so it’s 2 separate automations. One detects my phone entering the “home zone”, the other detects an event firing (iOS triggered the event via ‘shortcuts’)

There is now “zone based” automations, and there is also my “person entity”. So the way I see it, I have 3 different ways to tell when I come home:

  1. My phone’s gps enters the ‘home zone’

  2. My HA ‘person’ state changes from ‘away’ to ‘home’

  3. My phone’s shortcut app fires an event that is detected.

I feel like #1 and #2 are the same, no? I only have one device linked to my person entity, and it’s my phone. Is there any difference in this case? Is there a preferred choice?

  • AbouBenAdhem@lemmy.world
    link
    fedilink
    English
    arrow-up
    10
    ·
    2 days ago

    Using your person state makes it easier to update HA when you get a new phone, especially if you have a lot of automations that use it.

    • Lemmee@sh.itjust.worksOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      2 days ago

      Ooh. That’s a great point.

      I just did some digging and it seems something is wrong with my phone or person detection because it don’t notice that I left for the gym this morning.

      I guess that needs troubleshooting as well. Maybe having multiple triggers increases the robustness of the automation?

      • dono@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        18 hours ago

        If you use background location, or even just the geofencing in the location settings of the Homeassistant App then it wont work if you have Network location disabled in Android. After some research i found out that in newer versions of Android it wont use gps at all for background location. This tripped me up for some time since (i think) Grapheneos has this disabled by default (or i disabled it idk). After enabeling this again everything worked reliably.

        • Lemmee@sh.itjust.worksOP
          link
          fedilink
          English
          arrow-up
          1
          ·
          17 hours ago

          I’m on iOS, and I’ve got ‘always on’ enabled for location services. It has worked pretty much flawlessly until this weekend, so I’m guessing something got borked, and I need to do some updating in some places.