Package detail

hugo

bkw4.8k0.0.3

Yet another node.js interface for philips hue

philips, hue, lighting, home automation

readme

hugo

Yet another node.js module for philips hue.

Example

var bridge = require('hugo').Bridge('someuser', '192.168.x.x');

bridge.on('ready', function () {
    var bulb = bridge.getBulb(1);
    bulb.setColor('red', 5, function (err, res) {
        if (err) {
            throw new Error(err);
        }
        console.log(res);
    });
});

If you leave out the user name, a username will read from environment variable HUE_USER.

If you leave out the ip address, the address will be read from the environment variable HUE_HOST. If no such variable exists, the bridge will be discovered over upnp. This is very hackish and experimental and obviously slower than specifying it.

Debugging

To see what is going on behind the scenes, you can enable debugging by setting the environment variable DEBUG to any of the following:

  • hugo.bridge
  • hugo.lightstate
  • hugo.color
  • hugo.discovery

Multiple values can be separated by commas. Alternatively you can also specify hugo.* or even `*

Example:

% DEBUG=hugo.color node demos/series.js red blue white
% DEBUG=hugo.lightstate,hugo.bridge node demos/flash.js
% DEBUG='hugo.*' node demos/fadeout.js 3

changelog

0.0.1 / 2013-03-22

  • Initial release

0.0.2 / 2013-03-23

  • better error handling for missing or wrong username
  • added demo/repl.js
  • added script to create a new user

0.0.3 / 2013-10-05

  • use xy colorspace to demos (not all bulbs support ct)
  • don't bomb out on errors returned from bulbs in setAll()
  • updated dependencies