Yet again inspired by the work of Filip I've made a new software project that will fit perfectly on a bubba server (even though this is posted in B2 forum, I can't see a reason why this shouldn't work on a B1 (actually it will probably run on any perl capable computer). I've taken a different route though from Filips work as this is a perl script that will parse formulas based on sunset and/or sunrise and generate cron rules. This means this program only need to be run once every day (preferably some minutes after midnight), the time keeping is left to cron, which means minimal extra load on your bubba.
The project was made with my USB connected NEXA remote in mind, but you could use a Tellstick or run any command that cron will accept. You could for instance trigger a snapshot with your webcam at sunrise or sunset.
The configuration file accept any number of rules, where a rule consist of a condition, a true statement, a false statement and a cron part. This is what a rule will look like:
Code: Select all
sunset < 17:00 ; 17:00 ; sunset ; * * 1-4 root /usr/local/bin/control_nexa send B 1 on
The true/false statement can use simple formulas to get an offset from sunset/sunrise, like 'sunset + 01:30' to get the time one hour and thirty minutes after sunset.
The cron part is a cron rule without the hour and minute fields (the true or false statement will be used to generate minute and hour). NOTE! You need to supply a user name to the cron part (in this case, 'root').
Your can read more about it at my project page.
Enjoy!
/Johan
EDIT: Updated links