Notifications
Clear all

[Solved / Archived] Witty Pi: Incorporating sunrise/sunset into scheduling?

3 Posts
2 Users
0 Likes
297 Views
(@spknmmike)
Posts: 0
New Member
Topic starter
 

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?

 
Posted : 07/06/2023 7:36 pm
(@admin)
Posts: 331
Member Admin
 

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.

 

 

 
Posted : 08/06/2023 10:41 am
(@spknmmike)
Posts: 0
New Member
Topic starter
 

Thanks for the ideas: I think I've got something working by swapping out the schedule.wpi every week or two.

 
Posted : 13/06/2023 8:10 pm
Join Waitlist We will inform you when the product arrives in stock. Please leave your valid email address below.