Card-mod and conditionnal not working?

Hi :slight_smile:

I can’t succeed to make conditionnal working :frowning:

title: Températures
type: entities
entities:
  - entity: sensor.temp_hr_1_temperature
    card_mod:
      style: |
        .entities-row>div:nth-child(2)  {
          color: [[ if(sensor.temp_hr_1_temperature > 18, "#FF8800", "") ]];
          }
    type: 'custom:multiple-entity-row'
    name: Salon
    icon: 'mdi:sofa'
    entities:
      - entity: sensor.temp_hr_1_humidity
        name: false
  - entity: sensor.temp_hr_2_temperature
    type: 'custom:multiple-entity-row'
    name: Chambre
    icon: 'mdi:bed'
    entities:
      - entity: sensor.temp_hr_2_humidity
        name: false
  - entity: sensor.temp_hr_3_temperature
    type: 'custom:multiple-entity-row'
    name: Bureau
    icon: 'mdi:desk'
    entities:
      - entity: sensor.temp_hr_3_humidity
        name: false

I want to apply a specific color when the temperature is changing but it does’t work and I dont know why…

The CSS target is correct, the color is changing when I delete the condition, but my if statement does’t works.

Any ideas ? Thanks :wink:

Nobody ? :frowning:

Your syntax looks completely made up. The language is jinja, it’s the same as the templating language. You should be using the states() method with an | int filter when comparing to 18. You’ll also have to follow the if / else syntax for Jinja.