Table of Contents
- Basic Protocol Schema: Command Type, ChannelByte, EffectByte, Param1, Param2, LedData
ChannelByte: Both = 00, Channel 1 = 01, Channel 2 = 02
Command Types: Set Effect = 4b, Unit LED = 46, Get Channel Info = 8d
The Hue+ operates on a serial port, and is made to handle discrete commands sent in packets.
To open a connection to a Hue+ device, open a serial connection on whatever COM port your Hue+ is operating on with a baud rate of
256000, parity set to
None, dataBits set to
8, and stopBits set to
1. Then, begin the handshake process.
Effect protocols are made of exactly 125 bytes or less. For all protocols, the first five bits in each packet are what I will call “settings bytes”, and the remaining 120 are LED data in G, R, B format.
Settings bytes (in order) consist of which kind of command is being set, the channels to apply the effect to, which effect to set, and two parameters. See set effect protocol for more information.
To begin interaction with a Hue+ device, a handshake must first be completed.
The “Hello” handshake can be completed by continuously sending 0xc0, until the Hue+ unit reponds with 0x01.
There is no trick to a “GoodBye” handshake, just close the serial connection.
To get information about what is connected to a channel, send an
8d ChannelByte command to the Hue+. Ex: To get channel info for channel 1, send
8d 01. For channel 2,
8d 02. The response structure is still being worked out, some of the values are still unclear.
- The response should be 5 bytes long, and follows this schema:
- ? : ? Consistent between devices
- ? : ? Not consistent between devices
- ? : ? Not consistent between devices.
- X : Fan or Strip; 0x00 = strips, 0x01 = fans.
- X : Number of fans or strips connected.
Below is a table outlining the settings packets for each effect. Bolded param values are defined below in the Param Scemas Section.
Direction params marked with WM can make use of movement in the effect. See the direction param schema below for more information.
|Covering Marquee||3/ Color*||0x4b||CB||0x04||Direction||CIS/S|
CIS/S params are a composite of a couple values: The index of the current color in a set of colors, and the speed of the effect. Find the values individually, and concatenate them to get the btye to be passed as a param.
- First Digit: Color In Set. If there are multiple colors being applied, this digit denotes the index of the color.
- To Find: digit = x * 2
- x: The color number (Zero Indexed)
- To Find: digit = x * 2
- Second Digit: Speed
- 0 - 4 where 0 is slowest, and 4 is fastest. 2 is normal.
- IF Effect only uses one color, first digit is 0.
- Whole Byte: Concatenate Color In Set (IN HEX), and Speed.
- Ex: If the effect uses one color, and was at normal speed, the resulting byte would be 02.
- Ex: If the color is the third one in the set, and the speed is at fastest, the resulting byte would be 44.
For direction, just like CIS/S, the byte result is a composite of two values: whether or not the effect’s direction is forward or backward, and whether or not the effect should be moving.
If an effect’s param1 byte is marked with WM, it can make use of movement toggling.
- The byte values are as follows:
- Forward: 03
- Backward: 13
- IF marked as WM, the following are also available:
- Forward W/ Movement: 0b
- Backward W/ Movement: 1b
Turning the Hue+ unit’s LED on or off is pretty simple. All of the data needed fits into one packet, and seven bytes.
Just send the desired byte codes over the serial port, and the light should do as instructed.
On: 46 00 c0 00 00 00 ff
Off: 46 00 c0 00 00 ff 00
Special Thanks to Pet0203. for helping me get started and providing base code.