Actionable Notification Help - Keep Lights On

Hi all

I am trying to bring one of my automations to the next level of usefulness using actionable notifications.

I currently have an automation that turns on my garage lights when I open either of the garage doors.
A second automation will then turn the lights off again 1 minute after I close the doors again (theory being I would leave the doors open whilst I am in there).
Thinking ahead, during winter, I may want to be in the garage and have the doors closed. What I would like is for HA to send me an actionable notification asking if I am still in the garage and want to leave the lights ON.
If I select “No” or don’t respond at all, I would like the automation to run as before and turn off the lights. If I select “Yes” then I want the lights to stay on until the automation re-runs (i.e. I open the doors again and leave).
I am using a helper to toggle the “lights stay on request”, but I can’t get the two possible outcomes of the automation to run.
Here is what I have in my yaml:

alias: Garage Lights On Alert with Door Closed
description: ''
trigger: # If either garage door gets closed having previously been open
  - type: not_opened
    platform: device
    device_id: 6d5c85e2f0679194964493cee3c3e251
    entity_id: binary_sensor.lumi_lumi_sensor_magnet_aq2_03765f07_on_off
    domain: binary_sensor
  - type: not_opened
    platform: device
    device_id: 67587962dbffa3c81725d3a0abd7da48
    entity_id: binary_sensor.lumi_lumi_sensor_magnet_aq2_ea3e3908_on_off
    domain: binary_sensor
condition: # If either of the garage lights are already on
  - condition: or
    conditions:
      - condition: device
        type: is_on
        device_id: 977e50d28b13e909b88a13151ab81b67
        entity_id: light.garage_light_1
        domain: light
      - condition: device
        type: is_on
        device_id: 977e50d28b13e909b88a13151ab81b67
        entity_id: light.garage_light_2
        domain: light
action: # Send a notification to my phone with two options
  - service: notify.mobile_app_sm_g781b
    data:
      title: Garage Lights are ON
      message: And the doors are shut.
      data:
        actions:
          - action: KEEP_GARAGE_LIGHTS_ON
            title: Keep Lights On
          - action: SWITCH_GARAGE_LIGHTS_OFF
            title: Switch Lights Off
  - wait_for_trigger: # If the "Keep Lights On" action is requested turn on the "keep garage lights on" helper. Otherwise, timeout after 1 minute.
      - platform: event
        event_type: mobile_app_notification_action
        event_data:
          action: KEEP_GARAGE_LIGHTS_ON
    timeout: '00:01:00'
    continue_on_timeout: true
  - service: input_boolean.turn_on
    data: {}
    target:
      entity_id: input_boolean.keep_garage_lights_on_helper
  - choose:
      - conditions: # Check the state of the "keep lights on helper". If it is OFF then continue to turn off the lights
          - condition: state
            entity_id: input_boolean.keep_garage_lights_on_helper
            state: 'off'
        sequence:
          - type: turn_off
            device_id: 977e50d28b13e909b88a13151ab81b67
            entity_id: light.garage_light_1
            domain: light
          - type: turn_off
            device_id: 977e50d28b13e909b88a13151ab81b67
            entity_id: light.garage_light_2
            domain: light
    default: # Reset the helper to OFF to allow it to run again
      - service: input_boolean.turn_off
        data: {}
        target:
          entity_id: input_boolean.keep_garage_lights_on_helper
mode: single

First time trying my hand at actionable notifications so I am sure I am doing something silly and obvious! All help gratefully recevied.

Not sure this is simpler but I would probably use a datetime helper as a midpoint.
So when the automation runs it sets the datetime one minute ahead.
Then the notification is sent, and if you say yes then the datetime will be set to yesterday or UNIX 0.

Another automation (or the same with trigger id) when time is == datetime turn off lights.

Not sure I understand…
What would the code look like for that?

I think this could work…
You need to create the datetime helper with date and time.
A little bit worried about the door id’s being the same on the two door triggers.
But lets see what happens.

alias: New Automation
description: ''
mode: single
trigger:
  - type: not_opened
    platform: device
    device_id: 6d5c85e2f0679194964493cee3c3e251
    entity_id: binary_sensor.lumi_lumi_sensor_magnet_aq2_03765f07_on_off
    domain: binary_sensor
    id: door
  - type: not_opened
    platform: device
    device_id: 67587962dbffa3c81725d3a0abd7da48
    entity_id: binary_sensor.lumi_lumi_sensor_magnet_aq2_ea3e3908_on_off
    domain: binary_sensor
    id: door
  - platform: time
    at: input_datetime.garage_lights_off
    id: time
  - platform: event
    event_type: mobile_app_notification_action
    event_data:
      action: KEEP_GARAGE_LIGHTS_ON
    id: keep_on
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id: door
        sequence:
          - service: input_datetime.set_datetime
            data:
              timestamp: '{{ as_timestamp(now() + timedelta( minutes = 1)) }}'
            target:
              entity_id: input_datetime.garage_lights_off
          - type: turn_on
            device_id: 977e50d28b13e909b88a13151ab81b67
            entity_id: light.garage_light_1
            domain: light
          - type: turn_on
            device_id: 977e50d28b13e909b88a13151ab81b67
            entity_id: light.garage_light_2
            domain: light
          - service: notify.mobile_app_sm_g781b
            data:
              title: Garage Lights are ON
              message: And the doors are shut.
              data:
                actions:
                  - action: KEEP_GARAGE_LIGHTS_ON
                    title: Keep Lights On
                  - action: SWITCH_GARAGE_LIGHTS_OFF
                    title: Switch Lights Off
    default: []
  - choose:
      - conditions:
          - condition: trigger
            id: time
        sequence:
          - type: turn_off
            device_id: 977e50d28b13e909b88a13151ab81b67
            entity_id: light.garage_light_1
            domain: light
          - type: turn_off
            device_id: 977e50d28b13e909b88a13151ab81b67
            entity_id: light.garage_light_2
            domain: light
    default: []
  - choose:
      - conditions:
          - condition: trigger
            id: keep_on
        sequence:
          - service: input_datetime.set_datetime
            data:
              timestamp: 0
            target:
              entity_id: input_datetime.garage_lights_off
    default: []