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. To keep doing this, I want to ask you to 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!
Ed
You can watch the video tutorial here.
The code used in this video can be downloaded here.
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.
I need your help!
You will be doing me a huge favor if you subscribe to my channel if you haven’t already. And, you will help me a lot if you also give this video a thumbs up and leave a comment. This way, YouTube will present this video to new people, making the channel grow! In the video description, you will also find information about how you can sponsor me so that I can continue to make these tutorials for you.
Thank you!