Is it possible: place an icon in the state of a template sensor?

Hello,
to safe space I would like to combine 3 sensors into one:

    - name: Verschlussstatus
      state: "H: {{ state_attr('binary_sensor.dachfenster', 'offen') }}, D: {{ state_attr('binary_sensor.dachfenster', 'offen') }}, K: {{ state_attr('binary_sensor.kellerfenster', 'offen') }}"

That leads to:

H: 0, D: 0, K: 1

Now I would like to make this prettier:

  • replace H:, D: and K: by some nice icons
  • I would like to colorize these icons dependend on the state of the single sensor

Is that feasible ?

No. states can’t contain images.

Entity colour is also a dashboard thing, not a thing that entities care about.

Any suggestion, how to make this nicer in a badge or chips-card? Can I combine 3 badges, that they take less space together?

I’m not aware of any easy way of doing that, but then I don’t make a lot of use of the frontend.