kelvin icon indicating copy to clipboard operation
kelvin copied to clipboard

Request: Let user define sunrise/sunset offset

Open cawith opened this issue 6 years ago • 8 comments

I really enjoy using Kelvin, but at sunset time it is already quite dark and the 4000K at 100%, that I've defined as daytime setting, is too hard on the eyes. Would it be possible to let the user define a sunset and sunrise offset, so that the adjustments would begin earlier and the lights thereby would have reached a more comfortable setting at the real sunset..?

Thanks in advance!

cawith avatar Sep 16 '18 18:09 cawith

This would be a great addition to Kelvin. I experience the same issue after sunrise and before sunset. Thanks!

bryanmahler avatar Sep 19 '18 16:09 bryanmahler

Hey everybody, I'm still trying to wrap my head around the issue. I also think that a manual adjustment to the sunrise and sunset times should not be configurable because they are changing throughout the year (longer offset in the summer, shorter offset in the winter). I still stand by the reasoning in #27.

Nevertheless there seems to be a generic issue here so I'm trying to understand whats going on.

Is Kelvin to slow to adapt or to quick? Is the problem more noticeable at sunrise or sunset? Both?

I am thinking about using a different phase of the twilight (https://www.timeanddate.com/astronomy/different-types-twilight.html) for Kelvins calculations...

stefanwichmann avatar Nov 05 '18 16:11 stefanwichmann

I experience the same issue. At sunset the color starts changing to my nighttime color. 1hour after sunset is it still very bright and cold temperature. Transition around sunset is indeed to slow and cannot be controlled.

I like to be able to define a color at sunset and also to be able to define a time relative to sunset. That way I will be able to schedule a transition period around sunset. This or another twilight functionality as mentioned would be a great addition.

Eg. Day=4000 sunset-0:30: 3000 sunset:2900 sunset+0:30: 2800 23:00:2000

panosnl avatar Dec 07 '18 15:12 panosnl

After giving some more thought having a proper twilight implementation as mentioned by Stefan would be ideal.

In the mean time I have made a provional 'twilight' hack by shortning the Daytime by 60min by delaying sunrize 15min and and bringing forward sunset by 45min. Additionally I added 2 extra interval point 60min before the modified sunrize and 60min after the new sunset at 2800K.

So far it does the job. I am using Kelvin now as my default scene on all my lamps.

Line 242:

	schedule.sunrise = TimeStamp{CalculateSunrise(date, configuration.Location.Latitude, configuration.Location.Longitude), lightSchedule.DefaultColorTemperature, lightSchedule.DefaultBrightness}
	schedule.sunset = TimeStamp{CalculateSunset(date, configuration.Location.Latitude, configuration.Location.Longitude), lightSchedule.DefaultColorTemperature, lightSchedule.DefaultBrightness}

	//PB Add twilight function
	schedule.sunrise.Time=schedule.sunrise.Time.Add(time.Minute * 15)	
	schedule.sunset.Time=schedule.sunset.Time.Add(time.Minute * (-45))	

and Line 264

	//PB Add twilight
	schedule.beforeSunrise = append(schedule.beforeSunrise, TimeStamp{schedule.sunrise.Time.Add(time.Minute * (-60)),2800,80})
	schedule.afterSunset = append(schedule.afterSunset, TimeStamp{schedule.sunset.Time.Add(time.Minute * 60),2800,80})
	log.Debugf("PB: Added Twilight.Schedules before:%v and after:%v",len(schedule.beforeSunrise),len(schedule.afterSunset))

panosnl avatar Dec 14 '18 18:12 panosnl

Stefan, I have the same issue and will try to explain the issue fully.

Ideally, I would have my Hue lights roughly match the outside, with a very high K setting during the day, decreasing toward sunset and with a low K after sunset.

My daytime light setting is accordingly a very high K. This is ideal during the day, but by the time sunset arrives, the lights are far too white. This is why people are asking for an offset - they want their lights to decrease in K as sunset approaches, rather than starting to transition once sunset arrives.

Ben-84 avatar Dec 30 '18 15:12 Ben-84

With Kelvin 1.2.0 the sunrise/sunset times are shifted to another sun angle and should improve the described situation. Let me know if that works!

stefanwichmann avatar Mar 25 '19 14:03 stefanwichmann

Stefan,

In #27, you included a couple of images of light profiles for "natural" light, which is what I (and I think others) are looking for:

I don't think this is possible with Kelvin currently. Because the "after sunset" times are configured with specific times, a ramp time that looks like the first image would need a beforeSunrise and afterSunset times of, perhaps, 04:55 and 22:45. That works fine in the summer, but in the winter that profile would look like this:

So the sunrise/sunset shift to the golden angle helps, but doesn't address the use case of trying to get the lights to ramp to a warmer color over a consistent timeframe. I think that's why others have been asking for offsets to sunrise and sunset - they're trying to accomplish what you show in the above color temp profiles.

Ben-84 avatar Jun 20 '19 15:06 Ben-84

I would like to adjust the behaviour related to sunrise and sunset as well.

My goal is to have my lights warm in the morning but gradually turn to cool during the day, then warm again at night. I would like this process occur after the actual sunrise... my setup would ideally run from sunrise to about 10:00 am.

ryanfelder avatar Jan 16 '21 20:01 ryanfelder