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.

This project is a fork from the work by Dan Risacher. The code also runs on Linux: download all files and run 'make'

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)
  • Easy to port code to Linux - comments in place and a makefile is provided
  • Supports custom twilight angles
  • Used to automate domestic lighting with Arduino transmitter and radio controlled sockets

Project Samples

Project Activity

See All Activity >

License

GNU General Public License version 3.0 (GPLv3)

Follow Sunwait

Sunwait Web Site

You Might Also Like
Top-Rated Free CRM Software Icon
Top-Rated Free CRM Software

216,000+ customers in over 135 countries grow their businesses with HubSpot

HubSpot is an AI-powered customer platform with all the software, integrations, and resources you need to connect your marketing, sales, and customer service. HubSpot's connected platform enables you to grow your business faster by focusing on what matters most: your customers.
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Sunwait!

Additional Project Details

Operating Systems

Linux, BSD, Windows

Intended Audience

Advanced End Users

User Interface

Command-line

Programming Language

C++

Related Categories

C++ Cron and Job Scheduler Software

Registered

2012-11-27