Slow tracker device

I created a script that notifies me if someone opens a door or window while I’m away from home. The problem is that the automation triggers when I enter the house; it doesn’t immediately realize I wasn’t home. It shouldn’t activate in that case. I use the smartphone app and also the FritzBox tool for device tracking. How can I fix this?

triggers:
  - entity_id:
      - binary_sensor.aqara_door_cucina_contact
      - binary_sensor.aqara_door_salotto_contact
      - binary_sensor.aqara_door_ingresso_contact
    to: 'on'
    trigger: state
conditions: []
actions:
  - delay: '00:00:15'
  - if:
      - condition: state
        entity_id: person.tom
        state: not_home
      - condition: state
        entity_id: person.elsa
        state: not_home
    then:
      - action: notify.mobile_app_456
        data:
          title: Porta aperta
          message: >-
            {{ trigger.to_state.attributes.friendly_name }} si è aperta e non
            c'è nessuno in casa!
      - action: notify.mobile_app_123
        data:
          title: Porta aperta
          message: >-
            {{ trigger.to_state.attributes.friendly_name }} si è aperta e non
            c'è nessuno in casa!
mode: single

The problem may be with the Fritzbox, try using only device tracker entity from companion app for person.

In the FritzBox tool settings, it says it checks the status every 180 seconds. I enabled both for better accuracy; as I understand it, whichever one changes first “wins.”

You probably didn’t set up the background location/high accuracy mode in zone settings correctly in the app. You didn’t say whether you’re on Android or Apple, so I’m giving you this generic link which has info on both Location | Home Assistant Companion Docs

What are the best practices for getting an accurate “in-home” status? What is typically used? I thought the FritzBox device tracker was the best option. In any case, I already have this information in the mobile app (Android).

My phone’s GPS tracker goes home a median of 3m43s before my BLE tracker does, over the last seven arrivals with a 70 m home zone. So if yours is still not_home when the door opens, I’d look at the zone radius and the app’s location permissions before making the delay longer. Once in those seven the GPS went home, back to not_home eight minutes later, then home again, so a fixed delay wouldn’t have covered that one either.