GithubHelp home page GithubHelp logo

Comments (3)

claytonjn avatar claytonjn commented on June 9, 2024

Hmm, this is an interesting problem. I have no idea how to calculate values if the sun never sets on a particular day; I would need to know what the lowest position the sun reaches is and at what time it is at that position, however I don't see any Python libraries that would provide that information. I suppose I could just have CL set values to max_colortemp and max_brightness the entire day if no sunset time is available.

Any thoughts/suggestions?

from hass-circadian_lighting.

steino avatar steino commented on June 9, 2024

According to https://astral.readthedocs.io/en/latest/ it can calculate solar noon and solar midnight. Could this be used for this calculation?

from hass-circadian_lighting.

claytonjn avatar claytonjn commented on June 9, 2024

I'm already using both of those - there's essentially four data points and four parabolas calculated (solar noon and solar midnight might not be half way between sunrise and sunset):
68747470733a2f2f636f6d6d756e6974792d686f6d652d617373697374616e742d6173736574732e73332e6475616c737461636b2e75732d776573742d322e616d617a6f6e6177732e636f6d2f6f726967696e616c2f33582f362f352f36353766663938626562

I suppose what I could do if the sun never rises or never sets a particular day is use solar noon and solar midnight as the amplitudes of a sinusoidal graph. In the case of the sun never rising, the graph would be shifted down by the difference between the highest it ever gets and the horizon (would cause lights to dim from max_bightness minus that difference to min_brightness back to max_brightness minus difference). In the case of the sun never setting, the graph would be shifted up by the difference between the lowest if ever gets and the horizon (would cause lights to change from min_colortemp plus that difference to max_colortemp back to min_colortemp + difference).

from hass-circadian_lighting.

Related Issues (20)

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.