This script will switch your lifx lights on when you get home and it is dark outside. It makes use of the lifx public api. I run it on my raspberry pi but any computer that is permanently switched on and is located at your home should work. (you might want to change the install location though)
- python3, virtualenvwrapper and pip.
-
copy settings.py.template to settings.py and fill in the data. You can get your location from google maps and your lifx api token from lifx.
-
mkvirtualenv lifx --python=/usr/bin/python3
-
pip install -r requirements.txt
-
put the
lifx.service
file in/etc/systemd/system
and enable it withsystemctl enable lifx.service
You should be able to confirm that it has started after runningjournalctl /home/pi/lifx/start.sh