I am trying to get the icon to spin if the fan_mode is ‘on_low’ and the icon to turn blue if the hvac_action is ‘cooling’
- type: 'custom:button-card'
entity: climate.bedrooms
template: climate_button
state:
- value: "cool"
icon: mdi:fan
spin: >
[[[
if (states['climate.bedrooms'].attributes.fan_mode === 'On Low') return 'true';
else return 'false';
]]]
color: >
[[[
if (states['climate.bedrooms'].attributes.hvac_action === 'cooling') return 'blue';
else return 'gray';
]]]
- value: "off"
icon: mdi:fan
color: white
label: |
[[[
return states["climate.bedrooms"].attributes.current_temperature + '°F'
]]]
What is incorrect?