Simple script to turn on a group of hue lights at sunset+x
- Configure config.json (see the example)
- Set the group you want to control
- Set the username hash from the hub
- Set the IP address of the hub
- Set the offset between sunset and when you want the lights on
- Set the loop delay
- Execute
php run.php twilight
- Configure night_config.json (see the example)
- Set the group you want to control
- Set the username hash from the hub
- Set the IP address of the hub
- Set the offset between sunset and when you want the lights on
- Set the loop delay
- Execute
php run.php night
Example cron below
0 16 * * * /usr/bin/php /path/to/project/Twilight/run.php twilight
0 16 * * * /usr/bin/php /path/to/project/Twilight/run.php night
In essence the twilight one runs at 16:00 and waits for the time to pass before turning the group on and exiting. The night one runs at 4 and waits for the cut of time to lapse before turning the lights off and exiting.
Output is sent to twilight.log which is in the root of the project