Person entity in trigger not firing transition to new zone

I’m banging my head with a zone transition trigger that does not do what i expect.
So i made this simple trigger to test the trigger

- id: _test_zona
  initial_state: True
  alias: _TEST Zona
  trigger:
    - platform: state
      entity_id: person.lorenzo
  action:
    - service: notify.telegram
      data_template:
        title: 'TEST'
        message: >

          From: '{{trigger.from_state.state}}' - To: 
          '{{trigger.to_state.state}}'

This sends a message to my telegram every time the state changes (even if the zone is the same).
I expected to see only messages with different “from” and “to” , because the state chages means the person changed zone
but i got the opposite. 99% of my messages are with the same from and to. For example, when i exit home (leaving home zone and entering ‘home_street’ zone) , i get a message with "from: home_stree to:home_street. Same when i get home, leaving not_home and enterning home_street. I got "from home_street to home street. I know that i can filter out those with a simple != condition, but the point is that, in one full day of me traveling around the city and getting home several times, only ONE time i got a from: different to the to:. I’m missing hundred of triggers entering and exiting known zones.

Anyone knows why?

The automation will trigger every time the person entity or any of its attributes changes state. In your example, it is probably is the location (GPS coordinates) of the person that changes.

What exactly do you want to achieve? Did you know that there is also a zone trigger?

Yes, i know, but the point is that almost always miss the transition to one zone from another. It does simply not fire for all

I’m using that trigger with more “person” to start some actions on when me, or someone in my family, get or leave home, for example.
In those automations i have a template with a condition like this one:


  condition:
    condition: and
    conditions:
      - condition: template
        value_template: >
          {{ trigger.to_state.state == state_attr('zone.strada_casa', 'friendly_name')
            and trigger.from_state.state != 'home' }}

But those, also, are not firing but some rare times (it sems random)

While i’m writing this, i remembered actions modes. Maybe actions based on gps position without specifing a mode (default is single) get too much calls and many go missing while HA is processing one. I’ll try switching to “parallel” to see if something changes…