Hello,
this is my script for my chips card on top of my dashboard. I would like the color of the battery icon to change, based on its sensor’s state:
- type: custom:mushroom-chips-card
chips:
- type: entity
entity: sensor.tabingresso_battery_level
double_tap_action:
action: none
use_entity_picture: false
hold_action:
action: none
icon_color: >-
{% set level = state('sensor.tabingresso_battery_level') %}
{% if level >= 7 %}
green
{% else %}
red
{% endif %}
…but con is always white:
This below code works if used for a custom:mushroom-template-card (still not works for chips card), but only if I tell the script to look for a specific value (29):
{% if is_state('sensor.tabingresso_battery_level', '29') %}
yellow
{% endif %}
Any idea??
Thanks!