User Tools

Site Tools


This is an old revision of the document!

Philips Hue Bridge Protocol

This implementation adds support for the Philips Hue protocol using the Philips Hue Bridge Rest API to control Philips Hue bulbs. The protocol polls the status from the Bridge every minute to update the device values in pilight.


The Hue Bridge is connected to the same LAN as the machine running the pilight daemon.
Using the Hue Bridge allows smooth integration of pilight into the overall environment. The concept of the Hue Bridge is found here: The bridge itself is using the zigbee protocol to communicate with the Hue bulbs. This interface is currently not supported.


To use all available settings for the bulbs you do need to use the CLI interface for the protocol philipshue and pilight-send or pilight-control.
The pilight WEBGUI, supports a subset of the capabilities of Hue bulbs.

Supported Brands

All Hue Bulbs connected to the Hue Bridge.

Sender Arguments

-i –bridgeip=ipaddressPhilips Hue Bridge IP Address
-l –lightid=lightidlightid (1,2,3,..)
-u –username=usernameusername for bridge api
-o –on=true, falseset light state on to true or false
-b –bri=0..254brightness of a light from 0 to 254, this value is changed by dimlevel
-h –hue=0..65535hue color value red=0, yellow=12750, green=25500, blue=46920, purple=56100, red=65280
-s –sat=0..255saturation from 0 to 255
-e –effect=none, colorloopcollorloop: endless color looping mode until it is stopped by sending none
-x –x=0..0.9999x value in xy color points
-y –y=0..0.9999y value in xy color points
-c –ct=153..500color temperature (warmest color is 500)
-a –alert=none, selectselect makes the light do a blink in its current color
-g –group=0, 1, ..running on group of lights. The group must have been created before (group 0 always includes all lights)
-z –scene=scene-idapply a predefined scene id (use option –resource=scenes to list all scenes on hue bridge)
-r –resource=namenames are: lights, groups, config, schedules, scenes, sensors, rules
-t –onturn light or group on
-f –offturn light or group off
-n –newusercreate and authorize user on Hue Bridge

To create a new user on the Hue Bridge, proof of physical access to the Hue bridge is required.


1. Create a user on the Hue Bridge:

First a username must be created and authorized on the bridge. To do so, you do need to press the button on the Hue Bridge AND execute the following pilight command at the same time:

$ pilight-send -p philipshue --bridgeip= --newuser

pilight will respond either with an error message:

pilight-send: NOTICE: Create and authorize new user for pilight on Hue Bridge ...
pilight-send: NOTICE: philipshue - post data = {"devicetype":"pilight"} to url
pilight-send: NOTICE: response from hue bridge = [{"error":{"type":101,"address":"","description":"link button not pressed"}}]
pilight-send: NOTICE: description = link button not pressed
pilight-send: NOTICE: ----> Press Link button and run again pilight-send -p philipshue --ip= --newuser

or report the username generated:

$ pilight-send -p philipshue -i --newuser
pilight-send: NOTICE: Create and authorize new user for pilight on Hue Bridge ...
pilight-send: NOTICE: philipshue - post data = {"devicetype":"pilight"} to url
pilight-send: NOTICE: response from hue bridge = [{"success":{"username":"29b7e422ee6f973bc97b3e1f3269a3"}}]
pilight-send: NOTICE: ----> Successfully created and authorized username = 29b7e422ee6f973bc97b3e1f3269a3 <--- Use this username

You do need to copy the username to your config.json file. “devices”: {

  "Hue1": {
      "protocol": [ "philipshue" ],
      "id": [{
          "bridgeip": "",
          "username": "29b7e422ee6f973bc97b3e1f3269a3",
          "lightid": 1
      "on": "false",
      "bri": 254,
      "hue": 8625,
      "sat": 252,
      "effect": "none",
      "x": 0.5837,
      "y": 0.3879,
      "ct": 500,
      "alert": "select",
      "dimlevel": 15,
      "group": 0,
      "scene": "0",
      "state": "off"
  "rules": {},
  "gui": {
      "Hue1": {
          "name": "Study",
          "group": [ "Lights" ],
          "media": [ "all" ]
  "settings": { .... },
  "hardware": { .... },
  "registry": { .... }

} </code>

The pilight GUI interface supports turning lights ON/OFF and dimming of the device in 15 steps. For all other command sequences, currently the CLI interface (pilight-send, pilight-control) has to be used.

Configuration Steps

Each Hue Bridge has its own username. For each lampid, you do need to configure a device and assign it to a group. Configure in the GUI section Dimmer devices if GUI support is required.


List all bulbs on the bridge: $ pilight-send -p philipshue –bridgeip= –username=29b7e422ee6f973bc97b3e1f3269a3 –resource=lights

List all scenes on the bridge: $ pilight-send -p philipshue –bridgeip= –username=29b7e422ee6f973bc97b3e1f3269a3 –resource=scenes pilight-send: NOTICE: philipshue - get data pilight-send: NOTICE: 497b50d84-on-0 = {“name”:“Sunset on 0”,“lights”:[“1”,“2”,“3”],“active”:true} pilight-send: NOTICE: ac637e2f0-on-0 = {“name”:“Relax on 0”,“lights”:[“1”,“2”,“3”],“active”:true} …

Apply a scene: $ pilight-send -p philipshue –bridgeip= –username=29b7e422ee6f973bc97b3e1f3269a3 –scene=497b50d84-on-0

Turn all lights on: $ pilight-send -p philipshue –bridgeip= –username=29b7e422ee6f973bc97b3e1f3269a3 –group=0 -t

Turn all lights off: $ pilight-send -p philipshue –bridgeip= –username=29b7e422ee6f973bc97b3e1f3269a3 –group=0 -f

Set full brightness red on light 2: $ pilight-send -p philipshue –bridgeip= –username=29b7e422ee6f973bc97b3e1f3269a3 –lightid=2 –bri=255 –sat=255 –hue=0

Turn light 1 to red. $ pilight-control -d Hue1 -s on -v hue=65280

Turn all lights on $ pilight-control -d Hue1 -s on -v group=0

Turn all lights off $ pilight-control -d Hue1 -s off -v group=0

Apply scene $ pilight-control -d Hue1 -s off -v scene=497b50d84-on-0


When you configure rules, you should limit the number of requests to be below 10 requests per second for an individual device and below 1 per second for a group.

When you configure conflicting parameters, only one parameter is accepted, the priority is: - xy beats ct beats hue beats sat.

All lights act as a single repeater, if you need to extend your physical range, put a lamp inbetween.

Once a light is ON, it stays on, do not sent ON commands repetively, as it slows down the bridge.

Known Limitations

The WEBGUI currently supports: ON, OFF, DIM UP/DOWN in 15 steps. Color, Scenes etc. do need to be controlled via the CLI interface.

Literature More information about the Hue system can be found here:

philipshue.1467897561.txt.gz · Last modified: 2016/07/07 13:19 by wo_rasp