2014-01-11, 21:07
(2014-01-11, 03:59)jer78 Wrote: OK, so I did one more try and FINALLY got it working. Here's what I did in case anyone else has a Hue Lights setup and would like to control them with Cinema Experience. Also, thanks opeters for your help! You got me on the right track!
First off, I downloaded the newest version 3.0.7 from github and noticed there was some changes to the home_automation.py file (this may have helped)
Second, I used the following code which seems to work well:
Code:connection = httplib.HTTPConnection('MYHUEBRIDGEIP')
body_content = '{"on":true}'
connection.request('PUT', '/api/MYHUEKEY/groups/7/action', body_content)
result = connection.getresponse()
Of course, the Hue Bridge IP and Key need to be changed to your setup, and in the body content you can use your own custom settings.
Finally, I inserted the following line near the top of the code:
Code:import httplib
Now, everything works like a charm. Thanks again!
If you PM me with your home_automation.py, I'll clean it up for others to use and keep on my home_automation Git hub. https://github.com/Giftie/home_automation.py this way it will be be kept up to date for others and yourself.