Closed jncanches closed 6 years ago
I have the same issue after update to the latest version of Home Assistant. No templates seems to work, rgb_color, icon. Thank you in advance!
yeah ,the same problem! 0.66.1 rgb_color
Confirm I am seeing the same as well.
yeah ,the same problem! 0.66.1 rgb_color
This is unrelated to CustomUI.
Starting from HA 0.66 icon color is controlled by a 2-member hs_color
array attribute (hue, saturation) instead of 3-member rgb_color
array attribute (red, green, blue)
templates:
#_stateDisplay: if (state === 'on') return 'Detected'; else return 'None';
icon: if (state === 'on') return 'mdi:fan'; else return 'mdi:fan-off';
hs_color: >
if (state === 'on') {
return [60, 100];
} else {
return [0, 0];
}
brightness_pct: >
if (state === 'on') {
return 49;
} else {
return 76.50;
}
Thank you, this is a sample code that works with Home Assistant > 0.66 version.
Hi,
don' know if it's a custom-ui in 2018-03-30 version or HA in 0.66, but since those updates rgb_color in templates does not work anymore.
for example : templates: icon: if (state === 'on') return 'mdi:fire'; else return 'mdi:snowflake'; rgb_color: if (state === 'on') return [223, 76, 30]; else return [3, 169, 244];
does not apply a red color on mdi:fire icon or a blue one on mdi:snowflake icon.
Sorry in advance if this an HA regression.
Thank you