Porch lighting schedule upgrade
The porch lights are on a fixed schedule of 6AM-8PM on/off. The date now is June 5th. Summer is here and the sun sets later than any other time of the year.
In the cominng December, winter, the sun will set earluer than any other time of the year.
The thought occurred to me that the python script I use to calculate solar elevation and azimuth based on time of day, would also be useful for calculating the surise and sunset times for any given day.
Years ago, I downloaded an excel spreadsheet from a NOAA website. That spreadsheet contains formulas for a number of astronomical variables useful in atronomy and weather forecasting.
I stranslated the formulas from the Excel language into the Python language equivalents and placed them in a python script.
I decided to write, and install, a systemd service that calculates the sunrise and sunset times each day. The service then calls curl to write the new schedule to the Philips HUE bridge.
The end result will be a porch light schedule that reflects the true rise and set times rather than a fixed arbitrary schedule.
Comments
Post a Comment