In the last line your are issuing a command to set âbrightness_pctâ but you are filling it with a âbrightnessâ value. The two only have a small area of overlap
RGB color is a list of 3 integers, however you are converting the whole list to an integer, this canât work. With the new templatinh engine youâre out of luck,because itâll convert a list that separated with commas and containing only integers to a string regardless.
Also take a lool at the adaptive lighting custom component (which is based on the circadian lighting custom component, but has way more feature ans is better integrated). I assume that this component will already solve your issue.
Ok, but the error appears also if i use color_temp in place of rgb_color and color_temp has only one integer. I tried also adaptive lighting component but it is more difficult for me to use that as i see so poor documentation about it and the helps i received about it did not solved my troublesâŚ
I think the script you posted in the OP and the error you posted there arenât related.
the error says âexpected int for dictionary value @ data[âcolor_tempâ]â but the script doesnât contain any date entry that is called âcolor_temp:â.
I think this happens in the background, it tries to convert the rgb vlaue to color temp and then sends the color temp to the light, but not sure on this one.
Aside from what burningstone said above about trying to force a list into an integer try adding âlegacy_templates: falseâ into your âhomeassistant:â section in your configuration.yaml.
That should make you start using the new template engine and once you remove that âintâ it might keep it as a list and allow it to work.
as far as using color_temp: in the script itâs hard to tell why that would fail since we havenât seen that script syntax or the data it relies on.
No, I donât think so. Thatâs been reported multiple times now, that the new template engine converts list with only ints, separated by a comma to a string, no matter what you do.