The various protocols and message formats for sensors are listed on this page. As I developed a received programs based on my own sensors, my naming in LamPI might be different from that is accepted as the correct naming, but in general that does not matter.
We will start with a set of common devices (switches and dimmers) followed by a description of sensors protocols (weather stations). The following devices are fond on this page:
The reason why this page is in the development section rather than the hardware section is that the trasnmitter codes are all software and not hardware related. The hardware layer for all transmitter functions is equal.
We mean the new self-learning type of klik-aan-klik-uit equipment that has no wheels for address (housecode) and channel settings. As a result, the codes are longer particularly the adresses to avoid overlap and more or less guarantee that every remote sold has a unique value (so the neighbours have their own house codes).
There are more devices with this codec, however as we do not have them in house, none can be documented to work yet.
_
Sync: | |_________________| (T,10.5T)
_ _
'0': | |_| |_____ (T,T,T,5T)
_ _
'1': | |_____| |_ (T,5T,T,T)
_ _
dim: | |_| |_ (T,T,T,T)
_
Stop: | |_________ .. _____| (T,40T)
T = Pulase period of ~260µs.
This bit-code is simple for Kaku: Most bits are for address selection which must be uniue as the receivers are self-learning (and every handset therefore has to be shipped with a unique address code to recognize THAT handset/remote)
0-7 | 8-15 | 16-23 | 24-31 | 32-35 |
---|---|---|---|---|
A A A A A A A A | A A A A A A A A | A A A A A A A A | A A G X U U U U | D D D D |
The last 4 bits are OPTIONAL and will only present when sending a dimmer message. A dimmer message will have a special bit 27. If that is 2(!) we have a dimmer message and bits 32 to 35 will be there to code the dimmer value.
Bits | #B | Legend | Comment |
---|---|---|---|
AAAA | 26 | Address | So long because codes must be "Unique" |
G | 1 | Group code | Used on remotes (not by LamPI) |
X | 1 | On/Off/Dim | This bit is either 0, 1 or 2 (for dimmers) |
UUUU | 4 | Unit code | Only 16 units PER address are supported |
DDDD | 4 | Dimmer value | If X-bit == 2, we have 4 bits == 16 dimmer values |
SYNC and STOP bits are ot included in the legend as they have no content but are needed to make the receiver aware that a message is coming (and hopefully other transmitters will shut-up in between). Well, the Epic ones for example do not shut up ...
As the Kaku protocol is not fast and takes some time to transmit .... be aware that other will from time to time break into the protocol.
Action receivers are part of a family of remotes that all use more or less the same message format. Other members are:
Under the hood these sets all use the same technology and chips.
_ _
'0': | |___| |___ (T,3T,T,3T)
___ ___
'1': | |_| |_ (3T,T,3T,T)
_ ___
float: | |___| |_ (T,3T,3T,T) used in addresses. Coded as "2"
_
Sync: | |___________ .. ___________| (T, 31T)
T = 300uSec
Every message consists of 12 bits. The first 5 bits are address, the next 5 bits contin the device coding and the last 2 bits contain the value (on or off). Actually, bit values is not quite the correct way of saying: Every "bit" can in fact have 3 values.
0-7 | 8-11 |
---|---|
A A A A A U U U | U U V V |
Bits | #B | Legend | Comment |
---|---|---|---|
AAAAA | 5 | Address | The address is coded between 0 from 31 |
UUUUU | 5 | Unit code | For the action brand of transmitter and receivers, 5 devices can be selected, with their bit position having value "1" and the others having value "2" |
VV | 2 | Value | 02 is "0", and 20 is a "1" value |
Livolo makes wonderful switches and dimmers and some can be controlled by a remote. HOWEVER, their protocol is simple and pollutes the air and makes the receiver interrupt function works hard. So, this would be a protocol to delete from your system if not used.
Livolo timing:
___
| |___| T + T is a 0 bit
_______
| | 2T is a 1 bit
_____________
| | 3.5T is a Start bit
Every message starts with a start pulse of 520 uSec
There are 16 bits address pulses: 150+150 for a 0-bit and 300 for 1-bit
And there are 8 bits for Device id: 150+150 or 300 uSecs
Each bit is approx 300 USec long, either 150+150 or 300
1 start pulse
16 address pulses
7 unit pulses
0-7 | 8-15 | 16-22 |
---|---|---|
A A A A A A A A | A A A A A A A A | U U U U U U U |
Bits | #B | Legend | Comment |
---|---|---|---|
AAAA AAAA AAAA AAAA | 16 | Address | |
UUUU UUU | 7 | Unit |
The command toggles the state of the normal units. So if the unit s now switched on, another command with the same address+unti will switch it off again. The problem wih the Livolo system is therefore that unless you look at the switch or lamp and see what the current state is there is no way to switch a device on or off from a distance. It will just toggle the current value if received well by the wall switch.
So there is no on or off code. By chosing a special unit code, all associated units are switched off.
Same as Livolo. Kopou makes a set of devices that look the same, and their protocol is almost the same as well. So lots of (re)transmissions of codes and heavy load on the receiver to recognize these messages.
_______
Start: |_| | (T,5T)
___
'0': |_| | (T,2T)
_
'1': |___| | (2T,T)
Every message starts with 2 periods start pulse: 140 + 600 uSec
There are 16 bits address pulses: 140+260 for a 0-bit and 260+140 for 1-bit
And there are 8 bits for Unit: 140+260 or 260+140 uSecs
0-7 | 8-15 | 16-23 |
---|---|---|
A A A A A A A A | A A A A A A A A | U U U U U U U U |
Bits | #B | Legend | Comment |
---|---|---|---|
AAAA AAAA AAAA AAAA | 16 | Address | |
UUUU UUUU | 8 | Unit |
Supported devices:
I do have three WT-440 devices that report temperature and humidity around the house. Well, two of them (WT-440h) also report the humidity, one (WT-440) does not. The UPM sensor allows setting a few things by the user:
_
'1': |_| | (T,T)
'0': |___| (2T)
Timing T for the pulses is around 1000 uSec (1mSec) for T
For the WT-440 temperature/humidity sensor, the house code is between 1 and 15, which is over the air reported as 0-14, and the channel is reported as a value of 0 to 3. The UPM message format is a 36-bit code as follows:
0-7 | 8-15 | 16-23 | 24-31 | 32-35 |
---|---|---|---|---|
x x x x H H H H | C C y y B H H H | H H H H T T T T | T T T T T T T T | T T T P |
Bits | #B | Legend | Comment |
---|---|---|---|
xxxx | 4 | unknown, SYNC? | 0x1100 |
HHHH | 4 | House Code | On the device display this is 1 to 15, over the air 0 to 14 |
CC | 2 | Channel Code | |
yy | 2 | unknown | 0x10 |
B | 1 | Battery OK bit | This bit is NOT confirmed |
HHH HHHH | 7 | Humidity | 0x0101011 is 43% |
TTTT TTTTTTTT TTT | 15 | Temperature | |
P | 1 | Parity |
The temperature is calculated as: ( received + 50 ) * 128. For integers it is better to rewrite: (received * 128) + 6400 and this way all values are positive (not signed). When sending over the line to the daemon, we will multiply by 10 to remove fractional parts! (as the resoution is 0.1 degree between 0 and 40 degrees anyway).
According to the nethome website, the UPM protocol also supports wind, windspeed and rain sensors. However, their protocol description differs from what I saw myself as the corect protocol. You find my protocol description above (which is same as Jaakko published).
I found the following pages with protocol description:
I did build support for
The 3 'Byy' its described above are normally a constant with value 6 (0x110). However, although the first bit might(!) signal the battery condition the other 2 are unknown and considered a constant.
Out of the box the WT440 protocol is not suited for sending any other info than temperature and humidity, be it that the Nethome page mentions some reserved addresses (address 10) be used for wind and rain reporting.
If we would like to use the same trick for reporting airpressure, we can of course reserve another address. But it would also be possible to (mis-)use the constant yy bits in the protocol and use them for setting the information to airpressure. If we then would like to report the values of a BMP085 or BMP180 device (which are cheap) then we need room in the message for both the temperature and the airpressure. The 'HHHHHHH' 7 humidity bits to not offer much room to play, as their value is between 0 and 127 and therefore too small to encode airpressure. However, as we would be happy with airpressure readings in one(1) HpA accuracy to if we would use an offset of 930, we would be able to report airpressure readings between 930 and 1056 in these 7 bits. For the Netherlands that is sufficient as never we recorded values above 1050 Hpa and never lower than 950, but if you live in areas with storms etc. you might want to use a different scale.
Of course this would ONLY work in my house if Arduino Sensors are used and if I modify the wt440Receiver function in the Arduino library.
The Auriol sensor is from a cheap weather station sold by LIDL in the Netherlands. It only reports temperature, but as it's ange compared to the Epic WT-440 is much better, I use it to measure outside temperature around my home.
The Auriol sensor uses a pulse length of around 500 uSec. Every message is preceded by a SYNC bit. It's bit coding and timing is as follows:
_
Sync: | |_________________| (T, 18T)
_
'1': | |________| (T,8T)
_
'0': | |____| (T, 4T)
0-7 | 8-15 | 16-23 | 24-31 |
---|---|---|---|
A A A A A A A A | B x x x T T T T | T T T T T T T T | y y y y z z z P |
Bits | #B | Legend | Comment |
---|---|---|---|
S | 1 | Sync | 1 pulse HI, 18 pulses LO |
AAAAAAAA | 8 | Address ID bits | Address |
B | 1 | Battery OK bit | 0x1 (If allright) |
xxx | 3 | unknown | |
TTTT TTTTTTTT | 12 | Temperature | |
yyyy | 4 | unknown | |
zzz | 3 | unknown | |
P | 1 | Parity |
It is not possible to set anytthing on the Auriol weather sensor itself. But its protocol is simple and reliable.
Auriol is NOT supported in direct connected receivers, however it IS supported by the Arduino Gateway and the Arduino Repeater (but for the latter its protocol is converted to wt440 protocol).
We might develop our own protocol that should enable sending and receiving all kind of messages between an Arduino and the Raspberry over 433 MHz transmission. Thinking about doing this, the protocol must be simple to understand and different from the other ones that we support by the Arduino Gateway. It is challenging to develop someting big, allowing several bytes to be sent to the remote side. However, for sensor messaging and clock setting etc. a long word is often enough.
_
Sync: | |_________________| (T, 20T)
_ _
'0': | |___| |___ (T,3T,T,3T)
___ ___
'1': | |_| |_ (3T,T,3T,T)
_ ___
dim: | |_| |___ (T,T,3T,3T)
_
Stop: | |_______ .. _____| (T,40T)
T = 100uSec
0-7 | 8-15 | 16-23 | 24-31 | 32-40 |
---|---|---|---|---|
S S S S A A A A | A A A A C C C C | U U U U U U V V | V V V V V V V V | V V V V V V P P |
Bits | #B | Legend | Comment |
---|---|---|---|
SSSS | 4 | Sync | Special Sync bits, allow fast checking whether this is a lampi message 0x0011 |
AAAAAAAA | 8 | Address ID bits | 256 different addresses possible |
CCCC | 4 | Op Code bits | 16 different commands possible |
UUUUUU | 6 | Unit | 64 devices per address |
VVVV VVVV VVVV VVVV | 12 | Value | |
PP | 2 | Parity |