Error when creating automation based on my own blueprint

Hi all,

I am trying to simplify my automation by creating 1 blueprint and then use this for each light.

All looks fine when I try and create an automation for this but when I try and save it i get the error message: Message malformed: Unable to determine action @ data[‘action’][0][‘then’][0]
After doing a little bit of searching i probably messed up the yaml indentation somewhere but cant figure out where.

Can someone help me figure out where i’m making a mistake?

The blueprint looks like this:

blueprint:
  name: Sonoff knoppen
  description: Blueprint om de acties van Sonoff knoppen te bepalen
  domain: automation
  input:
    knop_L:
      name: Knop links
      description: Knop links
      selector:
        entity:
          domain: switch
          integration: esphome
    knop_R:
      name: Knop rechts
      description: Knop rechts
      selector:
        entity:
          domain: switch
          integration: esphome
    Actie_L:
      name: Actie na knop links
      default: []
      selector:
        action: {}
    Actie_R:
      name: Actie na knop rechts
      default: []
      selector:
        action: {}
trigger:
- platform: device
  type: changed_states
  id: L
  entity_id: !input knop_L
- platform: device
  type: changed_states
  id: R
  entity_id: !input knop_R
action:
  - if:
    - condition: trigger
      id:
        - L
    then:
      sequence: 
        - !input Actie_L
    else:
      sequence: 
        - !input Actie_R

Code for the automation:

description: ""
alias: Knop - sonoff
use_blueprint:
  path: Roel/Sonoff_Knoppen_boven.yaml
  input:
    knop_L: switch.sonoff_left_button
    knop_R: switch.sonoff_right_button
    Actie_L:
      - service: light.toggle
        metadata: {}
        data: {}
        target:
          entity_id: light.kantoor
    Actie_R:
      - service: light.toggle
        metadata: {}
        data: {}
        target:
          entity_id: light.eetkamer

i dunno if this is the cause of the problem, but proper yaml should have the trigger block indented in, no?

You are probably right that there is something wrong with the indentation but I tried a few variants and cant seem to get a different result.

I’m not a blueprint guru but I also think the actions inputs are supposed to be more like this:

blueprint:
  name: Sonoff knoppen
  description: Blueprint om de acties van Sonoff knoppen te bepalen
  domain: automation
  input:
    knop_L:
      name: Knop links
      description: Knop links
      selector:
        entity:
          domain: switch
          integration: esphome
    knop_R:
      name: Knop rechts
      description: Knop rechts
      selector:
        entity:
          domain: switch
          integration: esphome
    Actie_L:
      name: Actie na knop links
      default: []
      selector:
        action: {}
    Actie_R:
      name: Actie na knop rechts
      default: []
      selector:
        action: {}
trigger:
  - platform: device
    type: changed_states
    id: L
    entity_id: !input knop_L
  - platform: device
    type: changed_states
    id: R
    entity_id: !input knop_R
action:
  - if:
    - condition: trigger
      id:
        - L
    then: !input Actie_L
    else: !input Actie_R

but hopefully one more expert in this might correct me…

Sadly still the same error.
Probably a small typo i made somewhere. Hopefully someone sees it.