rajan
(Raivo Kask)
July 3, 2022, 2:41pm
1
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
rajan
(Raivo Kask)
July 4, 2022, 11:45am
3
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?
I’m starting to get to grips with style BUT no matter what, I cannot seem to change font colour. What am I missing here?
type: tile
card_mod:
style: |
ha-card {
color: yellow;
border: 3px solid cyan;
background-color: #002200;
}
entity: switch.lidlplug_1_flies
name: Fly zapper
color: light-blue
icon: mdi:bacteria-outline
scargill:
color: yellow;
This property defined on the “ha-card” level cannot be used blindly for ANY card, ANY card’s element. In some cases you have need to define a color for a PARTICULAR element (in your example - either for a name or a state).
Nearly, but no. Stumbled on this which WORKS -
. Someone used --secondary-text-color so I blindly tried --primary-text-color - and it works!
Now, as you rightly indicate it woudld be nice to separate name from state, but various cominations of the above to include state and name failed - ideas please…
Ignore the unavailable, wife pulled out the plug…