User Tools

Site Tools


ninjablocks_weather_v7_0

Ninja Blocks Weather Sensor

FeatureSupport
Sending
Receiving
Config

Supported Brands

BrandProtocol
Ninja Blocksninjablocks_weather

Sender Arguments

None

Config

"devices": {
	"ninjablocks": {
		"protocol": [ "ninjablocks_weather" ],
		"id": [{
			"id": 1,
			"unit": 1
		}],
		"humidity": 57.00,
		"temperature": 27.69,
	}
},
"gui": {
	"ninjablocks": {
		"name": "Temperature Sensor",
		"group": [ "Misc" ],
		"media": [ "all" ]
	}
}

Optional Settings

GUI Settings

SettingDefaultFormatDescription
temperature-decimals2numberHow many decimals the GUIs should display for temperature
humidity-decimals2numberHow many decimals the GUIs should display for humidity
readonly00 or 1Enable, Disable controlling this device from the GUIs
show-temperature10 or 1
show-humidity10 or 1

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 15Unit Code
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_weather",
        "uuid": "0000-00-00-b4-46a46b",
        "repeats": 1
}
ninjablocks_weather_v7_0.txt · Last modified: 2016/02/10 10:20 by TheWheel