When the state of input_boolean.zoutniveaulaag changes, the color of the icon does not change. I can not see what is wrong. Do you ??
- type: horizontal-stack
cards:
- type: custom:button-card
entity: 'input_boolean.zoutniveaulaag'
icon: 'mdi:raspberry-pi'
aspect_ratio: 1/1
name: Waterontharder
styles:
card:
- background-color: '#000044'
- border-radius: 10%
- padding: 10%
- color: ivory
- font-size: 12px
- text-shadow: 0px 0px 5px black
- text-transform: capitalize
grid:
- grid-template-areas: '"i temp" "n n" "cm cm" "cm-p cm-p" "wifi wifi"'
- grid-template-columns: 1fr 1fr
- grid-template-rows: 1fr min-content min-content min-content min-content
name:
- font-weight: bold
- font-size: 13px
- color: white
- align-self: middle
- justify-self: start
- padding-bottom: 4px
img_cell:
- justify-content: start
- align-items: start
- margin: none
icon:
- color: >
[[[
if (entity.state = 'on') return 'lime';
if (entity.state = 'off') return 'orange';
else return 'red';
]]]
- width: 70%
- margin-top: -10%