Entities by label in streamline-card

I used streamline-card to make some re-usable template cards, which is great, but then I realised it can be used to dynamically generate cards from a list of entities:

In the example the list of entities comes from the attribute of a sensor, but I couldn’t figure out how to add attributes to a template sensor configured from the ui :confused: and the main state of the sensor has to be string not list.

The javascript templating system does have a states object, but it would be slow to iterate every state in my home assistant looking for the relevant entities (there are thousands).

All the entities I’m interested in have a specific label, how can I get a list of these entities to use in this card? Or is there another better way to automatically generate a card for every entity that has a particular label?

Thanks!