Odd behavior leaving zones vs arriving

I have 2 overlapping zones, Home and Zone 1 which is not passive (image below). My goal is to change Chip Color as I move from house (green) to Zone 1 (blue) to outside of Zone 1 (red). I also have automations that trigger on To one zone From another. Code for the Chips is below.

My problem is that when leaving home, zone does not change to Zone 1 when leaving Home and arriving in Zone 1. Zone is still Home. As I continue out of Zone 1 the Zone shows Away.

But coming back it works properly. Starts Away, then enters Zone 1 (and shows so), then enters Home (and shows so).

I display my person entity on my main HA page so I can monitor it in real time. I am using Home Assistant Cloud Remote Control App.

I am confused on how the Zone is updated . I thought it changed to the Friendly Name when it enters or exits a zone. And not-home (Away) is shown when not in any zone.

Thanks for any help.

type: custom:mushroom-chips-card
chips:
  - type: template
    entity: person.jo_blow
    icon: mdi:account
    icon_color: |
      {% set state = states('person.jo_blow') %}
      {% set icon_color = '' %}
      {% if state == 'home' %}
        green
      {% elif state == 'Zone 1' %}
        blue
      {% elif state == 'not_home' %}
        red
      {% else %}
        gray
      {% endif %}

Just curious, have you tried to prove the code woks IF there is no overlap? So, reduce the size of zone 1 temporarily and see if it works as expected.
I suspect since you are ALREADY in zone 1 when you exit the HOME zone, nothing is triggered except the Home Exit. There is NO Zone 1 enter fired, since you are already there.

I have played around with it a bit more and believe what you say is true. Leaving Home actually puts you in Zone 1, but zone is not updated since it didn’t enter by crossing a boundary of Zone 1. I It does update as I leave Zone 1 moving away from Home.

There must be a way to do this. But overlapping zones does not appear to be it unless someone has an idea for it.

Until we get zones that can be defined with trapezoidal lines, I think your best approach is to add more smaller zones in areas that are most relevant. Since I can’t really tell the scope of your original Zone 1 (but it appears huge compared to your Home zone), I would rethink that one big zone into smaller zones. The other thing to consider is the center point of the zone does not need to be exactly on top of your target. Let’s say your Zone 1 was a mall or shopping center. Set the diameter of the zone to encompass all the stores and then move the center until you can’t shrink the size any smaller. The goal is the smallest diameter that covers all or most the targets, regardless of the center point location.

I do this for my Home zone, but in reverse. I live in a development, but we are adjacent to a preserve. I can set my home perimeter to cover my approach to home to a wider aspect by including a bunch of the preserve, then moving the center point until my road is within the border of the larger radius. Its marsh, so no cars, no walking or riding there. My automations are timed so that the garage just starts to open as I approach my house. Without this wider approach, the alarm delays and code execution had me waiting for the garage to open. Now it works perfect.

Screenshot 2024-07-16 at 12.11.52 PM

Good luck in getting your zone reconfigured.

I think I have figured out the problem. I was using a person entity which was my router device tracker. This means it only knows Home and not-Home (no GPS Location info). When I left Home it goes to not-Home which comes out as Away (not in any Zone). Even though I was in Zone 1.

I changed to my phone device tracker and it all started working fine. The Person Integration can have stationary trackers (non-GPS like router) and GPS trackers. It may take time for person to see the transition from stationary to GPS and that caused me problems with seeing Zone 1.

Reading up on the Person Integration, this is all spelled out.

Right now I have my Person defined as just my phone tracker. Seems to work.

Thanks for all the replies!