Kachelkarte - Card-Mod: Iconfarbe ändern funktioniert nicht zu 100%

Hallo,
ich möcjhte die Icon Farbe abhängig von der produzierten Wattzahl meines Balkonkraftwerks ändern.
Folgende Script nutze ich:

type: tile
entity: sensor.shellyplus1pm_80646fe5fdcc_switch_0_power
name: akt. Leistung
card_mod:
  style: |
    ha-card {
      {% if ( states('sensor.shellyplus1pm_80646fe5fdcc_switch_0_power') | float (0) > 1 ) %}
        --card-mod-icon: mdi:solar-power;
        --card-mod-icon-color: #8B5A00;    
      {% elif ( states('sensor.shellyplus1pm_80646fe5fdcc_switch_0_power') | float (0) > 250 ) %}
        --card-mod-icon: mdi:solar-power;
        --card-mod-icon-color: orange;
      {% elif ( states('sensor.shellyplus1pm_80646fe5fdcc_switch_0_power') | float (0) > 500 ) %}
        --card-mod-icon: mdi:solar-power;
        --card-mod-icon-color: yellow;
      {% else %}
        --card-mod-icon: mdi:solar-power;
        --card-mod-icon-color: grey;
      {% endif %}
    }

Ab 500 Watt sollte eigentlich das Icon in “yellow” erscheinen,
es bleibt aber bei “orange”.
Wo habe ich den Fehler?