Hardware Reference
In-Depth Information
N Although many bulbs class themselves as WiFi, this is rarely the case because they communicate to a hub,
which in turn talks to the network.
Note
Hue
Designed by electronics giant Philips, this is the most prominent lighting-only solution at present. The basic starter
kits provide a control hub and three bulbs, although the unit can support up to 50. This hub connects to both a wired
ethernet port and a power socket. It then uses the ZigBee light link (wireless) protocol to talk directly to the bulbs.
Hue's biggest selling point is the color; or, rather, its range of colors. Each screw bulb supports a dynamic range
of colours, selectable from a color wheel on the app. These colors may be picked from a photo, and programmed
into a scene, so that the three lights are able to reflect the color scheme of your room, maybe by enhancing the colors
present in your mantelpiece photograph, for example.
Configuration is automatic (as you'd expect for a consumer device) and the hub acquires its IP from your DHCP
server, which serves a web page that redirects to the Hue online service where you can register your device and make
a connection between the (online) account and your bridge. Once this has happened you can operate it remotely
through the web site. This works through a polling protocol whereby, every half second, the Hue bridge makes a call
to the Hue server to request any new commands, and update the server of the bridge's IP. You can verify that the Hue
website can see your bridge by browsing to http://www.meethue.com/api/nupnp .
Alternatively, you can control Hue through your phone, with both iOS and Android devices currently supported.
For those of us working with open source, the reliance on an app is an occasional bind, although Phillips have
just launched their API that allows you to talk directly to the hub to control the lights. This is available at
http://developers.meethue.com/coreconcepts.html . After getting the IP of your bridge, you must set up a user by
pressing the “link” button on top of the bridge and then, within 30 seconds, issue the command:
$ curl -H "Content-Type: application/json" -X POST -d '{"devicetype":"myhome"}'
http://192.168.0.27/api/
that returns a JSON object with a username, such as d7ae8b2151d50df1e61f380289f33bf, which should be used in all
future requests.
You can then ask the bridge to search for lights on the system with:
$ curl http://192.168.0.27/api/d7ae8b2151d50df1e61f380289f33bf/lights
It will take a few moments for the scan to happen, before you can re-issue the command to get those available,
returned in the form:
{"1":{"name": "Hue Lamp 1"}}
From here the fun begins as you can query the state:
$ curl http://192.168.0.27/api/d7ae8b2151d50df1e61f380289f33bf/lights/1
{
"state": {
"on": true,
"bri": 254,
"hue": 14922,
 
Search WWH ::




Custom Search