Unifi Wifi Connect to turn on Guest Mode

I trying to automate the helper Guest Mode based on if an iPhone is connected to a Unifi AP. The Automation is triggered repetitively for some reason. The device switch from home to away frequently. Any idea why this is happening and how to fix it?

alias: Guest Auto On
description: iPhones on Wifi
triggers:
  - trigger: state
    entity_id:
      - device_tracker.unifi_default_xx_xx_xx_xx_xx_xx
    to: home
    id: Phone On Wifi
    for:
      hours: 0
      minutes: 0
      seconds: 10
  - trigger: state
    entity_id:
      - device_tracker.unifi_default_xx_xx_xx_xx_xx_xx
    to: not_home
    id: Phone Off Wifi
    for:
      hours: 0
      minutes: 0
      seconds: 10
conditions: []
actions:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - Phone On Wifi
        sequence:
          - action: input_boolean.turn_on
            metadata: {}
            data: {}
            target:
              entity_id: input_boolean.guest_mode
          - action: notify.mobile_app_names_iphone
            metadata: {}
            data:
              message: Guest Mode On
      - conditions:
          - condition: trigger
            id:
              - Phone Off Wifi
        sequence:
          - action: input_boolean.turn_off
            metadata: {}
            data: {}
            target:
              entity_id: input_boolean.guest_mode
          - action: notify.mobile_app_names_iphone
            metadata: {}
            data:
              message: Guest Mode Off
mode: single

Running HA OS 2024.11.3
Unifi 7.5.187