I am wondering if anyone can see what I may be doing wrong here. I have a card and want the color of the image to changed if the state recently changed.
I can test the below color code in the dev template and I get the expected output of ‘rgb(150, 0, 0)’ but when I put it into the card it just stays white (As if its broken) any help would be appreciated
type: custom:button-card
entity: binary_sensor.universal_electronics_inc_urc4460bc0_x_r_ias_zone
state:
- value: 'off'
color: red
icon: mdi:door-closed
- value: 'on'
color: >-
{% if ((as_timestamp(now()) -
as_timestamp((states.binary_sensor.universal_electronics_inc_urc4460bc0_x_r_ias_zone.last_changed)))
/ 60) | int <= 10 %} 'rgb(150, 0, 0)'{% elif ((as_timestamp(now()) -
as_timestamp((states.binary_sensor.universal_electronics_inc_urc4460bc0_x_r_ias_zone.last_changed)))
/ 60) | int >= 11 %} 'rgb(150, 0, 0)'{% else %} 'red'{%- endif
-%}
icon: mdi:door-closed
show_icon: true
show_name: true
name: Door
show_last_changed: true