🔹 Card-mod - Super-charge your themes!

Solution:

Note: config.entity is the entity id in this context found here

type: custom:auto-entities
card:
  type: entities
  title: Docker
filter:
  template: >-
    {%- for item in states.sensor |
    selectattr('entity_id','in',integration_entities('portainer')) -%}
      {%- if "portainer_sidmesh" in item.entity_id -%}
          {{
            {
              'type': 'custom:template-entity-row',
              'entity': item.entity_id,
              'name': state_attr(item.entity_id,'friendly_name') | replace('Portainer SidMesh (local) ',''),
              'state': item.state,
              'icon': 'mdi:docker',
              'card_mod': {
                'style': ".state { background-color: {% if is_state(config.entity,'running') %} green {% elif is_state(config.entity,'created') %} orange {% else %} red {% endif %} }"
              }
            }
          }},
      {%- endif -%}
    {%- endfor -%}
sort:
  method: friendly_name