What does the error "Invalid blueprint: extra keys not allowed" means for a target selector?

I am writing my first blueprint by converting a working automation. I am stuck at the first, basic step where I just wanted a functional blueprint with one input to test it in the UI.

To go from an automation to the blueprint I did this:

The complete blueprint is

blueprint:
  name: Smart Switch
  description: A genric switch with reactions on various clicks
  domain: automation
  input:
    switch_entity:
      name: switch to configure
      selector:
        target:
            entity:
              filter:
                - domain: switch
alias: WHERE ⬤ WHAT switch
description: ""
trigger:
  - target: !input switch_entity
    domain: zha
    platform: device
    type: remote_button_short_press
    subtype: button_1
    enabled: true
    id: first button pressed
  - device_id: d33252aa89360e7771d798db830b0f8a
    domain: zha
    platform: device
    type: remote_button_short_press
    subtype: button_2
    id: second button pressed
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - first button pressed
        sequence:
          - service: light.toggle
            metadata: {}
            data: {}
            target:
              entity_id: light.parents_armoires
        alias: armoires
      - conditions:
          - condition: trigger
            id:
              - second button pressed
        sequence:
          - service: light.toggle
            metadata: {}
            data: {}
            target:
              entity_id: light.parents_lit
        alias: lit
mode: single

When looking at this blueprint in Settings → Automations and Scenes → Blueprints, it shows the error

Invalid blueprint: extra keys not allowed @ data['blueprint']['input']['switch_entity']['selector']['entity'][0]['filter']. Got None

I am a bit puzzled here because

  • it closely follows the documentation for blueprints and selectors
  • it would suggest that a list in expected below entity, which does not match the documentation.

I think this is a basic misunderstanding from my side that is the cause of the problem - I would appreciate a pointer to the right direction (and i will learn on the way from there as I want to expand and make my blueprint flexible to be used as a template for all my switches (wall and “button” ones)


I looked at previous similar questions but

Try this version (untested).

  input:
    switch_entity:
      name: switch to configure
      selector:
        target:
          entity:
            - domain: switch

Reference:

Target selectors examples

This will not work no matter what you do. Device triggers require a device_id not a target object. Targets are only usable on service calls.

You need to use a device selector.

    switch_device_id:
      name: switch to configure
      selector:
        device:
          entity:
          - domain: switch
            integration: zha

then…

  - device_id: !input switch_device_id
    domain: zha
    platform: device
    type: remote_button_short_press
    subtype: button_1
    enabled: true
    id: first button pressed