Delays and Automations

I have added a pedestal fan to an automation and want the fan to increase speed 2 minutes after automation begins. Everything works as expected, but if I turn off the input boolean trigger prior to the 2 minute delay the automation won’t terminate. I’ve read a bit on Timers in other threads but I’m not having any success with them delaying the speed increase of fan. Any suggestions appreciated.

alias: Rowing Mode
description: ""
triggers:
  - entity_id:
      - input_boolean.rowing_mode
    id: Rowing On
    from: "off"
    to: "on"
    trigger: state
  - entity_id:
      - input_boolean.rowing_mode
    id: Rowing Off
    from: "on"
    to: "off"
    trigger: state
conditions:
  - condition: state
    entity_id: input_boolean.vacation_mode
    state: "off"
  - condition: state
    entity_id: input_boolean.guest_mode
    state: "off"
actions:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - Rowing On
        sequence:
          - action: automation.turn_off
            metadata: {}
            data:
              stop_actions: true
            target:
              entity_id: automation.automatic_office_fan
          - action: fan.set_percentage
            metadata: {}
            data:
              percentage: 100
            target:
              entity_id: fan.office_fan
          - action: switch.turn_off
            metadata: {}
            data: {}
            target:
              entity_id: switch.office_fan_whoosh
          - action: fan.set_percentage
            metadata: {}
            data:
              percentage: 66
            target:
              entity_id:
                - fan.pedastal_office
          - delay:
              hours: 0
              minutes: 2
              seconds: 0
              milliseconds: 0
            enabled: true
          - action: fan.set_percentage
            metadata: {}
            data:
              percentage: 100
            target:
              entity_id:
                - fan.pedastal_office
      - conditions:
          - condition: trigger
            id:
              - Rowing Off
        sequence:
          - action: fan.set_percentage
            metadata: {}
            data:
              percentage: 42
            target:
              entity_id: fan.office_fan
          - action: automation.turn_on
            target:
              entity_id: automation.automatic_office_fan
            data: {}
          - action: switch.turn_on
            metadata: {}
            data: {}
            target:
              entity_id: switch.office_fan_whoosh
          - action: fan.turn_off
            metadata: {}
            data: {}
            target:
              entity_id:
                - fan.pedastal_office
mode: single

Change mode to restart

1 Like

Amazing! Thanks so much. Just about to read the Automation Modes article to see exactly why that works.