@csacre wrote:
Hi,
I try to have templates on color & icon for a binary sensor (trend one).
Based on several posts (eg: Need help with sensor icon color based on state) , I added the following in my customize.yaml and made many variation of it.
I confirm that the state is indeed “on” or “off” from dev tools.But it does not work.
Any idea or suggestion for further investigation ?
binary_sensor.hall_temp_rising: templates: icon: " if (state === 'on') return 'mdi:thermometer-chevron-up'; if (state === 'off') return 'mdi:thermometer-chevron-down'; return 'mdi:thermometer';" icon_color: "if (state === 'on') return 'rgb(255,0,55)'; return 'rgb(0,191,255)';"
Posts: 1
Participants: 1