I think I did, for the past week the max elevation been 49.2, not sure if this would be all year (probably not), but hope to come up with the ideal solution before then, I just need something working for the next week while I’m away.
Do you know about a way to get this information? I have current elevation and I have the time for astronomical noon (which is when the sun will be at max elevation at the current day, however, how to know which elevation will be at noon?
Here at sweden the max elevation changes quite a lot over the year and I’d like to find it programmatically for one of my automations.
For colour temperature in Kelvin, you can try this (untested), adjust 2200 and 4000 to the supported range of your bulbs:
{{ [ [ (1000000/(4791.67 - 3290.66/(1 + 0.222 * [ [ 0, state_attr(‘sun.sun’, ‘elevation’) ] | max, 90 ] | min**0.81)))|int, 2200] | max, 4000] | min }}
This is still in Mireds. Probably you meant {{ [ [ ((4791.67 - 3290.66/(1 + 0.222 * [ [ 0, state_attr('sun.sun', 'elevation') ] | max, 90 ] | min**0.81)))|int, 2200] | max, 4000] | min }}