For me, personally, I like to leave it at -6 and 90 (min, max) despite the fact that the sun never gets to 90degrees where I live either. The reason is, at 90 degrees (i.e. directly overhead) the sun will indeed produce the most solar radiation/light/heat than it will in any other location in the sky. So, it is a true maximum.
This way I can look at sunlight percentage as the percentage of sunlight getting through compared to the maximum anywhere on earth. What’s nice about that is then 20% is roughly when you’d want outside lights to come on/off no matter where in the world you live. If you change the maximum, you’re still going to want the lights on at roughly the same brightness/sunlight level as me, but your number will be quite a bit higher than mine.
It also affects how the cloud cover factors in. With the formula above I did extensive testing using a wunderground weather station near me that happened to provide Solar Radiation in W/m^2 and, using a known maximum W/m^2 for 100%, I was able to make a second sensor that fairly accurately tracked the readings from that weather station.
It’s useful either way, of course. And if it makes more sense for you to set the max at 66 degrees, then, by all means you should. I just wanted to make the argument for using a more “universal” number in case you weren’t aware of the potential positive aspects of doing so.
I’ve found that turning outside lights off at > 23 and on at < 20 works great to get the lights on during any time there are thick, dark, clouds, or when the sun is too low to make enough light.
For interior lights, I’ve found every room needs it’s own setting, since the lighting is different in each room depending on how many windows there are and which direction they face. Ultimately, I found that having a lux sensor in each room was an easier way to go for interior lighting, instead of trying to find the best cutoff point for each room. So, I really just use it for exterior lighting these days.
I imagine I could just choose an indoor sensor for a room that gets good outside light and use it to determine outside light, but this formula works so well I haven’t felt the need to change it.
very nice indeed, testing as we speak. with the Open weather map cloud percentage. Will see tonight when the lights go off (hardware light sensor) what setting that is. Used to check against sun elevation, but this might be more adequate.
btw you can leave out the entity_id’s, since they are in the template itself. No complaints are thrown.
I’ve been using it for about two months and it works very well.
I’m in the UK and using DarkSky and I have set the maximum and minimum elevation appropriately:
{%- set min_elevation = -6 %} {# set this to official sun elevation for end of twighlight #}
{%- set max_elevation = 64 %} {# set this to the maximum noon sun elevation (minimum is 15 degrees) #}
For each light that responds to it I have an input_number that sets the threshold brightness before it is considered dark in that room. I did that so that I could play with the numbers but have never needed to change it from almost the first day.
Thanks, i’ll give it a try. I have input_number as well for max. brightness but currently I’m only using sun elevation so slowly get them up to the selected level.
The only portion of this that uses DarkSky is the cloud coverage data. If you can find another weather source for cloud coverage, this can be adapted to use it instead.
I don’t use the openweathermap platform, so I’m not sure what the sensor entities are called. However, I did confirm that cloud coverage on that platform is represented the same as it is in DarkSky: 0 meaning no clouds, 100 means complete cloud coverage.
I have been working on the code of @swiftlyfalling and trying to add Solar Irradiance into the code. By that the sunlight% will depend on:
Solar Irradiance senor
Cloud Coverage senor
Sun Elevation senor
I found (assume) that the max Solar Irradiance we can get is 1.000 W/m2 (see here). That means that the calculation can be really simple; just divide the number by 10 to get the percentage. So; 402 W/m2 is equal to 40.2% Irradiance. Next, I subtract the Irradiance% from the Cloud Coverage% to get an adjusted percentage for the impact of clouds on the sunlight.
I have set the max_elevation at 70 degr, because it is maximum 61degr in my place at the world. Find your max here.
I moved here because i was thinking these are two different topics (also if i can use them in the previous topic). BTW i found the climacell integration has already the solar irradiance, so my problem here is solved, but not the max_elevation…