Do you have the same problem as me ? You have your philips hue lights sync to your pc, and when you shutdown your pc you have to manually switch of your lights ?
Well I had that "problem" to, that is why I created this simple Python script. When configures and added to your shutdown task your lights are turned off.
Meaybe this step can be automated but for now, open settings.yml and enter your username and ip of your bridge. see https://developers.meethue.com on how to obtain those. You also need to specify which light to turn off.
The easiets way too know which light too turn off is to go the following url: http://[ip of bridge]/debug/clip.html. In the url input field enter the following url
/api/[apikey]
And now find the number of your group that you want to turn off.
This script needs the following modules:
- requests
- PyYAML
pip install requests
pip install PyYAML
On Windows, to set up a script to run as soon as you shut down or logoff your computer do the following:
- open your Local Group Policy Editor by running
gpedit.msc
into the start menu or run dialog (Windows+R) - Navigate to User Configuration - Windows Settings - Scripts (Logon/Logoff) - Logoff
- Click
Add
- Add an script and enter the following (for example, use your own paths here)
- Scriptname:
c:\python27\python.exe
- Script parameters:
c:\Users\Thijs\PycharmProjects\hue-lights-off\app.py %*
- Scriptname:
Now logoff or shutdown your pc and your lights will switch off