Help w/ Conditonal Card to show entities from a template sensor

I made a template sensor that tells me which battery entities are below 70% and that’s working properly. Now I’d like to show any entities that have low batteries in a conditional card and I’m not sure what I’m doing wrong.

I’m sure it’s probably a dumb error in my syntax, but I can’t figure it out.

Here’s my conditional card:

      - type: conditional
        conditions:
          - condition: state
            entity: binary_sensor.check_battery_entities
            state: 'on'
        card:
          type: entities
          entities: |
            {%- set ents = 
                      state_attr(
                           'binary_sensor.check_battery_entities',
                           'entity_id') -%}
            {%- for ent in ents %}
            - {{ ent }}
            {%- endfor %}

In the dashboard, I get an error that says “Entities must be specified”

type: entities
entities: |
  {%- set ents = 
            state_attr(
                 'binary_sensor.check_battery_entities',
                 'entity_id') -%}
  {%- for ent in ents %}
  - {{ ent }}
  {%- endfor %}

Here’s what I get in the template editor showing the correct set of entities:

Entities={{ state_attr('binary_sensor.check_battery_entities', 'entity_id') }}
---
Alert={{ state_attr('binary_sensor.check_battery_entities', 'alert') }}
----
start
  {%- set ents = 
              state_attr(
                   'binary_sensor.check_battery_entities',
                   'entity_id') -%}
  {%- for ent in ents %}
  - {{ ent }}
  {%- endfor %}
end

Output:

Entities=['sensor.nook_shades_remote_battery_level', 'sensor.shade_remote_battery_level']
---
Alert=True
----
start
  - sensor.nook_shades_remote_battery_level
  - sensor.shade_remote_battery_level
end

I found my answer: templates aren’t supported in Core lovelace cards. I got this working by using the third-party auto-entities card.