This is a
playground to test code. It runs a full
Node.js environment and already has all of
npm’s 400,000 packages pre-installed, including
node-red-contrib-zblight with all
npm packages installed. Try it out:
This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.
This project is an addon node for node-red, which allows you to control power and brightness of various zigbee based smart-bulbs using a Digi XBEE series 2 module.
This requires the following npm packages to work properly:
Install these via npm, inside your node-red directory:
npm install node-red-node-serialport xbee-api node-red-contrib-zblight
You will need to have an XBEE Series 2 module to communicate with the zigbee network, series 1/xbee 802.15.4 modules will not work. The XBEE Radio will need to have the Zigbee Coordinator firmware flashed in to it.
In addition, you will need to make sure the following settings are correct:
This ensures that the xbee can communicate with Zigbee ZDO/ZCL devices, which is required by the Zigbee Home Automation Profile. The ATAP=1 also ensures that the xbee is placed into API mode.
The node generates an API packet to be sent to the xbee module. You will need to configure the zblight node with the MAC address of the bulb you want to control, and the type of bulb you want to control.
Control of the bulbs is done fairly simply. Send a message to the node, with one of the following in the payload:
If you dim a bulb, then turn it off, the next time you turn it on, it will be at the same brightness level.
You can also do more advanced grouping, by simply connecting a single output node to multiple zblight nodes.
In order to figure out the MAC address of the bulbs, as well as making sure the bulb joined your XBEE zigbee coordinator, you can use the Digi XCTU Software discovery mode.
This will show all of the zigbee devices connected to your network, and the routing table between them. On my test network (above), I have A GE Link bulb (7E), A Cree Connected (E2), and a Philips Hue White (00)
If your bulbs do not connect to your network, or if they have been joined to a different network previously, they will need to be factory reset. For the Link and the Cree bulbs, this is done with a specific on/off pattern, for the hue bulbs, they have to be reset with either a touchlink remote, or the hue hub.
Currently, the node has been tested with the following bulbs:
Those are the bulbs I currently have, and have been able to test. I will be looking at aquiring more bulbs (including the Philips Hue RGBW bulbs) to add more compatibility.
These bulbs all support turning power on and off, as well as dimming with this node. The Osram/Sylvania Lightify (Tunable White and RGBW) bulbs have been tested to work with color temperature, as well as hue/saturation changes.