Allow using a list in blueprint selectors

It would be helpful to allow using a list in the selectors, when creating blueprints. For example, when using the device selector with model filter, there are often occasions when several models of a device should be able to share a blueprint. For instance, if the model name is changed to indicate a region, however the device is otherwise the same.


Another example, is the Aeotec NanoMote Quad, WallMote Quad and MiniMote - From a standpoint of creating a blueprint for ozw.scene_activated events, all 3 remotes work exactly the same.

Partial example showing showing compatible models

blueprint:
  name: Aeotec Quad Remotes
  description:
  domain: automation
  input:
    aeotec_nanomote:
      name: Aeotec Quad Remotes
      description:
      selector:
          device:
            integration: ozw
            manufacturer: Aeotec Limited
            model:
              - ZWA003 NanoMote Quad
              - ZW130 WallMote Quad
              - DSA03202 Minimote

Another example for inovelli switches and dimmer - There are actually four models that could be combined to a single blueprint, if they were to allow a list in the selector

Partial example showing showing compatible models

blueprint:
  name: Inovelli
  description: Create automations for the Inovelli switches and dimmers using the OZW integration. 
  domain: automation
  input:
    inovelli_switch:
      name: Inovelli
      description: "List of available inovelli Switches and Dimmers
      This list is only a reference. At this time, it is not possible
      to obtain the node's id using the device selector."
      selector:
          device:
            integration: ozw
            manufacturer: Inovelli
            model:
              - LZW30-SN Switch Red Series
              - LZW31-SN Dimmer Red Series
              - NZW30 Smart Switch (w/Scene)
              - NZW31 Smart Dimmer (w/Scene)

At this time, trying to include multiple models in a blueprint will result in the following error.

Invalid blueprint: expected str for dictionary value @ data['blueprint']['input']['inovelli_switch']['selector']['model']. Got None

Seconded. My use case for this is that I want binary_sensors of device_class door, window, and cover to be allowed in the selector.

2 Likes

Seconds this but slightly different (maybe as an intermediate step): Allow multiple selectors per input.

input:
  name: Name
  selector:
    - entity:
        domain: input_boolean
    - entity:
        domain: binary_sensor

That’s exactly my use case, I need something that can be on or off, regardless of being a binary sensor or a (computed) input_boolean.

1 Like

I would definitely appreciate this feature request getting added.

1 Like

If we could use lists, we could just have a list of domains :wink:

Fourth! My use case is the same as @trankillity, I’d like to set up a blueprint which can choose a binary_sensor from a variety of device_classes (for me, it’s door and motion).

1 Like

FYI, I am in the process of testing, but it seems like documentation indicates this is possible:

Classic HA documentation! We have the feature, but it’s not documented well enough for people who don’t know what they are doing to figure out how to use the feature.
How much more time would it take to actually show an example of the usage of what people are asking for?
For anyone else looking, I figured out how to list entities:

    target_fan_speed:
      name: Fan speed sensor
      description: The fan speed sensor.
      selector:
        entity:
          domain: sensor
          include_entities:
            - sensor.kids_fan_speed
            - sensor.guest_room_fan_speed
            - sensor.kitchen_fan_speed
            - sensor.lounge_fan_speed
            - sensor.main_bedroom_fan_speed
            - sensor.pedestal_fan_speed

Personally, I think it would make more sense to be able to use a wildcard (maybe you can but I couldn’t make it work)
EG:

    target_fan_speed:
      name: Fan speed sensor
      description: The fan speed sensor.
      selector:
        entity:
          domain: sensor
          include_entities:
            - sensor.*_fan_speed
1 Like

This is currently doable using the following syntax:

    inovelli_switch:
      name: Inovelli On/Off Switch
      description: List of available Inovelli On/Off switches.
      selector:
        target:
          device:
            - integration: zwave_js
              manufacturer: Inovelli
              model: LZW30-SN
            - integration: zwave_js
              manufacturer: Inovelli
              model: LZW30
1 Like

I found that syntax indeed works, but it introduces a problem : in the web UI, the selector now allows not just for devices, but also for area and entities.

This is what the selector looks like :

If I click “Choose device” I see the list of devices of the relevant models.
However, the UI allows selecting more than one, even though that is unwanted.

This is the syntax I’m using in the blueprint :

blueprint:
  name: Zooz ZEN76
  description: Automations helper for the Zooz ZEN76 Switch using the Zwave
    JS integration.
  domain: automation
  input:
    zooz_zen76:
      name: Zooz ZEN76
      description: The ZEN76 Switch to interact with.
      selector:
        target:
          device:
            - integration: zwave_js
              manufacturer: Zooz
              model: ZEN76
            - integration: zwave_js
              manufacturer: Zooz
              model: ZEN76 800LR

Questions :
With the multiple models of switches listed, is there a way to a) remove the selector for “Choose area / entity”.
b) force only one device to be selected (don’t allow more than one)

You’ll use something like this:

  input:
    zooz-switch:
      name: Zen77 Dimmer
      description: List of available Zen77 dimmers.
      selector:
        device:
          filter:
            - integration: zwave_js
              manufacturer: Zooz
              model: ZEN77
            - integration: zwave_js
              manufacturer: Zooz
              model: ZEN77 800LR
1 Like

Thank you ! That worked.

Here is the complete working blueprint.

blueprint:
  name: Zooz ZEN76
  description: Automations helper for the Zooz ZEN76 Switch using the Zwave
    JS integration.
  domain: automation
  input:
    zooz_zen76:
      name: Zooz ZEN76
      description: The ZEN76 Switch to interact with.
      selector:
        device:
          filter:
            - integration: zwave_js
              manufacturer: Zooz
              model: ZEN76
            - integration: zwave_js
              manufacturer: Zooz
              model: ZEN76 800LR
    switch_up_1x:
      name: Top Paddle 1x
      description:
        "Action to run on switch upper paddle single tap. Default: Turn
        on switch."
      default: []
      selector:
        action: {}
    switch_up_2x:
      name: Top Paddle 2x
      description: "Action to run on switch upper paddle double tap."
      default: []
      selector:
        action: {}
    switch_up_3x:
      name: Top Paddle 3x
      description:
        "Action to run on switch upper paddle triple tap. Default: Enter
        inclusion/pairing mode."
      default: []
      selector:
        action: {}
    switch_up_4x:
      name: Top Paddle 4x
      description: Action to run on switch upper paddle quadruple tap.
      default: []
      selector:
        action: {}
    switch_up_5x:
      name: Top Paddle 5x
      description: Action to run on switch upper paddle quintuple tap.
      default: []
      selector:
        action: {}
    switch_up_hold:
      name: Top Paddle Hold
      description: "Action to run on switch upper paddle press-and-hold."
      default: []
      selector:
        action: {}
    switch_up_release:
      name: Top Paddle Release
      description: Action to run on switch upper paddle release.
      default: []
      selector:
        action: {}
    switch_down_1x:
      name: Lower Paddle 1x
      description:
        "Action to run on switch lower paddle single tap. Default: Turn
        off switch load."
      default: []
      selector:
        action: {}
    switch_down_2x:
      name: Lower Paddle 2x
      description: Action to run on switch lower paddle double tap.
      default: []
      selector:
        action: {}
    switch_down_3x:
      name: Lower Paddle 3x
      description:
        "Action to run on switch lower paddle triple tap. Default: Enter
        exclusion/un-pairing mode."
      default: []
      selector:
        action: {}
    switch_down_4x:
      name: Lower Paddle 4x
      description: Action to run on switch lower paddle quadruple tap.
      default: []
      selector:
        action: {}
    switch_down_5x:
      name: Lower Paddle 5x
      description: Action to run on switch lower paddle quintuple tap.
      default: []
      selector:
        action: {}
    switch_down_hold:
      name: Bottom Paddle Hold
      description: "Action to run on switch lower paddle press-and-hold."
      default: []
      selector:
        action: {}
    switch_down_release:
      name: Bottom Paddle Release
      description: Action to run on switch lower paddle double tap.
      default: []
      selector:
        action: {}
mode: single
max_exceeded: silent
trigger:
  - platform: event
    event_type: zwave_js_value_notification
    event_data:
      command_class_name: Central Scene
      device_id: !input zooz_zen76
action:
  - variables:
      scene_id: "{{ trigger.event.data.label }}"
      attribute_id: "{{ trigger.event.data.value }}"
  - choose:
      - conditions: "{{ scene_id == 'Scene 001' }}"
        sequence:
          - choose:
              - conditions: "{{ attribute_id == 'KeyPressed' }}"
                sequence: !input switch_up_1x
              - conditions: "{{ attribute_id == 'KeyPressed2x' }}"
                sequence: !input switch_up_2x
              - conditions: "{{ attribute_id == 'KeyPressed3x' }}"
                sequence: !input switch_up_3x
              - conditions: "{{ attribute_id == 'KeyPressed4x' }}"
                sequence: !input switch_up_4x
              - conditions: "{{ attribute_id == 'KeyPressed5x' }}"
                sequence: !input switch_up_5x
              - conditions: "{{ attribute_id == 'KeyHeldDown' }}"
                sequence: !input switch_up_hold
              - conditions: "{{ attribute_id == 'KeyReleased' }}"
                sequence: !input switch_up_release
      - conditions: "{{ scene_id == 'Scene 002' }}"
        sequence:
          - choose:
              - conditions: "{{ attribute_id == 'KeyPressed' }}"
                sequence: !input switch_down_1x
              - conditions: "{{ attribute_id == 'KeyPressed2x' }}"
                sequence: !input switch_down_2x
              - conditions: "{{ attribute_id == 'KeyPressed3x' }}"
                sequence: !input switch_down_3x
              - conditions: "{{ attribute_id == 'KeyPressed4x' }}"
                sequence: !input switch_down_4x
              - conditions: "{{ attribute_id == 'KeyPressed5x' }}"
                sequence: !input switch_down_5x
              - conditions: "{{ attribute_id == 'KeyHeldDown' }}"
                sequence: !input switch_down_hold
              - conditions: "{{ attribute_id == 'KeyReleased' }}"
                sequence: !input switch_down_release