Can I show icons inside templates

I use a template card on my dashboard.

I use the following code to display the number of open windows on that card:

{%set state=states('sensor.office_open_windows')%}{% if state | int >= 1 %} W: {{ state }}{% else %}{% endif %}

So if e.g. one window is open it displays β€œW: 1”. So far so good. However it would look cooler if instead of the W I could display a mdi:window-open icon in front of the counter.

I tried adding mdi:window-open in various ways but I could not get it to work. Btw. I am happy with a static icon, does not have to be dynamic.

Yes, it’s in the doc for markdown cards

1 Like