How to cancel and triggered automation

So when anybody opens the front door, an action is triggered which sends me a message with the photo of the guest.

But when I enter the house I want to be able to press a secret button, which disables the automation and does not notify me.

I tried:

- id: auto25
  alias: door_open_warning
  hide_entity: false
  trigger:
    platform: state
    entity_id: binary_sensor.door_window_sensor_doorxxxxxxx
    to: 'on'
  action:
  - delay: 00:00:03
  - service: shell_command.take_snapshot
  - delay: 00:00:10
  - service: notify.ios
    data:
      title: "Warning"
      message: "{{ states(\"sensor.date__time\") }} Someone at the door"
      data:
        attachment:
          url: https://xxxxxx/local/image.jpg
          content-type: jpg
          hide-thumbnail: false

- id: auto26
  alias: trigger_button_click
  hide_entity: false
  trigger:
  - platform: event
    event_type: click
    event_data:
      entity_id: binary_sensor.door_window_sensor_buttonxxxxx
      click_type: single
  action:
  - service: homeassistant.turn_off
    entity_id: automation.door_open_warning
  - delay: 20
  - service: homeassistant.turn_on
    entity_id: automation.door_open_warning

When I enter the house and click the trigger button inside, the door_open_warning automation is already triggered and running, and I suppose turning off the door_open_warning automation does not halt the automation. So I still get the notification. The scripts looks promising but I haven’t used them before. Any help is appreciated. Thanks.

What about using a device tracker, using your phone being not_home as the condition.

Otherwise, you’d have to make the actions of the first as a script, that you turn off with the button.

I’ll give it a try. Thank you.