Hello
I have the Problem that the payload decoder don’t make a correct decoded container from the Dragino LHT65 input…
The Original Decoder from Dragino:
function Decode(fPort, bytes){
var data = {
//External sensor
Ext_sensor:
{
“0”:“No external sensor”,
“1”:“Temperature Sensor”,
“4”:“Interrupt Sensor send”,
“5”:“Illumination Sensor”,
“6”:“ADC Sensor”,
“7”:“Interrupt Sensor count”,
}[bytes[6]&0x7F],
//Battery,units:V
BatV:((bytes[0]<<8 | bytes[1]) & 0x3FFF)/1000,
//SHT20,temperature,units:
TempC_SHT:((bytes[2]<<24>>16 | bytes[3])/100).toFixed(2),
//SHT20,Humidity,units:%
Hum_SHT:((bytes[4]<<8 | bytes[5])/10).toFixed(1),
//DS18B20,temperature,units:
TempC_DS:
{
"1":((bytes[7]<<24>>16 | bytes[8])/100).toFixed(2),
}[bytes[6]&0xFF],
//Exti pin level,PA4
Exti_pin_level:
{
"4":bytes[7] ? "High":"Low",
}[bytes[6]&0x7F],
//Exit pin status,PA4
Exti_status:
{
"4":bytes[8] ? "True":"False",
}[bytes[6]&0x7F],
//BH1750,illumination,units:lux
ILL_lux:
{
"5":bytes[7]<<8 | bytes[8],
}[bytes[6]&0x7F],
//ADC,PA4,units:V
ADC_V:
{
"6":(bytes[7]<<8 | bytes[8])/1000,
}[bytes[6]&0x7F],
//Exti count,PA4,units:times
Exit_count:
{
"7":bytes[7]<<8 | bytes[8],
}[bytes[6]&0x7F],
//Applicable to working mode 4567,and working mode 467 requires short circuit PA9 and PA10
No_connect:
{
"1":"Sensor no connection",
}[(bytes[6]&0x80)>>7],
};
return data;
}
But the Output is:
msg.payload : Object
object
applicationID: “1”
applicationName: “Testgeraet”
deviceName: “Dragino_LHT65”
devEUI: “qEBBlnGCe9o=”
rxInfo: array[2]
txInfo: object
adr: true
dr: 0
fCnt: 78
fPort: 2
data: “y7YJCwITAQgCf/8=”
objectJSON: “{“BatV”:2.998,“Ext_sensor”:“Temperature Sensor”,“Hum_SHT”:“53.1”,“TempC_DS”:“20.50”,“TempC_SHT”:“23.15”}”
tags: object
empty
confirmedUplink: false
devAddr: “AIxCWw==”
Now, i want the Container: objectJSON:
objectJSON: “{“BatV”:2.998,“Ext_sensor”:“Temperature Sensor”,“Hum_SHT”:“53.1”,“TempC_DS”:“20.50”,“TempC_SHT”:“23.15”}”
Have like This:
objectJSON:
BatV: 2.982
Ext_sensor: “Temperature Sensor”
Hum_SHT: “88.5”
TempC_DS: “17.06”
TempC_SHT: “17.36”
What i must change?
Sorry but i am an beginner with Chirpstack and Json…
Chers
Marco