This is a repository in which I store information on controlling my Phillips Hue lights
-
Connect Hue to router
-
Press link button to connect it to your Hue lights
-
Get IP address for Hue Bridge, easy way: www.meethue.com/api/nupnp
-
Press the link button again and
POST
onhttp://<bridge_ip>/api
with body:{ "devicetype":"your_device_type" }
This will respond with an authorized username:
[ { "success": { "username": "some_username" } } ]
-
GET
on/api/<username>
will respond with all information on the linked Bridge. -
GET
on/api/<username>/lights
will respond with only the information on the connected lights. -
GET
on/api/<username>/ligths/<index>
will respond with only the information on the ligth with the relevant index. -
Updating the state of a light can be done by
PUT
ing on/api/<username>/lights/<index>/state
, e.g. to turn a light off justPUT
with the body{ "on":false }
The schema of state is as follows:
{ "state": { "on": "boolean", "bri": "int: 0 .. 254", "hue": "int 0 .. 65535", "sat": "int 0 .. 254", "effect": "string", "xy": [ "double", "double" ], "ct": "int", "alert": "string", "colormode": "string", "reachable": "boolean" } }
More on the Hue API can be found here