Using Mushroom Light Card with a Template in Auto-Entities

So I’m trying to utilize a template to expand a preset group (Manual Lights) within an auto-entities card such that it displays only the lights within that group that are currently on using a mushroom light card.

Based on testing:

  • the first auto-entities card returns every light in the house that is on and uses the mushroom card
  • the second auto-entities card only returns lights in the Manual Lights group that are on but uses the glance card
  • the third auto-entities card is an attempt to combine the first two, however it displays nothing.

Practically speaking, the goal is to combine the first and second auto-entities cards into a single stack such that the vertical stack will have the popup bubble card listed first and a singular auto-entities card second that, using a mushroom lights card, will display only the lights in the Manual Lights group that are currently turned on. (Since it’s a popup bubble card, that one won’t actually be visible outside of the code, but you get the idea)

Anybody see where I’m going wrong? I feel like its something simple but am just not making the connection.

type: vertical-stack
cards:
  - type: custom:bubble-card
    card_type: pop-up
    hash: '#lights test'
    show_header: false
  - type: custom:auto-entities
    card:
      type: grid
      columns: 1
      square: false
    card_param: cards
    filter:
      include:
        - domain: light
          state: 'on'
          options:
            type: custom:mushroom-light-card
      exclude: []
    show_empty: true
  - type: custom:auto-entities
    card:
      type: glance
    filter:
      template: |
        {% for light in 
        expand ('light.manual_lights') %}
         {% if light.state == "on" %}
          {{ light.entity_id}},
         {% endif %}
        {% endfor %}
  - type: custom:auto-entities
    card: 
      type: grid
      columns: 1
      square: false
    card_param: cards
    filter:
      template: |
        {% for light in 
        expand ('light.manual_lights') %}
         {% if light.state == "on" %}
          {{ 
            {
              'type': 'custom:mushroom-light-card'
              'entity': light.entity_id
            }
          }},
         {% endif %}
        {% endfor %}
    show_empty: true