It gives you cool lights during the day that get gradually warmer around sunset and overnight. The changes are so slow you are unlikely to notice them whilst they are happening. This may even help your circadian rhythm and sleep!
This blueprint updates the color temperature of your lights to match the outside color temperature calculated from the elevation of the sun. See the discussion here on how this calculation came about.
To ensure lights stay in sync it updates lights when they turn on, whenever the sun elevation changes and every 5 minutes.
Requirements
A working sun.sun entity, read the docs. This comes auto-configured on most Home Assistant installations so it is probably there unless youβve disabled it.
At least one bulb that reports color_temp amongst its attributes.supported_color_modes
Notes
On the bulbs I tested it on (IKEA Tradfri via ZHA) telling the bulb to change color temperature as it turns on would stop it coming on at full brightness, as such a separate action to restore the brightness is called after setting the color temperature. I have exposed this for editing in-case it interferes with any other of your automations, e.g I make my brightness come on low overnight and 100% in the morning.
You have to select every light you want to target - it is monotonous but you will only have to do it once.
Be careful about including light groups. If you do, when you turn on 1 light in the group, every light in the group will be turned on because the automation has to call light.turn_on at the group to change its color temperature - for light fixtures with multiple bulbs this may be a feature, for multiple lights + lamps in a room it will be a bug.
Max and min color temp: There is probably no harm in taking the slider to the extremes. I assume most bulbs will just change to their maximum/minimum if they get a request to change to a color temp that is out of range. However if you have different lights with different min and max then you might want to set these to the most restrictive lights so that your lights look the same.
You can see which bulbs support color temp by going to developer tools > states > type "color_temp" into filter attributes. This will probably also show you the max and minimum supported color temp.
If you live at extremes of latitude (e.g Iceland) where the sun elevation never gets very high you may find the the bulbs never get βcoolβ if this is annoying let me know and maybe we can find a way to normalise the values.
2022.10 or later
Example graph of how the color temperature varies over the day.
Change log
2022-10-08 Version 1.1, ensure transition time is 0 for single light turn on
2022-11-23 Version 2.0. Uses Kelvin, link to the old mired version 1.1 is preserved
2024-07-16 Removed the pre-2022.9 mired version, can be found on my gist here
2024-07-16 Updated the sliders to make them pretty again and gave a wider range
Help wanted /To Do
Make sure it supports other bulbs - needs your testing
How to add an optional and user-configurable condition? (Now possible with Take control)
It is still changing the color temperature of my lights just fine, but when I go into the automation (not the blueprint) to change the maximum and minimum temperatures the interface is broken. I believe this is because it is using mireds instead of kelvin.
If I use this blueprint on a light, it ignores any transition time from the original on trigger.
In my case I am looking to create a cccw light that slowly turns on on sunset over the range of 15 minutes or so. And also change color temp based on this blue print
With the new updates on 2024.7 you can βtake controlβ of blueprints and edit them. If you do this you wonβt get any updates that I make (none are planned).
If you think those edits may help others then please do come back and share them on this thread and I will consider adding them.