Entity card for dashboard (Jinja for loop)

Hey,

I created a new card for my dashboard. The card is to give an overview of available scenes which can be activated.

When I use specific entities, everything works well:

...
cards:
      - type: entities
        entities:
          - type: buttons
            entities: 
              - entity: scene.room_1
              - entity: scene.room_2
...

It would be better to use a dynamic for loop to get available entities:

...
cards:
      - type: entities
        entities:
          - type: buttons
            entities: >
              {% for state in states.scene %}
                - entity: {{state.entity_id}}
              {% endfor %}
...

Unfortunately, it does not work. I always get the error, that entities needs to be an Array. The for loop seems not to work correctly. Any ideas what I am doing wrong?

I think this one will help you even better…
thomasloven/lovelace-auto-entities: :small_blue_diamond:Automatically populate the entities-list of lovelace cards (github.com)

I already use this card, but in this case, it would be better to have the small buttons.

The idea is to use auto entities on top of buttons card, not sure why this would not work for you as I cannot guess your requirements :slight_smile: