There's algorithms that can get sun and moon (and really any celestial body's) relative position to some place on earth. They don't need internet connections. They just need historical data, a location, and a time. The latter of the two can be gotten from GPS. Something that can process a few thousand floats per second should be enough processing power.
Ask Lemmy
A Fediverse community for open-ended, thought provoking questions
Rules: (interactive)
1) Be nice and; have fun
Doxxing, trolling, sealioning, racism, and toxicity are not welcomed in AskLemmy. Remember what your mother said: if you can't say something nice, don't say anything at all. In addition, the site-wide Lemmy.world terms of service also apply here. Please familiarize yourself with them
2) All posts must end with a '?'
This is sort of like Jeopardy. Please phrase all post titles in the form of a proper question ending with ?
3) No spam
Please do not flood the community with nonsense. Actual suspected spammers will be banned on site. No astroturfing.
4) NSFW is okay, within reason
Just remember to tag posts with either a content warning or a [NSFW] tag. Overtly sexual posts are not allowed, please direct them to either !asklemmyafterdark@lemmy.world or !asklemmynsfw@lemmynsfw.com.
NSFW comments should be restricted to posts tagged [NSFW].
5) This is not a support community.
It is not a place for 'how do I?', type questions.
If you have any questions regarding the site itself or would like to report a community, please direct them to Lemmy.world Support or email info@lemmy.world. For other questions check our partnered communities list, or use the search function.
6) No US Politics.
Please don't post about current US Politics. If you need to do this, try !politicaldiscussion@lemmy.world or !askusa@discuss.online
Reminder: The terms of service apply here too.
Partnered Communities:
Logo design credit goes to: tubbadu
Honestly it sounds like home assistant could be useful to you, if you have the time to tinker. Definitely can build rules based on sunset times.
In order to calculate an accurate sunrise and sunset time, you need the following variables to be known.
- The current day
- The current time (if you want to know the time delta for when it rises and sets)
- The current location
Also, we need to consider that NTP sends the time in UTC, and the timezone offset calculation is done by the endpoint.
Even if you know the timezone your in, it still doesn't provide the exact position you need to accurately determine when the sun will rise and set.
Sensorwatch has a sunset/sunrise face https://github.com/joeycastillo/second-movement/blob/main/lib/sunriset/sunriset.c
If you dig into it, see if you can fix this issue that I created months ago: https://github.com/issues/created?issue=joeycastillo%7Csecond-movement%7C55
Edit: actually, if you're doing this as a psych experiment, just buy a sensor watch and make a custom face for it. It'd be a great way to publish your findings.
If you start living by your own time you should take a look at decimal time too.
Thanks! This repo's readme leads to gml.noaa.gov/grad/solcalc/calcdetails.html. This then references Astronomical Algorithms by Jean Meeus. That is available from the above linked archive.org page.
This is much closer to the real reason I was asking, as this little clock is intended as a primer for understanding object tracking for both astronomical observations and local rocket launches or transits.