adaptive-lighting icon indicating copy to clipboard operation
adaptive-lighting copied to clipboard

Sunrise ramp-up speed different from sunset ramp-down speed?

Open osmaa opened this issue 1 year ago • 6 comments

Have you ever considered separating the adjustment speed of sunrise and sunset? This would be beneficial for using adaptive lighting for wake-up lights. For example:

Wakeup might be preferred to start at minimum brightness and color temperature, but ramp up both brightness and coldness of the light within, say, just 15 minutes synchronized to an alarm.

Wind-down on the other hand might start an hour before sunset and continue an hour after sunset to minimum brightness and warm lighting.

The tanh and linear modes could achieve this, were the morning/evening time parameters separately adjustable. OTOH, it seems that the current brightness_mode_time_dark and brightness_mode_time_light parameters are somewhat redundant given the ramp time window can also be shifted using the sunrise and sunset offsets.

osmaa avatar Oct 18 '23 12:10 osmaa

+1 on this. been struggling with a half-baked wake-up/wind-down automation for months. quite an iron-triangle situation. I want to have my cake and eat it too!

It would be nice to have something like the following options:

  • brightness_ramp_time_sunrise
    • Duration in seconds to transition from min_brightness to max_brightness before sunrise
  • brightness_ramp_time_sunset
    • Duration in seconds to transition from max_brightness to min_brightness after sunset

then as OP suggested, combine with existing options sunrise_offset and sunset_offset to shift the ramp period around the sunrise_time and sunset_time.

also, for the sake of completeness, maybe brightness_mode could also be split between sunrise and sunset in case you wanted to have a linear ramp in the morning and a tanh ramp at sunset.

jtcressy avatar Jan 12 '24 00:01 jtcressy

I was about to make the same request and glad I found yours. We 100% need a way to control the sunrise and sunset individually for reasons mentioned above.

ncd7 avatar Jan 21 '24 18:01 ncd7

+1 I'm also looking for a way to make the light temperature change at different speeds. For example, Apple Homekit adaptive lighting uses different times and speeds to adjust the light temperature depending on the position of the sun and/or time. I plotted the Apple Homekit adaptive lighting operation and compared it with these AL. AL uses sunrise and sunset exclusively, but I would also like adjustments for dawn and dusk. Are there any ways to configure AL the same way? image_2024-04-08_10-29-50

danishru avatar Apr 08 '24 12:04 danishru

@danishru, could you in some way extract the numerical values for the Apple HomeKit curve? We could implement something similar for AL.

basnijholt avatar Apr 08 '24 14:04 basnijholt

@danishru, could you in some way extract the numerical values for the Apple HomeKit curve? We could implement something similar for AL.

Yes, here is the history.csv this curve to csv file from Home Assistant. The time in the csv is for UTC±00:00, but my chart is using UTC+3. At the beginning of the graph and in the data, the value is less than "3000" and "unknown", they can be deleted, since they appeared when the lamp was turned off.

I suspect that Apple HomeKit builds a much more complex temperature curve, and my graph is only a special case. I could not find a description of the algorithm and logic, perhaps the community can help with this. If necessary, I can repeat the values recording of the Apple HomeKit adaptive light.

If we can replicate this in AL, it will be an even better user experience.

danishru avatar Apr 09 '24 06:04 danishru

Actually - I made a suggestion elsewhere but I think what this addon is missing a totally "custom" mode where you can set an arbitrary set of time/brightness/color tuples of points and let the addon interpolate between them. So you have the "auto" modes with linear/tanh/etc and the 'custom' where you do whatever the heck you want :). This way we keep the number of these custom requests to a minimum. I think my suggestion will solve all of those rather than introducing more and more complexity to the "auto" modes.

ncd7 avatar Apr 09 '24 13:04 ncd7