Kachel Karte: Icon Farbänderung Statusabhängig

Servus,
ich hänge gerade an der Anpassung einer tile card. Ich möchte gerne abhängig von einem sensor status die Farbe des Icon ändern.
Ich hoffe das ich mit card_mod hier auf dem rictigen Weg bin.

        - type: tile
          entity: sensor.ehw2uxtb_status
          name: Wallbox
          card_mod:
            style: |
              .tile {
                {% if is_state(config.entity,'charging') %}
                  --tile-color: var(--rgb-red-color);
                {% elif is_state(config.entity,'lädt') %}
                  --tile-color: var(--rgb-blue-color);
                {% else %}  
                  --tile-color: var(--rgb-purple-color);
                {% endif %}  

Alternativ hatte ich es schon mit sensor.ehw2uxtb_status anstelle von config.entity probiert. Wie zu sehen ist habe ich auch mit dem Status “gespielt”. Leider keine Änderung, hat jemand eine Idee?
edit: Bei der Farbe tut sich gar nichts

Ich nutze das bei mir auch, setze mal ein !important dahinter

   --tile-color: red !important;

Nein das war es leider nicht. Der Sensor liefert charging, aber ändern tut sich nichts

Hast du es denn mal mit is_state('sensor.ehw2uxtb_status','charging') und !important versucht?

Danke für deine Hilfe, ich habe meinen Fehler gefunden;
Es muss statt:

         card_mod:
            style: |
              .tile {
                {% if is_state(sensor.ehw2uxtb_status,'charging') %}
                  --tile-color: red !important;
                {% else %}  
                  --tile-color: orange !important;
                {% endif %}  

so aussehen

card_mod:
  style: |
    **ha-card** {
      {% if is_state(**config.entity**, 'completed') %}
        --tile-color: green !important;
      {% else %}
        --tile-color: red !important;
      {% endif %}
    }