Philips Hue

From air
Jump to navigation Jump to search
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