Hello all,
I am trying to become lazier and have an integration to follow the number of dishwasher tabs at home AND to change the colors and possibly the icon when I will be soon short.
So I create my counter, named “counter.dishwasher_tabs”.
I also created an automation, that decrementes it after every run of my dishwasher. Both work.
And now I am trying to create a mushroom template card to follow this value… and something is wrong in my code.
type: custom:mushroom-template-card
primary: Dishwasher tabs
secondary: '{{states.counter.dishwasher_tabs.state}} tabs'
icon: mdi:dishwasher
icon_color: >-
{% set tab= state('states.counter.dishwasher_tabs.state')}
{% if tab > 7}
green
{% else %}
red
{% endif %}
To complete, I can see the correct number of tabs displayed in the “secondary” but my code to change the color is wrong, and I cannot see the problem. I tried to adapt it from other template card, but they were using sensors or things like that.
Please can you help me?