433 MHz wireless
Supported Brands
Brand | Protocol |
---|---|
Ninja | Temperature and Humidity Sensor |
Sender Arguments
-u --unit=unit device with this unit code (0 ... 15] -i --id=id device with this channel code id (0 .. 3) -h --humidity Humidity in % -t --temperature temperature in °C
Config
"living": { "name": "Living", "sensor": { "name": "Sensor", "protocol": [ "ninjablocks" ], "id": [{ "id": 1, "unit": 1 }], "humidity": 5700, "temperature": 2769, "gui-readonly": 0 } }
Optional Settings
Setting | Default | Format | Description |
---|---|---|---|
device-decimals | 2 | number | How many decimals does the temperature and humidity information contain |
gui-show-humidity | 1 | 1 or 0 | Don't display the humidity value |
gui-show-temperature | 1 | 1 or 0 | Don't display the temperature value |
gui-readonly | 0 | 0 or 1 | Enable, Disable controlling this device from the GUIs |
Protocol The ninjablocks protocol sends between 41 and 70 pulses like this
1083 860 966 986 1970 1953 2083 1829 1927 1014 938 1978 1943 993 946 1003 953 1983 2056 877 934 1020 931 1070 884 2013 1893 1012 930 2008 923 1019 1995 1930 925 1026 978 985 1891 1052 907 1036 913 2031 901 1034 916 1067 1881 1988 971 1004 890 1060 754 72330
The pulse stream uses the “Bi-Phase Mark Code” (BMC) or Frequencey/Double Frequency (F2F) principle as defined in ISO/IEC7811.
The first 6 pulses are the SYNC header
and the last pulse is the footer
. These are meant to identify the pulses as genuine. We check for their presence, an error in the first pulse of the header is tolerated, if the second sync pulse after the Unit code and the parity bit is correct, the length of the footer pulse is used to identify the protocol and as end of data transmission.
The first step is to transform this pulse stream into 36 logical bits We can group the sequence of bits into the following groups A to H:
AAAA BBBB CC DDD EEEEEEE FFFFFFFFFFFFFFF G H 1100 0001 00 110 0111001 010011011011001 1 F
Each of the groups of bits (A to H) has a specific meaning:
Group | Bit # | config name | Range | Description |
---|---|---|---|---|
A | 0-3 | 12 | SYNC Header | |
B | 4-7 | “unit”: | 0 to 15 | UnitCode |
C | 8-9 | “id:“ | 0 to 3 | Channel Code |
D | 10-12 | 110 | Sync Data | |
E | 13-19 | “humidity:“ | 0 to 100 | Humidity in % |
F | 20-34 | “temperature:“ | 0 to 32767 | Temperature -50°C to 205,99°C |
G | 35 | 0,1 | Even Parity Bit | |
H | 36 | Footer or gap pulse followed by Footer |
So this code represents:
{ "code": { "id": 0, "unit": 1, "temperature": 2769, "humidity": 5700 }, "origin": "receiver", "protocol": "ninjablocks", "uuid": "0000-00-00-b4-46a46b", "repeats": 1 }
Examples
The corresponding CLI command for pilight-send is:
pilight-send -p ninjablocks -i 0 -u 1 -t 2769 -h 5700