Get entities from input list in automation/blueprint

Hello! I have a blueprint that accepts an input (a list of door sensors). In my automation I want to check in a condition, if all sensors are closed - only then should the automation run. The problem is, that the input is actually a key-value pair (entity_id: ['sensor.e08_wds']). How can I get the list of entities in my template condition?

blueprint:

# ...
  input:
    contacts:
      name: Contacts
      description: If any of the given contacts is on, the target wont turn on.
      default: []
      selector:
        target: {}
# ...
variables:
  contacts: !input contacts
# ...
condition:
  - condition: and
    conditions:
      # other conditions...
      - "{{ expand(contacts) | selectattr('state', 'eq', 'on') | list | count == 0 }}"

Debugging the automation, the condition step detail is:

conditions/1
Executed: July 26, 2022 at 10:37:24 PM
Result:
result: true
entities:
  - entity_id # should be - sensor.e08_wds

This is how I pass the input to blueprint:

      contacts:
        entity_id:
          - binary_sensor.e08_wds_contact
2 Likes