Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: Let user define sunrise/sunset offset #44

Open
cawith opened this issue Sep 16, 2018 · 8 comments
Open

Request: Let user define sunrise/sunset offset #44

cawith opened this issue Sep 16, 2018 · 8 comments

Comments

@cawith
Copy link

cawith commented Sep 16, 2018

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!

@bryanmahler
Copy link

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

@stefanwichmann
Copy link
Owner

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...

@panosnl
Copy link

panosnl commented Dec 7, 2018

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
Copy link

panosnl commented Dec 14, 2018

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))

@Ben-84
Copy link

Ben-84 commented Dec 30, 2018

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.

@stefanwichmann
Copy link
Owner

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!

@Ben-84
Copy link

Ben-84 commented Jun 20, 2019

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.

@ryanfelder
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants