2014-01-09, 13:32
giftie,
first off, thanks for the awesome add-on! It gets lots of wow factor with the friends.
I wonder if you could help me with the home automation script. I have some hue lights that I'd like to dim when the trailers start. I enabled the home automation and have been playing for hours with the python code but I can't seem to make it work. It comes down to this...
I can use terminal and correctly dim my lights using this curl command (note: in place of key is my actual one) on my mac:
curl -X PUT -H "Content-Type: text/plain" -d '{"on":true}' http://192.168.1.34/api/key/groups/7/action
since your script is python, I've tried all sorts of things to do the same thing, like the following...
>>> import requests
>>> payload = {"on":false}
>>> r = requests.put("192.168.1.34/api/key/groups/7/action", data=payload)
but I can't get anything to work. Any ideas what I'm doing wrong?
first off, thanks for the awesome add-on! It gets lots of wow factor with the friends.
I wonder if you could help me with the home automation script. I have some hue lights that I'd like to dim when the trailers start. I enabled the home automation and have been playing for hours with the python code but I can't seem to make it work. It comes down to this...
I can use terminal and correctly dim my lights using this curl command (note: in place of key is my actual one) on my mac:
curl -X PUT -H "Content-Type: text/plain" -d '{"on":true}' http://192.168.1.34/api/key/groups/7/action
since your script is python, I've tried all sorts of things to do the same thing, like the following...
>>> import requests
>>> payload = {"on":false}
>>> r = requests.put("192.168.1.34/api/key/groups/7/action", data=payload)
but I can't get anything to work. Any ideas what I'm doing wrong?