Skip to content

Commit

Permalink
sunwait: initial commit
Browse files Browse the repository at this point in the history
Sunwait calculates sunrise or sunset times with civil, nautical, astronomical and custom twilights.

It is intended for use in home automation with Windows Task Scheduler or cron. Use it to turn lights on before it gets dark! The program can wait from invocation until the event specified on the command line occurs or it can return immediately indicating if it is day or night. It's best to schedule Sunwait to run a little before the earliest opportunity for the event to occur each year - ie dusk range is 3:30pm to 10:30pm here, so it reasonable to schedule a dusk task at 3pm and allow Sunwait to pause the task for between 30mins and 7 and a half hours. If you scheduled the task for 6pm, then your lights will come on no earlier than 6pm.

The sun's position is calculated using time, and position - latitude and longitude should be specified on the command line.

Features:

Calculates sunrise and sunset for given coordinates
Can wait for sunrise/sunset, or return DAY or NIGHT codes
Works with Windows Task Scheduler (or cron)
Supports custom twilight angles
Used to automate domestic lighting with Arduino transmitter and radio controlled sockets

Signed-off-by: Stan Grishin <[email protected]>
  • Loading branch information
stangri committed Nov 30, 2024
1 parent 86e0e83 commit 9f50762
Show file tree
Hide file tree
Showing 2 changed files with 723 additions and 0 deletions.
Loading

0 comments on commit 9f50762

Please sign in to comment.