Using FOR loop with multiple entities

I’m trying to create a simple blueprint that accepts different lights as input and when triggered by a Telegram command just sends a notification with their names - but it doesn’t work.

Here’s my simple blueprint code:

  name: Telegram Blueprint Test
  domain: automation
      name: Light
          domain: light
          multiple: true
  - platform: event
    event_type: telegram_command
      command: /test

  - service: notify.telegram
      message: >-
        Here are the selected lights:
        {% for u in light_entities %}
            {{ }}
        {% endfor %}

mode: single

When I use the /test command in Telegram, I just recieve “Here are the selected lights:”, but then nothing. I also tried it with

        {% for u in light_entities %}
            {{ u }}
        {% endfor %}

but that also didn’t work. So how do I need to create the for loop, or in general: How can I send a List of all the selected lights?

‘light_entities’ needs to be put in a variable. !inputs will not work in templates directly.
Look in the blueprint exchange for examples, most of the BP’s use these.

1 Like

Thanks. That removed one problem from the pile of other problems I have with this project!

1 Like