Karumbe
(Toni)
December 16, 2023, 6:22pm
1
How can modify the icon color and/or animation when the battery level of the entity falls to specific value in card :
- type: custom:button-card
aspect_ratio: 1
entity: binary_sensor.door_garage
show_name: false
state:
- color: rgb(255,193,0)
icon: mdi:door-closed
value: 'off'
- color: rgb(0,255,0)
icon: mdi:door-open
value: 'on'
I want the icon blink or change to yellow when the battery level falls to 10%
Thanks
This is a right place to ask questions related to the custom:button-card:
Button card
Lovelace Button card for your entities. -> github
[all]
Features
works with any toggleable entity
3 actions on tap toggle, more_info and service
state display (optional)
custom color for on and off state (optional)
custom state definition with customizable color (optional)
custom size (optional)
custom icon (optional)
custom css style (optional)
automatic color for light (optional)
custom default color for lights (when color cannot be determined) (optional)
2 color types
icon :…
Karumbe
(Toni)
December 16, 2023, 9:46pm
3
Clear, the question is if there is another way like mod or css
Anyway thanks
If you need to define an icon’s color (or an icon itself) dependently on some entity’s state (or any other condition) - you may definitely use custom:button-card.
Short example:
...
icon: ... place you template here ...
styles:
icon:
- color: ... place you template here ...