Greetings. Looked everywhere for this: Iāve already successfully been able to change icon color based on state (thanks to the community for that!); but would like to, also, be able to change the background as well:
Is there a sort of bg_color: |- ... option much like icon_color |- ... ?
Sure: Hereās the code for the color coding chips; in this example, the processor use and its thresholds (these levels are what we think they should be, you can change to whatever you want!), that go from bright green (#00ff00), to green, yellow, orange and red depending on usage percentage:
type: custom:mushroom-chips-card
chips:
- type: template
entity: cover
icon: mdi:desktop-tower
icon_color: |-
{% set state=states('sensor.processor_use') | float() %}
{% if state<=25 %}
#00ff00
{% elif state>=26 and state<=50 %}
green
{% elif state>=51 and state<=75 %}
yellow
{% elif state>=76 and state<=90 %}
orange
{% elif state>91 %}
red
{% else %}
white
{% endif %}
hold_action:
action: none
tap_action:
action: navigate
navigation_path: yourURLhere
double_tap_action:
action: none
And hereās the code of the card/tab (not chip) from OP āmovementā sensor example:
Sorry, but this is the page that my questions brought me too, not the others, so i figured it was most relevant here. Why not delete or merge the thread if we are expected to ignore this one.
I was simply providing you a larger audience with links to the main threads. Ome of threads I shared has an extensive Mushroom guide that includes styling Mushroom Chip cards.