Automation with two actions

Hello,

i have a problem with automation.
So, this is simple automation, when after some time lamp will turn off.
This is code:

- alias: 'timer for lamp'
  trigger:
  - platform: state
    entity_id: input_boolean.light_timer_enabled
    to: 'on'
  condition:
  - condition: state
    entity_id: switch.lamp
    state: 'on'
  action:
  - delay:
      minutes: "{{ states('input_number.light_timer_minutes') | int }}"
  - service: switch.turn_off
    entity_id: switch.lamp
  - platform: state
    entity_id: input_boolean.light_timer_enabled
    to: 'off'

And in action I want to switch turn off, and have the boolean reset to off.
Is it possible, to have to actions in action statement?

- alias: 'timer for lamp'
  trigger:
    platform: state
    entity_id: input_boolean.light_timer_enabled
    to: 'on'
  condition:
    condition: state
    entity_id: switch.lamp
    state: 'on'
  action:
    - delay:
        minutes: "{{ states('input_number.light_timer_minutes')|int }}"
    - service: homeassistant.turn_off 
      entity_id:
        - switch.lamp
        - input_boolean.light_timer_enabled

Thanks, it works! :slight_smile:

1 Like