Text colour change based on state

I’m trying to create conditional formatting where the text for the doors chnge depending on state (open doors = green text, closed doors = red text). How can I achieve this please?

type: entities
entities:  
  - entity: binary_sensor.front_door_contact  
  - entity: binary_sensor.garagae_door  
  - entity: binary_sensor.lean_to_door_contact  
  - entity: binary_sensor.utility_door_contact  
  - entity: binary_sensor.lumi_lumi_sensor_magnet_aq2_opening  
  - entity: binary_sensor.lumi_lumi_sensor_magnet_aq2_opening_3
title: Doors

Go to card-mod thread → 1st post → link at the bottom → styles for Entities card

1 Like