How to merge entity_id lists from multiple selectors for State Trigger

I’m trying to use the input of multiple selectors as the entity_id list for a state trigger. Looking at the docs, I can specify multiple single entities like so:

    - trigger: state
      entity_id:
        - device_tracker.paulus
        - device_tracker.anne_therese

But trying to do the same with input selector lists gives me an error. Example:

blueprint:
  name: Multi Entity Repro
  source_url: https://todo
  domain: automation
  input:
    priority_one_sensors:
      name: Sensors
      selector:
        entity:
          filter:
            domain: binary_sensor
          multiple: true
    priority_two_sensors:
      name: Sensors
      selector:
        entity:
          filter:
            domain: binary_sensor
          multiple: true
      default: []
trigger:
  - trigger: state
    entity_id:
      - !input priority_one_sensors
      - !input priority_two_sensors
    to:
      - "on"
      - "off"
actions:
  - action: system_log.write
    data:
      message: "repro"
mode: restart

Error example:

Message malformed: Entity [‘binary_sensor.front_door_sensor_door’] is neither a valid entity ID nor a valid UUID for dictionary value @ data[‘entity_id’]

Is there a right way to do this? Or is this similar to the multiple triggers list case that needed code changes to support?

Add a syntax for merging lists of triggers

Howdee [email protected],

When you do ‘multiple’, you are specifying that input as a list, so you can’t list lists. The lists would have to be merged In a template_variables: key section, that is assuming that that’s a thing that is available using limited templates (and I don’t know that it is, TBH). You would have to check that on your own.
I would just do 2 triggers, using the !input’s as a single list entity in each as those are already lists.

Thanks Sir_Goodenough for confirming no list of lists here. Yeah, multiple triggers is what I currently have running.

@karwosts Is this kind of like the issue you fixed with your PR? Essentially adding support for a list of lists of triggers when you added “triggers:”? Would adding “entity_ids:” (maybe bad name :)) be one way to add support for this? Not asking you to fix and I doubt this is worth doing, just trying to improve understanding.

entity_ids:
  - entity_id: !input priority_one_sensors
  - entity_id: !input priority_two_sensors