Hi @andrey
Loving Custom UI - just started using it. Thanks for the work.
You hinted on github that it is possible to change an icon color depending on state using rgb_color
. I have a sensor that I would like to start using with Custom UI and I am not sure how to implement the color change - please can you help?
I would like the icon to be red if the door is open, and I intend to use Custom UI template attributes. Here is my current (pre Custom UI code):
- platform: template
sensors:
door_back_status:
friendly_name: 'Back door'
value_template: >-
{% if is_state('binary_sensor.door_back_sensor', 'on') %}
Open
{% else %}
Closed
{% endif %}
icon_template: >-
{% if is_state('binary_sensor.door_back_sensor', 'on') %}
mdi:login
{% else %}
mdi:logout
{% endif %}
I intend to move to:
customize:
binary_sensor.door_back_sensor:
if (attributes.state = 'on') return 'Open'; else return 'Closed';
but I don’t really know where to start on the icon and it’s color. Any hints?