Automatic smart light brightness and color based on the sun

Тәжірибелік нұсқаулар және стиль

I use Home Assistant to set my smart light brightness and colour temperature to different values based on the time of day and position of the sun. This (apparently) helps keep your lights in line with your circadian rhythms for better sleep and mental alertness. I use a combination of template sensors, automations and the circadian lighting HACS plugin to achieve this.
Links:
My Smart Light settings (Blog post): www.homeautomationguy.io/home...
Making your smart home guest friendly: • Making your smart home...
Home Assistant Community Store: hacs.xyz/
Circadian Lighting plugin: github.com/claytonjn/hass-cir...

Пікірлер: 78

  • @FrankyB295
    @FrankyB295 Жыл бұрын

    There is an Adaptive Lighting Integration that works very well. Easy to set up.

  • @theattorney6072

    @theattorney6072

    10 ай бұрын

    Just tried the adaptive lighting integration, and the Issue is that the previous setting is loaded first, so at night it is not usable for me, you are first blinded, then the light sets to lower brightness.

  • @DennisSchmitz

    @DennisSchmitz

    3 ай бұрын

    @@theattorney6072 fixed in a recent version. It just keeps adapting, even if the lights are off (not via hardware switch of course).

  • @andymok7945
    @andymok7945 Жыл бұрын

    Great ideas. I have been using HA for a few years now and template is on the learning list for me. Your example for lighting was a really good example and will bump up the ranking to learn about templates higher on the list.

  • @PierreLeroy76620
    @PierreLeroy76620 Жыл бұрын

    Haven't looked the video yet but I was looking for this for a long time ! Thank you !

  • @WPGinfo
    @WPGinfo Жыл бұрын

    marvelous! This is the aspect of my HA-setup I am not quite content with. This video, I'm sure, will help me 'fix' that! So thanks for sharing!

  • @wimderaat2993
    @wimderaat2993 Жыл бұрын

    Very interesting video. I already liked you automatic lighting before this, but this is even better. Winter in the Netherlands can be pretty dark too. I have to change some things around here. Perfect excuse to play with home automation.

  • @suzithewitch
    @suzithewitch Жыл бұрын

    I'm using SmartThings for now, but I'm supposed to get my Home Assistant Yellow in January. I'm saving many of your videos for use for then, but what I love is when I can use the same ideas in SmartThings, now. For example, your light notification of your laundry status really helped me make mine work, and while I can't use HACS, I can use color templates based on the time of day and set them up for my system to use. Thank you!

  • @HomeAutomationGuy

    @HomeAutomationGuy

    Жыл бұрын

    I'm really glad that they're helpful!

  • @bat3332
    @bat3332 Жыл бұрын

    Thank you for the blog.

  • @SergioBlackDolphin
    @SergioBlackDolphin3 ай бұрын

    What a great automation. I added it to my home and it makes everything so much easier. It works even with the porch light and across our home we don’t have to worry about choosing the right combination. Each time. 😊

  • @HomeAutomationGuy

    @HomeAutomationGuy

    3 ай бұрын

    Glad it was helpful!

  • @netblue
    @netblue Жыл бұрын

    As usual a another great video we can inspire from. I am not as skilled with coding so I did this the long way around by creating a "Daytime" toggle helper that flips based on sunset / sunrise . Will definitely look into the circadian integration, though I try to stay away from cluttering the configuration.yaml file as it is terrible to read if long.

  • @HomeAutomationGuy

    @HomeAutomationGuy

    Жыл бұрын

    Thanks for sharing!

  • @EsotericArctos
    @EsotericArctos Жыл бұрын

    The template sensor is a great idea, but Home Assistant can also do a lot of this with Action Condtions in the Automation instead of needing to create additional sensors. I stopped using set times for a lot of my light automations. Instead I started using the sun elevation. Not perfect still, but it eliminated some of the restrictions of time based automations. One of the great things about Home Assistant. There are many different ways to do the same thing. It can be complex, or simple :).

  • @kmaid

    @kmaid

    Жыл бұрын

    I think using a template sensor is better programming practice. It allows you to reuse these values in different automations so there is only one place to tweak. It also separates concerns

  • @cyberdave17
    @cyberdave17 Жыл бұрын

    I like your automation for hall lighting, I do similar with the kitchen and counter lights, as over night or late evening I'm normally just putting the kettle on or need a glass of water so the counter light strips are ideal

  • @HomeAutomationGuy

    @HomeAutomationGuy

    Жыл бұрын

    After a few days you stop noticing it, which means it's a perfect automation 😊

  • @cyberdave17

    @cyberdave17

    Жыл бұрын

    @@HomeAutomationGuy it will be after my fp1 arrives to stop lights turning off when standing still by the oven cooking. Didn't want to extend the cool down to 10 mins and couldn't figure out code to start the cooldown at 1 min, and increase it the longer someone is in the room upto a limit.

  • @TheMoonSeesMe
    @TheMoonSeesMe Жыл бұрын

    That's sweet. The other thing that I have done is to have different lighting based on whether my night time alarm [external doors are opened] is on or off. If it's on then the lighting is really subdued because everyone is [or should be] asleep. And if the night time alarm isn't on then the lighting is a bit brighter because people are probably still up.

  • @HomeAutomationGuy

    @HomeAutomationGuy

    Жыл бұрын

    Clever idea! I love it

  • @phil-jc8hp
    @phil-jc8hp Жыл бұрын

    Any reason you are not using the "Adaptive Lighting" integration? Does exactly what you are trying to do, just a lot more user friendly to setup

  • @Sparky_D

    @Sparky_D

    Жыл бұрын

    Exactly what I was thinking within seconds of starting this video. Adaptive Lighting was a fork of Circadian Lighting, with a HEAP of improvements.

  • @HomeAutomationGuy

    @HomeAutomationGuy

    Жыл бұрын

    Nope - I'd never heard of it until now 😂. Guess I should take a look at it!

  • @BrianRoy86

    @BrianRoy86

    Жыл бұрын

    @@HomeAutomationGuy it’s the updated version of circadian lighting.

  • @AlonsoVPR

    @AlonsoVPR

    Жыл бұрын

    @@HomeAutomationGuy Please! do a video after testing that integration :D

  • @igiannakas

    @igiannakas

    Жыл бұрын

    Same here. Was wondering why the adaptive lighting integration was not used, as it’s much easier to setup and works actually quite a bit better than the above.

  • @Yama_1291
    @Yama_1291 Жыл бұрын

    You could also do this with scenes and a time of day sensor.

  • @man4evil
    @man4evil Жыл бұрын

    For years I used 222 temp everywhere. Boy I was shocked what a difference 300 temp does in the morning on a room with closed curtains. Thanks 😊

  • @chazM6116

    @chazM6116

    Жыл бұрын

    light is measured in Kelvin, Colour temperature generally ranges from 2700-3300K (warm) to 3300-5300 (cool) - and 6500K is daylight.

  • @man4evil

    @man4evil

    Жыл бұрын

    ​@@chazM6116 thats cool, but lightbulbs in HA have different scale

  • @chazM6116

    @chazM6116

    Жыл бұрын

    @@man4evil light is light no matter its source.

  • @man4evil

    @man4evil

    Жыл бұрын

    @@chazM6116 so? you probably can set all lightbulbs to same calvin, will they glow the same color for different vendors? I doubt that. I have 3 sets of different models of Xiaomi e27 lightbulbs in chandeliers and its colors is different. need to replace bunch of inconsistent lights :(

  • @hmonkey1
    @hmonkey1 Жыл бұрын

    I have something similar but I set the scene to all the lights on the sun height. That way it works all year round. Time isn't a reliable way to do it in my finding. I do this by having a template that tracks what scene the lights should follow. This also means I can get the scene to change on all the lights when the template changes not just when the light is turned on.

  • @HomeAutomationGuy

    @HomeAutomationGuy

    Жыл бұрын

    Clever idea! Thanks for sharing!

  • @user-gr5ps6hq2z
    @user-gr5ps6hq2z29 күн бұрын

    Tonight is my first night trying sunset lights to help my sleep.

  • @iAmTheSquidThing
    @iAmTheSquidThing Жыл бұрын

    Apparently people also prefer warmer lighting when the weather is colder, and colder lighting when the weather is warmer. So that might be something interesting to add.

  • @HomeAutomationGuy

    @HomeAutomationGuy

    Жыл бұрын

    I think I prefer that too, but only just realised 🤣 Thanks for the suggestion

  • @deansproductions
    @deansproductions Жыл бұрын

    Surely the times should be based off the sunrise/sunset .. what happens in winter etc?

  • @fearthesmeag
    @fearthesmeag8 ай бұрын

    Alan, awesome video. Im currently using Adaptive Lighting, which looks very similar to circadian lighting. However, can I use an automation (sensor) with the AL integration? Otherwise AL keeps the lights On.

  • @DennisSchmitz

    @DennisSchmitz

    3 ай бұрын

    Works fine here with automations using either light or motion/presence sensors. Just make sure to use the Adaptive Lighting 'apply' service to turn on the lights while applying the right color at the same time. With the regular light or device service lights often forgot to change to the right color.

  • @luisinigo5572
    @luisinigo5572 Жыл бұрын

    Great video! You can also use elevation and azimuth atributes of Sun entity insted of Sun state. I use to used them for open or close blinds, before install a illuminance sensor.. Saludos.

  • @HomeAutomationGuy

    @HomeAutomationGuy

    Жыл бұрын

    Thanks for sharing Luis! I unfortunately am not smart enough to understand how those things really work....

  • @luisinigo5572

    @luisinigo5572

    Жыл бұрын

    @@HomeAutomationGuy Easy peasy! Elevation is how high from horizon is the sun, in degrees. Minor than 0° is below horizon, 90° is over our heads. Azimuth is the horizontal position. 0° is north, 90° is east, etc. :-)

  • @milicsantiago
    @milicsantiago Жыл бұрын

    Great stuff. Are you using docket version?

  • @HomeAutomationGuy

    @HomeAutomationGuy

    Жыл бұрын

    Yes I am

  • @sam5992
    @sam5992 Жыл бұрын

    I always imagined a system that mimicked the brightness and color temperature of the outside suing a suite of photo sensors measuring color temp/brightness/cloudy conditions, with a manual override, of course.

  • @cyberdave17
    @cyberdave17 Жыл бұрын

    Anyone know how to tweak Adaptive Lighting so that it instantly changes to the right colour temperature after switching the bulb on? Mine normally changes around 20s later which can be a bit jarring if you last had the light on in the day, then switch on at night.

  • @HomeAutomationGuy

    @HomeAutomationGuy

    Жыл бұрын

    There's an "initial transition" setting when you press configure that is supposed to take care of that

  • @GagliardiPhotography
    @GagliardiPhotography Жыл бұрын

    Another great video! Just a question: I need multiple IFs in my case, as I need different light conditions during the day. I tried to define a new sensor like this, but I got a syntax error, what is the right syntax? light_color: friendly_name: 'Light Color' value_template: > {% if (now().hour >= 23) or (now().hour red {% elseif (now().hour >= 6) and (now().hour yellow {% elseif (now().hour >= 10) and (now().hour green {% elseif (now().hour >= 15) and (now().hour blue {% else %} orange {% endif %}

  • @eugsmiley

    @eugsmiley

    Жыл бұрын

    Isn't it 'elif' not 'elseif'?

  • @GagliardiPhotography

    @GagliardiPhotography

    Жыл бұрын

    @@eugsmiley Yes, it is! Thanks!

  • @chrismills5470
    @chrismills5470 Жыл бұрын

    If I start using the circadian lighting plug in do i still need the colour temp sensor or am I correct in thinking this would remove the need for it?

  • @HomeAutomationGuy

    @HomeAutomationGuy

    Жыл бұрын

    The circadian plugin should do it. I've recently been using a new integration called Adaptive Lighting, which seems more powerful and supported. I'd suggest checking that out instead!

  • @EvolverDX
    @EvolverDX Жыл бұрын

    Thought you were using Home Assistant as a docker container. How did you integrate HACS in your container?

  • @HomeAutomationGuy

    @HomeAutomationGuy

    Жыл бұрын

    The installation method is pretty similar for HA OS and container.

  • @EvolverDX

    @EvolverDX

    Жыл бұрын

    @@HomeAutomationGuy you are right. I just integrated HACS in my container a few days ago and it works like a charm.

  • @Guygizbon-1
    @Guygizbon-1 Жыл бұрын

    love it very Monty python😆

  • @HomeAutomationGuy

    @HomeAutomationGuy

    Жыл бұрын

    I wish I was that hilarious! 🤣

  • @joeblstrn
    @joeblstrn Жыл бұрын

    can this be done without coding?

  • @HomeAutomationGuy

    @HomeAutomationGuy

    Жыл бұрын

    Try an integration called Adaptive Lighting. It does a lot of this

  • @chazM6116
    @chazM6116 Жыл бұрын

    Not very 'Green' everything is on 24/7 :( Lights on in the day??? Do you have no windows? very rear do I put lights on in the day apart from the cloakroom with no windows

  • @HomeAutomationGuy

    @HomeAutomationGuy

    Жыл бұрын

    I live in the UK. Windows don't really make much difference in the winter.

  • @chazM6116

    @chazM6116

    Жыл бұрын

    @@HomeAutomationGuy lol I live in UK so unless you're in a 300yr old cottage as I lived in some 15yr ago :)

  • @jfkgodk
    @jfkgodk Жыл бұрын

    Is there a way to make this work in Sweden? I mean, the sun is up all night in the summer. We don't want bright light indoors in the middle of the night. In the winter it is the opposite, the sun isn't up much. We need bright light then.

  • @wimderaat2993

    @wimderaat2993

    Жыл бұрын

    Very interesting problem indeed. The sun entity has some State Attributes like elevation angle and if the sun is rising or not. Have you ever looked at that ? Of course this can also be combined with the time and light sensors. I live in the Netherlands and I also want my lighting to change with the seasons. It is not as extreme as is Sweden, but is still pretty dark in winter over here. So I also want very bright light in the morning and the afternoon in winter to mimic the sun.

  • @HomeAutomationGuy

    @HomeAutomationGuy

    Жыл бұрын

    There are a lot of variables to play with including offsets and min/max brightness. But in these cases I'd probably go manual with the template sensors and pick what works best for you, your location and your routine

  • @iAmTheSquidThing

    @iAmTheSquidThing

    Жыл бұрын

    I guess just use the settings for somewhere on the same longitude but nearer the equator. Like Poland or Croatia.

  • @davidc4162
    @davidc4162 Жыл бұрын

    I'm only halfway in buuut this really seems like a reinvention of Adaptive Lighting... with the difference that this is time-based rather than position of the sun.

  • @HomeAutomationGuy

    @HomeAutomationGuy

    Жыл бұрын

    Yep, I think Adaptive Lighting is the newer version of this.

  • @axel9546
    @axel9546 Жыл бұрын

    What about PWM flickering?

  • @HomeAutomationGuy

    @HomeAutomationGuy

    Жыл бұрын

    I'm not sure what that is, but I've not noticed any flickering with my Hue lights

  • @BasNij
    @BasNij Жыл бұрын

    Great video! I linked it in a new section "See also" in Adaptive-Lighting's README.

Келесі