Change text color

I have interfaced APC SmartUPS and got this:

type: entities
entities:
  - entity: sensor.ups_system_identifier
    name: System identifier
  - sensor.ups_status
  - entity: sensor.ups_input_voltage
    name: Input Voltage
  - entity: sensor.ups_load
    name: Load
  - entity: sensor.ups_output_voltage
    name: Output Voltage
  - entity: sensor.ups_status_data
    name: Status Data
title: UPS Status
state_color: false
theme: Dark-Gray

How can I change ‘sensor.ups_status_data’ to color ‘red’ when its value goes from OL → BL

Firefox_Screenshot_2022-07-03T14-35-31.862Z

Go to card-mod thread.

Thanks … it worked.

type: entities
entities:
  - entity: sensor.ups_system_identifier
    card_mod:
      style: |
        :host {
          color: yellow;
          }
    name: System identifier
  - sensor.ups_status
  - entity: sensor.ups_input_voltage
    name: Input Voltage
  - entity: sensor.ups_load
    name: Load
  - entity: sensor.ups_output_voltage
    name: Output Voltage
  - entity: sensor.ups_status_data
    card_mod:
      style: |
        :host {
          color: red;
          }
    name: Status Data
title: UPS Status
state_color: false
theme: Dark-Gray

Still I haven’t figured out how to set condition for color change …

Take a look at the construction of this post: 🔹 Card-mod - Add css styles to any lovelace card - #3000 by Ildar_Gabdullin. I think you can something similar for the text?