Philips Hue: Difference between revisions

From air
Jump to navigation Jump to search
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[PhilipsHue01.jpg|200px|right|thumb|Déballage]]
[[Image:PhilipsHue01.jpg|200px|right|thumb|Déballage]]
[[PhilipsHue02.jpg|200px|right|thumb|Déballage]]
[[Image:PhilipsHue02.jpg|200px|right|thumb|Déballage]]
[[PhilipsHue03.jpg|200px|right|thumb|Déballage]]
[[Image:PhilipsHue03.jpg|200px|right|thumb|Déballage]]
[[Image:PhilipsHue04.jpg|200px|right|thumb|Test]]


Set d'ampoules LED RGB zigbee avec un pont zigbee <--> ethernet.
Set d'ampoules LED RGB zigbee avec un pont zigbee <--> ethernet.
Line 14: Line 15:
* http://developers.meethue.com/
* http://developers.meethue.com/


<pre>
http://<bridge ip address>/api/newdeveloper/lights/1/state

{"on":true, "sat":255, "bri":255,"hue":10000}
</pre>


<pre>
http://localhost:1080/system/offices/philipshue/hue1?do=control&ask={'on':%true}&ask={'sat':255}&ask={'bri':255}&ask={'hue':10000}
</pre>


==API==
==API==
Line 21: Line 32:
* https://github.com/peter-murray/node-hue-api
* https://github.com/peter-murray/node-hue-api
===Java===
===Java===

===Python===
* https://github.com/studioimaginaire/phue

<pre>
pip install phue
</pre>

<pre>
def do_PUT_HUE(self,driverParametersList,controlAskDict):
try:
if (controlAskDict["on"]=="true"):
controlAskDict["on"]=True
else:
controlAskDict["on"]=False
message=json.dumps(controlAskDict)


url = "192.168.1.80"
action= "/api/1234567890/lights/2/state"

headers = {"Content-type": "application/x-www-form-urlencoded","Accept": "text/plain"}
connection = HTTPConnection(url)
connection.request("PUT", action, message, headers)
response = connection.getresponse().read().decode('utf-8')
#print("response=%s status=%s"%(response.status, response.reason))
print("Server's response : %s"%response)
connection.close()

</pre>


===OSGi===
===OSGi===
* [http://code.google.com/p/openhab/wiki/HueBinding Hue Binding] of [[OpenHAB]]
* [http://code.google.com/p/openhab/wiki/HueBinding Hue Binding] of [[OpenHAB]]
* [[Zigbee4OSGi]]

Latest revision as of 05:12, 31 January 2014

Déballage
Déballage
Déballage
Test

Set d'ampoules LED RGB zigbee avec un pont zigbee <--> ethernet.

Le pont peut piloter jusqu'à 50 ampoules.

L'API du pont est REST / JSON.

Liens

http://<bridge ip address>/api/newdeveloper/lights/1/state

{"on":true, "sat":255, "bri":255,"hue":10000} 


http://localhost:1080/system/offices/philipshue/hue1?do=control&ask={'on':%true}&ask={'sat':255}&ask={'bri':255}&ask={'hue':10000}

API

CURL

Node.js

Java

Python

pip install phue
    def do_PUT_HUE(self,driverParametersList,controlAskDict):
        try:
            if (controlAskDict["on"]=="true"):
                controlAskDict["on"]=True
            else:
                controlAskDict["on"]=False
            message=json.dumps(controlAskDict)


            url = "192.168.1.80"
            action= "/api/1234567890/lights/2/state"

            
            headers = {"Content-type": "application/x-www-form-urlencoded","Accept": "text/plain"}
            connection = HTTPConnection(url)
            connection.request("PUT", action, message, headers)
            response = connection.getresponse().read().decode('utf-8')
            #print("response=%s status=%s"%(response.status, response.reason))
            print("Server's response : %s"%response)
            connection.close()

OSGi