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.
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.
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.
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:
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»:
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.