Colours of emperature and humidity data in a multple-entity-row

Hi,

I am trying to set up a card for my temp and humidity sensors where the color of the icon is changed according to values the sensor returns.

type: vertical-stack
heading_style: title
cards:
  - type: entities
    entities:
      - entity: sensor.sensor_atelier_temperature
        name: Atelier
        format: precision1
        icon: mdi:palette
        type: custom:multiple-entity-row
        entities:
          - entity: sensor.sensor_atelier_humidity
            format: precision0
            name: false
        card_mod:
          styles: |
            .state.entity |
            {% if states('sensor.sensor_atelier_humidity') | float < 40 %} 
                color: red;
            {% elif states('sensor.sensor_atelier_humidity') | float > 50 %}
                color: red;
            {% else %}
                color: white
            {% endif %} }

This does not work - any ideays how I can get it working? :slight_smile:

Alternatively - how is it possible to change this color in a standard Area Card? This also does not work:

alert_classes:
  - moisture
sensor_classes:
  - temperature
  - humidity
display_type: compact
type: area
area: atelier
features_position: bottom
color: |
  {% if states('sensor.sensor_atelier_humidity') | float < 40}
    red
  {% elif states('sensor.sensor_atelier_humidity') | float > 40}
    red
  {% else %}
    white
  {% endif %}
vertical: false