Card Mod suddenly not showing colors anymore

I do use an entity card in combination with card-mod.
It did work properly before but suddenly not anymore.?
Is there something changed in HA or card mod I missed?
This did work before:

type: entities
title: Regen (Ecowitt)
show_header_toggle: false
entities:
  - entity: sensor.regensensor
    name: Regent het
    icon: mdi:weather-pouring
    card_mod:
      style: |
        :host {
          color:
            {% set rain = states('sensor.regensensor') %}
            {% if rain == 'Regen' %}
              rgba(37, 150, 190)
            {% else %}
              white
            {% endif %};
        }
  - entity: sensor.gw2000a_24h_rain
    name: Regen per 24 uur
  - entity: sensor.gw2000a_rain_rate
    name: Regenintensiteit
  - entity: sensor.gw2000a_event_rain
    name: Regen per bui
  - entity: sensor.gw2000a_hourly_rain
    name: Regen per uur
    card_mod:
      style: |
        :host {
          color:
            {% set rain = states('sensor.gw2000a_hourly_rain') | float(0) %}
            {% if rain > 2.6 %}
              red
            {% elif rain > 1.2 %}
              orange
            {% elif rain > 0 %}
              rgba(37, 150, 190)
            {% else %}
              white
            {% endif %};
        }
  - entity: sensor.gw2000a_daily_rain
    name: Dagelijkse regen
  - type: custom:fold-entity-row
    head:
      type: section
      label: Meer informatie
    entities:
      - entity: sensor.gw2000a_weekly_rain
        name: Regen per week
      - entity: sensor.gw2000a_monthly_rain
        name: Regen per maand
      - entity: sensor.gw2000a_yearly_rain
        name: Regen per jaar
      - entity: sensor.gw2000a_total_rain
        name: Regen totaal

But not any more? Is there a solution?
Thanks

I have seen situations where my card-mod just stops working, and all I do to resolve it is to re-download the card-mod in hacs and then it will work (I know, weird). Give it a shot

Thanks a lot.
That did the trick.
It is working again!

1 Like