Did you know that you can adapt the brightness and color temperature of your lights using Home Assistant based on the position of the sun using adaptive lighting? This helps in maintaining your biological clock and might lead to improved sleep, mood, and general well-being. For instance, you can set the brightness to a maximum at sunrise and let’s say 50% at sunset. But you can also start increasing the brightness and color temperature gradually at sunrise so that it follows the position of the sun. The same counts for sunset. Let me show you how to do this in this Home Assistant Tutorial.
The description below is a summary of what you have to do to install this. The video shows all steps in detail.
⭐⭐⭐ NOTE: ⭐⭐⭐
This article accompanies a YouTube video. I wrote it for people who would rather read than watch a video. In order to keep doing this, I would like to ask you to also check out the video, leave a comment under the video, give the video a thumbs up, and subscribe to my YouTube channel. This means that the video is offered more often to new visitors so that they also stay informed of the latest Home Assistant tutorials.
Thank you for your support!
There are multiple ways to adapt the brightness and color temperature of your lights based on the position of the sun. In this video I am explaining two use cases:
Use Case 1:
Set the color temperature and brightness of lights manually when motion is detected using one automation.
- When the sun is above the horizon:
- Set brightness to 100%
- Set color temperature to 4000K
- When the sun is below the horizon:
- Set brightness to 50%
- Set color temperature to 2400K
For Use Case 1 we are going to use an automation that we will create manually in Home Assistant. You can find the code for this automation on my GitHub page.
Use Case 2:
Set the color temperature and brightness of lights automatically based on the position of the sun
- At sunrise:
- Start increasing the brightness gradually
- Start increasing the color temperature gradually
- When the sun is setting:
- Start decreasing the brightness gradually
- Start decreasing the color temperature gradually
- Step 1: For Use Case 2 we are using a HACS integration. If you do not have HACS installed, I created a video for this and you can find the installation video for HACS here.
- Step 2: After you’ve installed HACS, you have to add the following repository to HACS: https://github.com/basnijholt/adaptive-lighting
- Step 3: Install the Adaptive Lighting integration in HACS
- Step 4: Reboot Home Assistant
- Step 5: Install the Adaptive Lighting integration in Home Assistant
- Step 6: For each light or light group, add an Adaptive Lighting instance in Home Assistant
- Step 7: Set all settings for each instance to your specific needs.