Time condition in actions?

I have the following in the action part of my automation, but not sure if it works the way i think it does.

Does anything after the time condition not run if the condition fails ? From a visual gui point of view, I would expect those actions to be in a sub section, as with a and/or kind of thing. Is anything in action ‘sequential’ ?

Here’s the action yaml. What this does is it turns off the light (right switch) if no motion detected, then it turns on the fan (left switch) and turns it off after 5 minutes, but only between 6 and 12.

action:
  - type: turn_off
    device_id: 3340dd45c788adafe48397c21666709a
    entity_id: switch.second_bathroom_light_switch_1_right
    domain: switch
  - condition: time
    after: "06:00:00"
    before: "12:00:00"
  - condition: state
    entity_id: switch.second_bathroom_light_switch_1_left
    state: "off"
  - type: turn_on
    device_id: 3340dd45c788adafe48397c21666709a
    entity_id: switch.second_bathroom_light_switch_1_left
    domain: switch
  - delay:
      hours: 0
      minutes: 5
      seconds: 0
      milliseconds: 0
  - type: turn_off
    device_id: 3340dd45c788adafe48397c21666709a
    entity_id: switch.second_bathroom_light_switch_1_left
    domain: switch
mode: single

It should perform the first turn_off: action, then if either of those conditions is false it will stop processing. If both are true it should continue processing.

1 Like

Cool, works as expected then. Thanks!