Skip to content

Setting up the scheduler

root edited this page Sep 13, 2019 · 1 revision

Navigate to the Lighting Scheduler page of the web app. (It's at the bottom)

Setup your schedule using the GUI. Setup the Scheduler to run as a Cron job as outlined below.

Login to your system. At the command line enter the following: sudo crontab -e - this will open the crontab editor.

Once in the crontab, add the following line:

* * * * * lynx -dump https://lighting.local/runSchedule.php

This will execute the runSchedule script every minute. Note, the smallest amount of time you can specify in a cron job is a minute.

If the cron job is not running on your raspberry pi, try the following:

vi /etc/rsyslog.conf

then un-comment the following line:

# cron.* /var/log/cron.log

save and quit - then restart rsyslog by:

/etc/init.d/rsyslog restart

config.inc.php Variables

define("SAVE_SCHEDULE", 1);

Enabling this will save your schedule to a file called sched.sched

date_default_timezone_set("America/Regina");

Lookup up your timezone at http://php.net/manual/en/timezones.php this will let you create your schedules based on your local time

define("LATITUDE", 50.445211);
define("LONGITUDE", -104.618894);

To use the sunrise and sunset functions look up your own location at http://latlong.net

You are now ready to move on to IFTTT Integration