I have change it and make a Sensor for the Markdown :
eg_active:
value_template: >-
{% set lights = [states.light.wohnzimmer, states.light.kuche, states.light.tradfri_esszimmer, states.light.wc, states.light.flur_eg] %}
{% set lights_on = lights | selectattr('state','eq','on') | list %}
{% set lights_name = lights | selectattr('state','eq','on') | map(attribute='name') | join(', ') %}
{% if (lights_on ) %}
{{ lights_name | regex_replace(',([^,]*)$',' und\\1') }} sind an</b>
{% else %}
<font color='#6a7377'><b>Alle Lampen sind aus</font>
{% endif %}
now, it woks with the Name. But i need to have a Image for each light instead of the Name. hmmmmm…
The card now is easy and looks like:
- type: custom:hui-markdown-card
style:
top: 18.5%
left: 65%
content: >
<b>{{ states('sensor.eg_active') }}</b>