User Tools

Site Tools


ninja_temp_humidity

433 MHz wireless

FeatureSupport
Sending
Receiving
Config

Supported Brands

BrandProtocol
NinjaTemperature 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

SettingDefaultFormatDescription
device-decimals2numberHow many decimals does the temperature and humidity information contain
gui-show-humidity11 or 0Don't display the humidity value
gui-show-temperature11 or 0Don't display the temperature value
gui-readonly00 or 1Enable, 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:

GroupBit #config nameRangeDescription
A0-312SYNC Header
B4-7“unit”:0 to 15UnitCode
C8-9“id:“0 to 3Channel Code
D10-12110Sync Data
E13-19“humidity:“0 to 100 Humidity in %
F20-34“temperature:“0 to 32767Temperature -50°C to 205,99°C
G35 0,1Even Parity Bit
H36 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
ninja_temp_humidity.txt · Last modified: 2015/11/27 22:09 (external edit)