stefanwichmann / kelvin

Kelvin - The hue bot
MIT License
347 stars 37 forks source link

Feature request, beforeSunrise and afterSunset to support offset param #74

Open LukeDefeo opened 4 years ago

LukeDefeo commented 4 years ago

So I have setup kelvin and so far I am quite happy with how it works except for one thing. It seems that if you want to override the points in the colour temperature/brightness curve throughout the day you have to put absolute times of the day in the config. e.g

  "afterSunset": [
        {
          "time": "20:00",
          "colorTemperature": 2800,
          "brightness": 52
        },
        {
          "time": "22:00",
          "colorTemperature": 2000,
          "brightness": 24
        }

While this works its not relative to the sunset, it's an absolute time, when we roll into winter months and sunset is much earlier i will have to adjust all of these every month or so. What i would think would be a great improvement would be something like this

"afterSunset": [
        {
          "offset": {
               "hours" : 1,
               "minutes" : 30
          },
          "colorTemperature": 2800,
          "brightness": 52
        },
        {
          "offset": {
            "hours" : 3,
            "minutes" : 0
           },
          "colorTemperature": 2000,
          "brightness": 24
        }

Offset can we used instead of time, (time is still kept for backwards compat). All of my adjustments to the curve are relative to the sun position which the app can keep track of via the timezone flag that is passed in.

Couple of other points for discussion:

What do you think?

smahwrbgat commented 3 years ago

Just hopping in to say I've been hoping for something along these lines for years. I'm not sure about the formatting of the offset (it may be that 1:30 suffices vs. having hours and minutes as separate lines, or just having in minutes and using 90), but I'd love to have this kind of feature, as it allows for a lot more flexibility and fine-tuning in setup, especially if negative values are allowed.

adzenith commented 2 years ago

Looks like this has been implemented in a fork: https://github.com/RaphaelMarinier/kelvin/tree/new_schedule2