Update cell phone Entity

Hi,
Try it again because it still isn’t working
this is the code.
i want to switch on the alarm when my cellphone is out of the Wifi range about 15 seconds after this happens. Then when ia come back and the cellphone is connected with the Wifi network, the alarm should be disarmed.
but with this code it doesn’t work.
it last more then 2 minutes before the alarm is armed or disarmed.
conforguration is mad in the UI Autimation and not in the automation.ymal manually.
helping me out would be great
thx

- id: '1662455941966'
  alias: HA_Update OPPO van Wil
  description: HA_Update OPPO van Wil
  trigger:
  - platform: time_pattern
    seconds: /15
  condition: []
  action:
  - service: homeassistant.update_entity
    data: {}
    target:
      entity_id: device_tracker.wil_s_oppo
  mode: single
- id: '1662486590757'
  alias: Arm alarm when Away
  description: ''
  trigger:
  - platform: state
    entity_id:
    - device_tracker.wil_s_oppo
    to: not_home
    from: home
  condition: []
  action:
  - service: alarmo.arm
    data:
      entity_id: alarm_control_panel.alarmo
      code: 'secret'
      mode: away
  mode: single
- id: '1662488515899'
  alias: Disarm alarm when Home
  description: ''
  trigger:
  - platform: state
    entity_id:
    - device_tracker.wil_s_oppo
    to: home
    from: not_home
  condition: []
  action:
  - service: alarm_control_panel.alarm_disarm
    data:
      code: 'secret'
    target:
      entity_id: alarm_control_panel.alarmo
  mode: single