Closed broyuken closed 2 months ago
you should probably hop over to the community and check the various threads on either card_mod or mushroom cards. (probably the entity-card does not allow templates on that icon-color so you need some card_mod ornate another card)
this space is for issues, nor really for support question on formatting (in another card...) ;-)
although there also is some odd syntax in your auto-entities config.
a lot to work on, in the community
to give you a head start, try:
options:
type: custom:mushroom-entity-card
card_mod:
style:
mushroom-shape-icon$: |
.shape {
outline: var(--disabled-text-color) 1.5px solid;
--icon-color: pink !important;
--icon-color-disabled: var(--disabled-text-color) !important;
--shape-color-disabled: var(--primary-background-color) !important;
--shape-color: rgb(35,35,41) !important;
}
It’s not really a formatting question, it’s an issue that you can’t seem to use templates in the icon color config. Hence the issue.
Of the mushroom card...
Fair enough
cool, please post the link if you open a thread in community or add to the existing one in mushroom card. Id love to know too
just so you know, I did test the purest config first
type: custom:mushroom-entity-card
entity: sensor.achter_deur_battery_level
card_mod:
style:
mushroom-shape-icon$: |
.shape {
outline: var(--disabled-text-color) 1.5px solid;
--icon-color: {{'red'}} !important;
--icon-color-disabled: var(--disabled-text-color) !important;
--shape-color-disabled: var(--primary-background-color) !important;
--shape-color: rgb(35,35,41) !important;
}
where
--icon-color: red;
just works out of the box.
its not always simple to find the culprit card. but by making the minimal card like this, you can test whether the template would work at all. It doesnt in this case, so we're on our way to find a solution for mushroom card first.....
I want to be able to set the icon color dynamically based on the state of a sensor. The end goal is to be able to have sensors with high battery percentage be green, 50% be yellow, and less than 20% be red. Or whatever percentages I want to put on it. When I try to code below, I get no colors and the icon circle just disappears.