Git Product home page Git Product logo

Comments (1)

stefanvictora avatar stefanvictora commented on July 19, 2024

Hi, thank you for opening the issue and sorry for not getting back to you sooner. Working with changing solar times between winter and summer is indeed a challenge and a source of frustration, even in my own setup.

You are right: Hue Scheduler will automatically switch the order of states depending on the time of year. It dynamically calculates the next start (and end) time of such expressions after each execution, continuously shifting the states as needed. However, I agree that this can cause quite a lot of confusion and unintended schedules throughout the year, especially if you manually adjust solar times or combine them with local times.

I do like the idea of performing such validation on startup. However, I'm a bit concerned that it might limit the flexibility of the configuration file. Currently, Hue Scheduler does not use the defined order for anything, as the states are dynamically sorted after each execution once they are read from the file. Nevertheless, I see how they could be useful for sanity checks to avoid potential misconfigurations.


Another idea I had for tackling the different seasons was to allow the definition of date ranges in which the defined states should be scheduled. Since a validation alone would not solve the issue of wanting different schedules in winter versus summer. It could look something like this, which is a more advanced version of restricting states to certain days of week:

# Common states:
Light  sunrise
Light  12:00

# Date range specific states:
date-range: 01.01.-01.04.
  Light    sunset
  Light    civil_dusk

...

date-range: 01.06.-31.10.
  Light    21:00
  Light    22:00

Another variant I had in mind involves time brackets, which define the minimum and/or maximum value for a dynamic solar time:

# Sunrise, but not earlier than 06:00
Light  [06:00,sunrise]

# Sunrise, but not earlier or later than 06:00 and 08:00
Light  [06:00,sunrise,08:00]

# Sunset, but not later as 21:00
Light  [sunset,21:00]

Such brackets could also be created implicitly, based on the defined order:

# Implicit
Light    06:00
Light    sunrise
Light    08:00

Even though this could mean that some states would be skipped, for example, if sunrise occurs before 06:00 or after 08:00.

I'm not sure yet, what the best approach would be or if any of the advanced configuration are usable 🤔 I appreciate any feedback and thoughts on this topic. The dynamic nature of solar times is also one of the primary reasons why I would like to create a GUI to easily adjust my schedules and see their current execution times.

from hue-scheduler.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.