Hi All,
Im using custom_ui and lot of icons get right color. Now I want add 1 based on temperature.
sensor.dark_sky_temperature:
friendly_name: Current Temperature
templates:
icon_color: >-
if (state < '-23') return 'rgba(255,0,255,1)';
if (state < '-18') return 'rgba(139,0,139,1)';
if (state < '-12') return 'rgba(128,0,128,1)';
if (state < '-7') return 'rgba(0,0,255,1)';
if (state < '-1') return 'rgba(135,206,236,1)';
if (state < '4') return 'rgba(0,128,0,1)';
if (state < '10') return 'rgba(144,238,144,1)';
if (state < '16') return 'rgba(255,2255,0,1)';
if (state < '21') return 'rgba(255,165,0,1)';
if (state < '27') return 'rgba(255,69,0,1)';
if (state < '32') return 'rgba(255,0,0,1)';
if (state < '38') return 'rgba(139,0,0,1)';
Only color is see is green "if (state < ‘4’) return ‘rgba(0,128,0,1)’; "
When I change the temp using development tool there is nothing happen on the color.
16 degrees must give " if (state < ‘-18’) return ‘rgba(139,0,139,1)’; " Pink Purple but still green.
Can someone see the fault in this part?
Try this scheme to add colours to temp: