Multisensor_LP8P
CO₂, temperature, humidity barometric pressure sensor for LoRaWAN®
Product Datasheet
Device Profile for Tesenso IoT Cloud
Decoder/Payload Converter for Tesenso IoT Cloud
//V1.0, 31.12.2021,DS
if (msg.data) {
var decoded = decodeFromHex(msg.data);
decoded.ts = msg.ts;
decoded.rssi = msg.rssi;
decoded.snr = msg.snr;
decoded.toa = msg.toa;
decoded.frequency = msg.frequency;
decoded.dr = msg.dr;
decoded.bat = decodeBattery(msg.bat);
decoded.hex = msg.data;
return {
msg: decoded,
metadata: metadata,
msgType: msgType
};
} else {
return {
msg: msg,
metadata: metadata,
msgType: msgType
};
}
function decodeFromHex(data) {
// Decode an uplink message from a buffer
// (array) of bytes to an object of fields.
var decoded = {};
if (data.length == 54){
// Sensor 0: Sensirion SHT21
var rawTempSHT21 = data.substr(10, 4);
var intTempSHT21 = parseInt(rawTempSHT21, 16);
var temperature = 175.72 * intTempSHT21 / 65536 -
46.85;
decoded.temperature = temperature;
var rawHumSHT21 = data.substr(14, 4);
var intHumSHT21 = parseInt(rawHumSHT21, 16);
var humidity = 125 * intHumSHT21 / 65536 - 6;
decoded.humidity = humidity;
// Sensor 2: SenseAir LP8
var rawCO2 = data.substr(18, 4);
var intCO2 = parseInt(rawCO2, 16);
decoded.co2 = intCO2 - 32768;
}
else if (data.length == 62) {
// Sensor 0: Sensirion SHT21
var rawTempSHT21 = data.substr(10, 4);
var intTempSHT21 = parseInt(rawTempSHT21, 16);
var temperature = 175.72 * intTempSHT21 / 65536 -
46.85;
decoded.temperature = temperature;
var rawHumSHT21 = data.substr(14, 4);
var intHumSHT21 = parseInt(rawHumSHT21, 16);
var humidity = 125 * intHumSHT21 / 65536 - 6;
decoded.humidity = humidity;
// Sensor 2: SenseAir LP8
var rawCO2 = data.substr(26, 4);
var intCO2 = parseInt(rawCO2, 16);
decoded.co2 = intCO2 - 32768;
var rawPressureBMP280 = data.substr(22, 4);
var intPressureBMP280 = parseInt(
rawPressureBMP280, 16);
var barometricPressure = intPressureBMP280 * 2;
decoded.barometricPressure = barometricPressure;
if (temperature > 0) {
//*10^10
var satPressure = 1.40574 * Math.exp(-
3928.5 / (temperature + 231.667)) *
10000000000;
} else {
var satPressure = 100 * 361.633 * 10 ^ 12 *
Math.exp(-6150.6 / (temperature +
273.33)) * 10000000000;
}
//decoded.satPressure = satPressure;
decoded.absoluteHumidity = 0.6222 *
satPressure * humidity / 100 / (
barometricPressure - satPressure *
humidity / 100) * 1000
// Sensor 3: Battery Sensor
var rawBattery = data.substr(58, 4);
var intBattery = parseInt(rawBattery, 16);
decoded.batteryVoltage = intBattery / 1000.0;
}
return decoded;
}
function parseHexString(hex) {
for (var bytes = [], c = 0; c < hex.length; c += 2) {
bytes.push(parseInt(hex.substr(c, 2), 16));
}
return bytes;
}
function decodeBattery(byte) {
if (byte == 0) {
return 'External power source';
} else if (byte > 0 && byte < 255) {
return byte / 254 * 100;
} else {
return 'Unknown battery state';
}
}
Device Labels
Air temperature
temperature
telemetry
float
Air humidity
humidity
telemetry
float
absoluteHumidity
telemetry
float
Barometric pressure
barometricPressure
telemetry
float
CO2 concentration
co2
telemetry
float
Battery voltage
batteryVoltage
telemetry
float
Uplink documentation
sample Uplink message (input to the decoder)
{
"cmd": "rx",
"seqno": 634972,
"EUI": "0004A30B001FA764",
"ts": 1661261117028,
"fcnt": 19,
"port": 1,
"freq": 867100000,
"rssi": -90,
"snr": 5,
"toa": 534,
"dr": "SF10 BW125 4/5",
"ack": false,
"bat": 5,
"offline": false,
"data": "0206a8000f5ab480a01977bcb0823c823485f20bef0bc200009878989e07e0"
}
sample decoded output
{
"msg": {
"temperature": 15.409191894531247,
"humidity": 56.80517578125,
"co2": 572,
"barometricPressure": 96608,
"absoluteHumidity": 6.463021502189761,
"batteryVoltage": 2.016,
"ts": 1661262701281,
"rssi": -80,
"snr": 9.8,
"toa": 61,
"frequency": 867700000,
"dr": "SF7 BW125 4/5",
"bat": "External power source",
"hex": "0206a8000f5ab480a01977bcb0823c823485f20bef0bc200009878989e07e0"
},
"metadata": {
"deviceType": "default",
"deviceName": "Test Device",
"ts": "1661325799653"
},
"msgType": "POST_TELEMETRY_REQUEST"
}
Details
Header
Version
uint8
Header
Device ID
uint16
Header
Flags
uint16
Sensor 0
Air temperature
uint16
x / 65536 ∙ 175.72 − 46.85
°C
Sensor 0
Air humidity
uint16
x / 65536 ∙ 125 − 6
%
Sensor 1
Barometer temperature
uint16
(x − 5000) / 100
°C
Sensor 1
Barometric pressure
uint16
x ∙ 2
Pa
Sensor 2
CO2 concentration
uint16
x − 32768
ppm
Sensor 2
CO2 concentration (low-pass filtered)
uint16
x − 32768
ppm
Sensor 2
CO2 sensor temperature
uint16
(x − 32768) / 100
°C
Sensor 2
Capacitor voltage 1
uint16
x / 1000
V
Sensor 2
Capacitor voltage 2
uint16
x / 1000
V
Sensor 2
CO2 sensor status
uint16
x
Sensor 2
Raw IR reading
uint16
x
Sensor 2
Raw IR reading (low-pass filtered)
uint16
x
Sensor 3
Battery voltage
uint16
x / 1000
V
sample Message (hex) (all sensor data included):
020578000f67bd618d1cedbd1081d981f4895b0bd80bb50000959895390c25
02
Version
2
0578
Device ID
1400
000f
Flags
0b0000000000001111
67bd
Air temperature
24.36
deg
618d
Air humidity
41.63
%
1ced
Barometer temperature
24.05
deg
bd10
Barometric pressure
96800
Pa
81d9
CO2 concentration
473
ppm
81f4
CO2 concentration (LPF)
500
ppm
895b
CO2 sensor temperature
23.95
deg
0bd8
Capacitor voltage 1
3.032
V
0bb5
Capacitor voltage 2
2.997
V
0000
CO2 sensor status
0
9598
Raw IR reading
38296
9539
Raw IR reading (LPF)
38201
0c25
Battery voltage
3.109
V
sample Message (hex) (CO2 sensor data not included):
020578000b67bd618d1cedbd100c25
02
Version
2
0578
Device ID
1400
000b
Flags
0b0000000000001011
67bd
Air temperature
24.36
deg
618d
Air humidity
41.63
%
1ced
Barometer temperature
24.05
deg
bd10
Barometric pressure
96800
Pa
0c25
Battery voltage
3.109
V
sample Message(hex) (battery voltage only):
02057800080c25
02
Version
2
0578
Device ID
1400
0008
Flags
0b0000000000001000
0c25
Battery voltage
3.1091V
V
Downlink documentation
Device Keys:
https://nc.decentlab.com/s/pdDzxgGfXsPxpND/authenticate/showShare Im 1password ist das Passwort hinterlegt, um die Devkeys für Decentlab Geräte zu finden.
Knowledge database
https://kb.decentlab.com/knowledge/article/112
FAQ
Last updated