The range of Philips Hue lights is definitely not cheap (there are a few alternatives, worth it, worth it.) but one thing I really appreciate is the well-documented API about building your own Hue apps. Today I’ll show you how to control the Arduino Hue lights and then add a simple motion sensor.
Why are we doing this? Because home automation systems can be quite rigid and expensive. By learning how to control Hue from an Arduino, you open the door to many custom home automation projects that just can’t be beaten by off-the-shelf components. If collaborative hacking isn’t your thing, try these 8 great Hue apps instead of this.
Shade system
Let’s understand the technique a bit so that you know the main systems you work with. Illumination creates a mesh network using a short-range wireless communication protocol called ZigBee — in particular, they are ZigBee Light Link certified, which means that other ZLL products should also work together with Hue (in theory).
Although technically limited, ZigBee’s mesh networking feature means that each new bulb expands the network by relaying messages to other bulbs. This means that if you are having trouble controlling a light source on the other side of the house, try installing another light source in between.
Zigbee is a great protocol, but it’s very different from Wi-Fi or a wired computer network, so we need a Philips Hue Bridge to bring them together. The Hue bridge runs a modified open source Linux firmware that translates the underlying web server.

It is by interacting with this local web server that you can find out the current state of the indicators and manage them.
This is a beautiful simple system ripe for DIY projects. Kudos to Philips for making this thing so hacky.
Beginning
Before you can access the API documentation, you need to register as a developer. It’s free, but you must accept the terms. Do it now.
Anyone familiar with standard web services or Javascript should be familiar with Hue: all data is sent and received as JSON packets.
To see this in action, you need to know the IP address of your Hue bridge. There are several ways to do this:
- Look at the DHCP address assignment table in your router’s admin interface
- Launch a network mapping program such as IP Scanner Home
- Try the Philips UPnP broker tool
- Ping «philips-hue.home»
When you’re done, type it into your browser’s address bar, adding to URL file debug/clip.html . In my case it was:
http://192.168.1.216/debug/clip.html
It is a debugging tool that allows you to send and receive JSON packets through a simple web interface. The first step is to enable the developer profile on Hue Bridge itself, which is disabled by default for security reasons. Paste the following in the BODY field, leave the url as /api/ and send a POST request by clicking button « Send»:
{"devicetype":"test user","username":"newdeveloper"}
The first time you do this, you will see «reply link not clicked» somewhere in the response. This is a security feature that requires every new app you use to be physically authorized. Go and find your bridge, press the button and send the same request again to within 30 seconds . This time you will get a different response and the user will be logged in. If you want to use a different username, read the API docs on creating users. For now, this will be enough.
Once your user is set up, the base URL you need to interact with becomes /api/newdeveloper/ . You can send a GET request to find out everything your bridge knows about connected lights, alarms, scenes, and a short log of applications that have been used. Here is a sample of the status information that is contained in a single light bulb.