Script issue using choose and continue_on_timeout

adding a checker to my arm_alarmn scripts:

  alarm_arm_home:
    alias: Alarm arm home
    sequence:
      - service: script.check_alarm_ready
      - service: alarm_control_panel.alarm_arm_home
        entity_id: alarm_control_panel.ha_rpi4_alarm
        data:
          code: !secret ha_alarm_panel_code

the script.check_alarm_ready is supposed to be called directly, meaning it should continue the calling script when not returned correctly Scripts - Home Assistant

since the script will continue after a sucessful wait, I would have thought this to work, but it doesn’t ( that is the script always continues, even after the timeout) and ask you to please have a look:

the script check_alarm_ready is:

  check_alarm_ready:
    alias: Check alarm ready
    sequence:
#      choose:
#        doors_not_closed?
#          notifiy doors not closed
#          - wait until doors closed
#          - continue
#        doors_closed?
#          continue
      - choose:
          - alias: Doors open
            conditions: >
              {{is_state('binary_sensor.doors','on')}}
            sequence:
              - service: notify.system
                data:
                  title: Doors open
                  message: >
                    Can not Arm alarm because {{state_attr('sensor.doors','Doors')}}.
                    Please check.
              - wait_template: >
                  {{is_state('binary_sensor.doors','off')}}
                timeout:
                  minutes: 2
                continue_on_timeout: false    # this doesnt prevent the calling script from arming the alarm.....
        default:
          - service: notify.system
            data:
              title: Doors open
              message: >
               {{state_attr('sensor.doors','Doors')}}, arming alarm.
#          - service: script.continue

Please have a look if you can help me sort this chooser?
thanks

This is how scripts have always behaved. It’s not going to stop the parent script, only the current script, script.check_alarm_ready.

thats not what it says here:

When calling a script “directly” (e.g., script.NAME ) the calling script will wait for the called script to finish. If any errors occur that cause the called script to abort, the calling script will be aborted as well.

other than maybe setting an additional input_boolean, what would you suggest to stop the calling script?

Is a timeout an error?

yeah that was what I was doubting now. I guess not, if this is per design. Maybe I should ask Phil.

meanwhile I changed to:

script:

  alarm_ready:
    alias: Alarm ready
    sequence:
      - service: input_boolean.turn_on
        entity_id: input_boolean.alarm_ready
      - condition: state
        entity_id: input_boolean.notify_system
        state: 'on'
      - service: notify.system
        data:
          title: Doors closed
          message: >
           {{state_attr('sensor.doors','Doors')}}, arming alarm.

  check_alarm_ready:
    alias: Check alarm ready
    sequence:
      - choose:
          - alias: Doors open
            conditions: >
              {{is_state('binary_sensor.doors','on')}}
            sequence:
              - service: notify.system
                data:
                  title: Doors open
                  message: >
                    Can not Arm alarm because {{state_attr('sensor.doors','Doors')}}.
                    Please check.
              - wait_template: >
                  {{is_state('binary_sensor.doors','off')}}
                timeout:
                  minutes: 2
                continue_on_timeout: false
              - service: script.alarm_ready
        default:
          - service: script.alarm_ready

and an additional condition on the boolean in all arming scripts…

An error is an error. It has nothing to do with timeouts. It’s by design.

what I did notice here, is that this is about the only place where it doesn’t matter if we quote the boolean on continue_on_timeout: or not.
(tested that just now because Wanted to make sure that wasn’t causing what I believed to be an issue.)
oops. sorry bout that, was too long ago…

what I would love to do is create a notification upon the failure after timeout.
can we use the wait variable for that?

edit

guess not, so I had to take out the continue_on_timeout: false and add another chooser…

  check_alarm_ready:
    alias: Check alarm ready
    sequence:
      - choose:
          - alias: Doors open
            conditions: >
              {{is_state('binary_sensor.doors','on')}}
            sequence:
              - service: notify.system
                data:
                  title: Doors open
                  message: >
                    Can not Arm alarm because {{state_attr('sensor.doors','Doors')}}.
                    Please check.
              - wait_template: >
                  {{is_state('binary_sensor.doors','off')}}
                timeout:
                  minutes: 2
#                continue_on_timeout: false
              - choose:
                  - conditions: >
                      {{is_state('binary_sensor.doors','on')}}
                    sequence:
                      - service: notify.system
                        data:
                          title: Doors still open
                          message: >
                            Session expired: {{state_attr('sensor.doors','Doors')}}
                default:
                  - service: script.alarm_ready

        default:
          - service: script.alarm_ready