Following on from yesterday’s success, I’ve done a big data capture of various commands and have figured out (mostly) the protocol.
As you saw yesterday, each command comprises 10 bytes. But actually, each of these only ever take one of 16 values, thus they really represent nibbles. The values of these nibbles are:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|
Then the payload is made out of 10 of these nibbles.
Level (2 nibbles)
The level is defined by nibbles 1 and 2, giving a range of 0-255 (NOTE: this full range is not used, as far as I can tell). For simple commands (on/off), the level is 0.
You can dim a light to one of the 31 different levels, but these levels
start at 129. I find that the easiest way to think of this is 0x80
+ dim level (from 1 to 31), where 0x80
is the hex representation of
the number 128. Note that to dim a light you simply use the ON
command
- there isn’t a specific “dim” command.
As with dimming, for a MOOD
command (see later), you add 0x80
to your mood value -
there are at least 5 moods supported: 0-4.
Subunit (1 nibble)
Each LightwaveRF remote can target 16 different “subunits” - e.g. the remote shown has in effect 34 buttons - on and off the the 16 subunits (A-D * 1-4) plus the two “global” buttons below.
Commands which communicate with all devices send the highest subunit number, 15, where as simple commands can be sent to individual subunits. On the remote above the subunits are 0=A1, 1=A2, 2=A3, … 14=D3, 15=D4.
Command (1 nibble)
LightwaveRF supports (by the looks of it) up to 16 commands. The ones I’m aware of are:
1 2 3 4 5 6 |
|
Note on my mood remote (when the switch on the back is in “mood” mode) the buttons (excluding the off button) from top left to bottom right have moods: 2, 3, 4, 0, 1 - the ordering of which seems a bit bizarre.
Remote Identifier (6 nibbles)
The remainder of the payload I assume to be the identity of the remote control, e.g.
1
|
|
Calculator
I’ve knocked up a quick and dirty calculator to help with encoding/decoding.
How can I use this?
Watch this space, I’ll be posting how to make your own LightwaveRF transceiver using an Arduino soon. As always, the code is on GitHub.