Help - how to stop automation for 20 minutes?

I have the following automation. When I approach my home (based on the android companion app as a device trigger) to open my garage door. Although it is working ok sometimes it opens the garage door twice.
It opens the door, I enter, and after 1-2 minutes it reopens it. Probably due to the lack of the companion app to determine exactly my location.
I am thinking to add a boolean to and when the garage door is open to turn on for 20 minutes.
After 20 minutes to turn off (the input boolean) and add a condition to the automation to turn on the garage door only when input boolean is off.

Do you think it will work? Is there a better way to achieve this?

- id: Open Garage Door when close to home
  alias: Open Garage Door when close to home
  trigger:
    platform: zone
    entity_id: device_tracker.sm_g955f
    zone: zone.myhome
    event: enter # or "leave"
  condition:
    condition: state
    entity_id: binary_sensor.openclose_18
    state: 'off'
  action:
    - service: switch.toggle
      data:
        entity_id: switch.sonoff_100082f95b

If you have WiFi connection in the garage (which I suppose) then you could add a condition that your phone should not have WiFi connection.
Or ‘unavailable’ is what the app reports if I remember correctly

1 Like

Have a look at this thread. Similar problem with solutions:

1 Like