Glance card for all entities with a certain device class?

Is there any way to specify the list of entities for a glance card by the device_class attribute?

I want to list all the entities with the device_class ‘opening’ so I can see at a glance which windows are open.

I can use the entity_filter card but I’d have to list all the entities manually and then filter on if it’s open or not, but I prefer to be able to see all the devices all the time, that way I learn that the top left is the back door, for example, and I find that faster than reading the name.

So in short I want to be able to populate the list of entities for a glance card using a template, like this one I can paste into the dev tool:

{{ states.binary_sensor
       | selectattr('attributes.device_class', 'eq', 'opening')
       | map(attribute='name')
       | list }}