Automation - error turning another automation ON

Hi,

I’ve an automation for the front door that is always on and turns the porch lights on/off when the front door is operated after sun set. But occasionally we need to turn on the front porch lights and deactivate the default automation. So this is the code that I’m using:

alias: "Automation: Front Porch Lights Voice Activation"
description: ""
triggers:
  - trigger: conversation
    command:
      - Activate front porch lights
    id: sequence_on
  - trigger: conversation
    command:
      - Deactivate front porch lights
    id: sequence_off
conditions:
  - condition: and
    conditions:
      - condition: state
        entity_id: input_boolean.walk_sequence_automation
        state:
          - "on"
      - condition: state
        entity_id: sun.sun
        state:
          - below_horizon
actions:
  - if:
      - condition: trigger
        id:
          - sequence_on
    then:
      - action: tts.google_translate_say
        metadata: {}
        data:
          cache: false
          entity_id: media_player.homeserver_mpd
          message: Activating front porch lights
      - action: automation.turn_off
        metadata: {}
        target:
          entity_id: automation.automation_front_door
        data:
          stop_actions: true
      - action: input_boolean.turn_off
        metadata: {}
        target:
          entity_id: input_boolean.front_door_automation_switch
        data: {}
      - action: switch.turn_on
        metadata: {}
        target:
          entity_id:
            - switch.bulbholder02_relay
            - switch.bulbholder01_relay
        data: {}
  - if:
      - condition: trigger
        id:
          - sequence_off
    then:
      - action: switch.turn_off
        metadata: {}
        target:
          entity_id:
            - switch.bulbholder02_relay
            - switch.bulbholder01_relay
        data: {}
      - action: tts.google_translate_say
        metadata: {}
        data:
          cache: false
          entity_id: media_player.homeserver_mpd
          message: Deactivating front porch lights
      - action: automation.turn_on
        metadata: {}
        target:
          entity_id: automation.automation_front_door
        data:
          stop_actions: true
      - action: input_boolean.turn_on
        metadata: {}
        target:
          entity_id: input_boolean.front_door_automation_switch
        data: {}
mode: single

The first part of the porch light activation is working fine. The second part for deactivation also works for the most part but when it gets to the second last part “action: automation.turn_on” the code breaks and I see following error in the traces:

I’m not really sure how to fix it and any pointers will be appreciated!
Thanks.

automation.turn_on does not accept stop_actions: (that’s likely the extra key), only automation.turn_off does as per the Automation actions docs.

1 Like

@HappyCadaver thanks, that does the trick!!

1 Like