How to add script into Dashboard cards

Hello,
newbie question.

I have a template that lists all my lights:

{% for alight in states.light|map(attribute="entity_id")|list|sort  -%}  
 - {{alight}}{{"\n"}}
{%- endfor %}

Which creates:

- light.guest_wc_spot_light
- light.hall_sconce_lights
- light.hallway_sconce_1_light
- light.hallway_sconce_2_light
- light....

I want to embed this is a dashboard card - so I have something like this

type: entities
entities: |
  {% for alight in states.light|map(attribute="entity_id")|list|sort  -%}  
  - {{alight}}{{"\n"}}
  {%- endfor %}

But this gives Entities must be specified error.

I can’t seem to work out the right approach / syntax. Can you point me in the right direction?

Steve

I have not tried your code with an entity card but, the code does show the entities in the developer tools … template area.


I will be interested to see your solution when it shows up.