Hi, I have following entity card, and I would like to change the color of „Now“ entity. If the entity’s state is more than 50%, then green color, if less than 50%, then red color. So, in this case, the number „11%“ should be red.
Thank you
type: custom:mod-card
card:
type: horizontal-stack
title: Battery
cards:
- type: entities
entities:
- entity: sensor.tpj4cjm04k_statement_of_charge_2
name: Now
card_mod:
style:
hui-generic-entity-row $: |
state-badge {
display: none;
}
- entity: sensor.max_baterie_fve_dnes_2
name: Max today
card_mod:
style:
hui-generic-entity-row $: |
state-badge {
display: none;
}
show_header_toggle: false
card_mod:
style:
.: |
#states > * {
margin: 2px -10px !important;
margin-left: -25px !important;
font-size: 10.5px;
--mdc-icon-size: 18px;
}