Does anyone have any suggestions/examples of incorporating sunrise/sunset into the Witty Pi schedule?
I'd like to do:
ON M5 OFF M55
But only from sunrise to sunset. Any suggestions on where to start?
Considering the sunrise and sunset time change everyday, you will need to re-generate the script everyday. If you have already generated 365 scripts for the whole year, you can just copy the correct one to schedule.wpi file and then execute "runScript.sh" to let it take effect.
The sunrise time will be the BEGIN time of the script. The END time can be anything after one day, because you will replace the whole script everyday.
In your schedule script you will need to repeat the ON/OFF states until it reach the sunset time.
You may write your own script to automate the process. A good place to run your own script (to generate or copy the correct schedule script) is the beforeScript.sh file, which will be executed before the schedule script running.
Thanks for the ideas: I think I've got something working by swapping out the schedule.wpi every week or two.