Help check two automations for Jaguar & Arrival/Departure

For a client, I have a JRL InControl Integration and an nmap-tracker and would like to automate, safely, opening the garage door and outside gate for arriving and departing.

The automations I have are as follows.

For Arriving, first automation to open the outside gate:

- id: '1588237098838'
  alias: Gate_Open_Arrival_Script
  description: ''
  trigger:
  - entity_id: device_tracker.iphone_tracker
    event: enter
    platform: zone
    zone: zone.arrival_zone
  condition:
  - condition: state
    entity_id: binary_sensor.outside_gate_permanent_open_sensor
    state: 'off'
  action:
  - data: {}
    service: script.announce_arrival_script
  - data: {}
    service: script.outside_gate_arrival_script

Then an automation to open the garage, but only if the previous automation triggered and it detects the WiFi of the car has arrived home:

- id: Garage_Open_Arrival_Script
  alias: Garage_Open_Arrival_Script
  description: ''
  trigger:
  - entity_id: device_tracker.jaguar_wifi
    event: enter
    platform: zone
    zone: zone.gps_home
  condition:
  - condition: state
    entity_id: binary_sensor.garage_door_sensor
    state: 'off'
  - condition: template
    value_template: '"{{ ( as_timestamp(now()) - as_timestamp(state_attr(''automation.gate_open_arrival_script'',
      ''last_triggered'')) |int(0) ) > 120 }}" '
  action:
  - data: {}
    service: script.garage_door_open_script

Then for departure, I’d like the outside gate to open if the car starts and the garage is open:

- id: Gate_Open_Departure_Script
  alias: Gate_Open_Departure_Script
  description: ''
  trigger:
  - entity_id: sensor.jaguar_i_pace_status
    from: Key Removed
    platform: state
    to: Key On Engine Off
  condition:
  - condition: state
    entity_id: binary_sensor.garage_door_sensor
    state: open
  action:
  - data: {}
    service: script.outside_gate_departure_open_script
  - data: {}
    service: script.announce_mom_departure_script

Unfortunately, these automations does not seem to work. Any advice?

I’ve written a script using the jlrpy module that I assume is the base of the integration you’re using to poll my car for information, but it isn’t something I’d rely to be updated quickly enough to run my gate. If there’s a delay on their servers, your client’s gate doesn’t open.

I think you’d be much better using a commercially-available door opener inside the car.

Might the following work?

I am using the Mobile iOS app and it reports a sensor with geocoded location. I am unsure on how to check the go-to state for the sensor though

- id: Garage_Open_Arrival_Script
  alias: Garage_Open_Arrival_Script
  description: ""
  trigger:
    - entity_id: sensor.iphone_geocoded_location
      platform: state
      to: "STREETNAME STREETNUMBER"
  condition:
    - condition: state
      entity_id: binary_sensor.garage_door_sensor
      state: "off"
    - condition: template
      value_template:
        '"{{ ( as_timestamp(now()) - as_timestamp(state_attr(''automation.new_automation'',
        ''last_triggered'')) |int(0) ) > 120 }}" '
  action:
    - data: {}
      service: script.garage_door_open_script