From a819bd86f754d927c24864b2cd8b798792128f2a Mon Sep 17 00:00:00 2001 From: netvox-tech Date: Thu, 7 Dec 2023 15:49:00 +0800 Subject: [PATCH 1/2] add r718pa,r718pa4,r718pb,rp02,r718n3 support --- vendor/netvox/index.yaml | 4 ++++ vendor/netvox/payload/r718n3.js | 21 +++++++++++++++++++++ vendor/netvox/r718n3-codec.yaml | 30 ++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+) diff --git a/vendor/netvox/index.yaml b/vendor/netvox/index.yaml index d646e6704b..d58d385898 100755 --- a/vendor/netvox/index.yaml +++ b/vendor/netvox/index.yaml @@ -76,8 +76,11 @@ endDevices: - r718n360 - r718nl3 - r718t + - r718pa + - r718pa4 - r718pa22 - r718pe + - r718pb - r718q - r718qa - r718t2 @@ -127,3 +130,4 @@ endDevices: - rb02c - rb02i - rb11e + - rp02 diff --git a/vendor/netvox/payload/r718n3.js b/vendor/netvox/payload/r718n3.js index 07f911e57e..5b9939d4fa 100755 --- a/vendor/netvox/payload/r718n3.js +++ b/vendor/netvox/payload/r718n3.js @@ -55,6 +55,9 @@ function decodeUplink(input) { data: data, }; } + var map = new Map([ + [0,1],[1,5],[2,10],[3,100] + ]); data.Device = getDeviceName(input.bytes[1]); if (input.bytes[3] & 0x80) @@ -77,6 +80,24 @@ function decodeUplink(input) { data.Multiplier2 = input.bytes[4]; data.Multiplier3 = input.bytes[5]; } + else if (input.bytes[2] === 0x03) + { + data.Current1 = (input.bytes[4]<<8 | input.bytes[5]); + data.Current2 = (input.bytes[6]<<8 | input.bytes[7]); + data.Current3 = (input.bytes[8]<<8 | input.bytes[9]); + data.Multiplier1 = map.get(input.bytes[10] & 3); + data.Multiplier2 = map.get(input.bytes[10]>>2 & 3); + data.Multiplier3 = map.get(input.bytes[10]>>4 & 3); + } + else if (input.bytes[2] === 0x04) + { + data.LowCurrent1Alarm = input.bytes[4] & 1; + data.HighCurrent1Alarm = input.bytes[4]>>1 & 1; + data.LowCurrent2Alarm = input.bytes[4] >>2 & 1; + data.HighCurren2Alarm = input.bytes[4]>>3 & 1; + data.LowCurrent3Alarm = input.bytes[4]>>4 & 1; + data.HighCurrent3Alarm = input.bytes[4]>>5 & 1; + } break; case 7: diff --git a/vendor/netvox/r718n3-codec.yaml b/vendor/netvox/r718n3-codec.yaml index 3e99bd71cd..cc39265b29 100755 --- a/vendor/netvox/r718n3-codec.yaml +++ b/vendor/netvox/r718n3-codec.yaml @@ -36,6 +36,36 @@ uplinkDecoder: Multiplier2: 3 Multiplier3: 10 + - description: Status report - 3 + input: + fPort: 6 + bytes: [0x01, 0x4A, 0x03, 0x24, 0x03, 0xE8, 0x00, 0xC8, 0x1B, 0x58, 0x36] + output: + data: + Device: 'R718N3' + Volt: 3.6 + Current1: 1000 + Current2: 200 + Current3: 7000 + Multiplier1: 10 + Multiplier2: 5 + Multiplier3: 100 + + - description: Status report - 4 + input: + fPort: 6 + bytes: [0x01, 0x4A, 0x04, 0x24, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Device: 'R718N3' + Volt: 3.6 + LowCurrent1Alarm: 1 + HighCurrent1Alarm: 0 + LowCurrent2Alarm: 0 + HighCurren2Alarm: 1 + LowCurrent3Alarm: 1 + HighCurrent3Alarm: 1 + - description: Configure report response input: fPort: 7 From c981d2987c5de6e64a12efe8df91ffae32a0da46 Mon Sep 17 00:00:00 2001 From: netvox-tech Date: Thu, 7 Dec 2023 15:49:54 +0800 Subject: [PATCH 2/2] add r718pa,r718pa4,r718pb,rp02,r718n3 support --- vendor/netvox/payload/r718pa.js | 366 ++++++++++++++++++++ vendor/netvox/payload/r718pa4.js | 155 +++++++++ vendor/netvox/payload/r718pb.js | 367 ++++++++++++++++++++ vendor/netvox/payload/rp02.js | 333 ++++++++++++++++++ vendor/netvox/r718pa-codec.yaml | 566 ++++++++++++++++++++++++++++++ vendor/netvox/r718pa.yaml | 59 ++++ vendor/netvox/r718pa4-codec.yaml | 92 +++++ vendor/netvox/r718pa4.yaml | 59 ++++ vendor/netvox/r718pb-codec.yaml | 567 +++++++++++++++++++++++++++++++ vendor/netvox/r718pb.yaml | 59 ++++ vendor/netvox/rp02-codec.yaml | 515 ++++++++++++++++++++++++++++ vendor/netvox/rp02.yaml | 59 ++++ 12 files changed, 3197 insertions(+) create mode 100644 vendor/netvox/payload/r718pa.js create mode 100644 vendor/netvox/payload/r718pa4.js create mode 100644 vendor/netvox/payload/r718pb.js create mode 100644 vendor/netvox/payload/rp02.js create mode 100644 vendor/netvox/r718pa-codec.yaml create mode 100644 vendor/netvox/r718pa.yaml create mode 100644 vendor/netvox/r718pa4-codec.yaml create mode 100644 vendor/netvox/r718pa4.yaml create mode 100644 vendor/netvox/r718pb-codec.yaml create mode 100644 vendor/netvox/r718pb.yaml create mode 100644 vendor/netvox/rp02-codec.yaml create mode 100644 vendor/netvox/rp02.yaml diff --git a/vendor/netvox/payload/r718pa.js b/vendor/netvox/payload/r718pa.js new file mode 100644 index 0000000000..32d6bca23f --- /dev/null +++ b/vendor/netvox/payload/r718pa.js @@ -0,0 +1,366 @@ +function getCfgCmd(cfgcmd){ + var cfgcmdlist = { + 0x01: "ConfigReportReq", + 0x81: "ConfigReportRsp", + 0x02: "ReadConfigReportReq", + 0x82: "ReadConfigReportRsp", + 0x03: "SetLDOSettingReq", + 0x83: "SetLDOSettingRsp", + 0x04: "GetLDOSettingReq", + 0x84: "GetLDOSettingRsp", + 0x05: "ORPCalibrateReq", + 0x85: "ORPCalibrateRsp", + 0x06: "PHCalibrateReq", + 0x86: "PHCalibrateRsp", + 0x07: "NTUCalibrateReq", + 0x87: "NTUCalibrateRsp", + 0x08: "SetWireLengthReq", + 0x88: "SetWireLengthRsp", + 0x09: "GetWireLengthReq", + 0x89: "GetWireLengthRsp", + 0x0A: "SetSoilTypeReq", + 0x8A: "SetSoilTypeRsp", + 0x0B: "GetSoilTypeReq", + 0x8B: "GetSoilTypeRsp", + 0x0C: "SoilCalibrateReq", + 0x8C: "SoilCalibrateRsp", + }; + return cfgcmdlist[cfgcmd]; +} + +function getCmdToID(cmdtype){ + if (cmdtype == "ConfigReportReq") + return 0x01; + else if (cmdtype == "ConfigReportRsp") + return 0x81; + else if (cmdtype == "ReadConfigReportReq") + return 0x02; + else if (cmdtype == "ReadConfigReportRsp") + return 0x82; + else if (cmdtype == "SetLDOSettingReq") + return 0x03; + else if (cmdtype == "SetLDOSettingRsp") + return 0x83; + else if (cmdtype == "GetLDOSettingReq") + return 0x04; + else if (cmdtype == "GetLDOSettingRsp") + return 0x84; + else if (cmdtype == "ORPCalibrateReq") + return 0x05; + else if (cmdtype == "ORPCalibrateRsp") + return 0x85; + else if (cmdtype == "PHCalibrateReq") + return 0x06; + else if (cmdtype == "PHCalibrateRsp") + return 0x86; + else if (cmdtype == "NTUCalibrateReq") + return 0x07; + else if (cmdtype == "NTUCalibrateRsp") + return 0x87; + else if (cmdtype == "SetWireLengthReq") + return 0x08; + else if (cmdtype == "SetWireLengthRsp") + return 0x88; + else if (cmdtype == "GetWireLengthReq") + return 0x09; + else if (cmdtype == "GetWireLengthRsp") + return 0x89; + else if (cmdtype == "SetSoilTypeReq") + return 0x0A; + else if (cmdtype == "SetSoilTypeRsp") + return 0x8A; + else if (cmdtype == "GetSoilTypeReq") + return 0x0B; + else if (cmdtype == "GetSoilTypeRsp") + return 0x8B; + else if (cmdtype == "SoilCalibrateReq") + return 0x0C; + else if (cmdtype == "SoilCalibrateRsp") + return 0x8C; +} + + +function getDeviceName(dev){ + var deviceName = { + 0x57: "R718PA" + }; + return deviceName[dev]; +} + +function getDeviceID(devName){ + var deviceName = { + "R718PA": 0x57 + }; + return deviceName[devName]; +} + +function padLeft(str, len) { + str = '' + str; + if (str.length >= len) { + return str; + } else { + return padLeft("0" + str, len); + } +} + +function decodeUplink(input) { + var data = {}; + switch (input.fPort) { + case 6: + if (input.bytes[2] === 0x00) + { + data.Device = getDeviceName(input.bytes[1]); + data.SWver = input.bytes[3]/10; + data.HWver = input.bytes[4]; + data.Datecode = padLeft(input.bytes[5].toString(16), 2) + padLeft(input.bytes[6].toString(16), 2) + padLeft(input.bytes[7].toString(16), 2) + padLeft(input.bytes[8].toString(16), 2); + + return { + data: data, + }; + } + data.Device = getDeviceName(input.bytes[1]); + if (input.bytes[3] & 0x80) + { + var tmp_v = input.bytes[3] & 0x7F; + data.Volt = (tmp_v / 10).toString() + '(low battery)'; + } + else{ + data.Volt = input.bytes[3]/10; + } + if(input.bytes[2] === 0x01){ + data.PM1_0_CF = (input.bytes[4]<<8 | input.bytes[5]); + data.PM2_5_CF = (input.bytes[6]<<8 | input.bytes[7]); + data.PM10_CF = (input.bytes[8]<<8 | input.bytes[9]); + }else if(input.bytes[2] === 0x02){ + data.PM1_0 = (input.bytes[4]<<8 | input.bytes[5]); + data.PM2_5 = (input.bytes[6]<<8 | input.bytes[7]); + data.PM10 = (input.bytes[8]<<8 | input.bytes[9]); + }else if(input.bytes[2] === 0x03){ + data.PM0_3UM = (input.bytes[4]<<16 | input.bytes[5]<<8 | input.bytes[6]); + if (data.PM0_3UM & 0x80){ + data.PM0_3UM = data.PM0_3UM & 0x7F; + } + data.PM0_5UM = (input.bytes[7]<<8 | input.bytes[8]); + data.PM1_0UM =(input.bytes[9]<<8 | input.bytes[10]); + }else if(input.bytes[2] === 0x04){ + data.PM2_5UM = (input.bytes[4]<<8 | input.bytes[5]); + data.PM5_0UM = (input.bytes[6]<<8 | input.bytes[7]); + data.PM10UM = (input.bytes[8]<<8 | input.bytes[9]); + }else if(input.bytes[2] === 0x05){ + data.O3 = (input.bytes[4]<<8 | input.bytes[5])*0.1; + data.CO = (input.bytes[6]<<8 | input.bytes[7])*0.1; + data.NO = (input.bytes[8]<<8 | input.bytes[9])*0.1; + }else if(input.bytes[2] === 0x06){ + data.NO2 = (input.bytes[4]<<8 | input.bytes[5])*0.1; + data.SO2 = (input.bytes[6]<<8 | input.bytes[7]); + data.H2S = (input.bytes[8]<<8 | input.bytes[9])*0.1; + }else if(input.bytes[2] === 0x07){ + data.CO2_0_1 = (input.bytes[4]<<8 | input.bytes[5])*0.1; + data.NH3 = (input.bytes[6]<<8 | input.bytes[7])*0.1; + data.Noise = (input.bytes[8]<<8 | input.bytes[9])*0.1; + }else if(input.bytes[2] === 0x08){ + data.PH = (input.bytes[4]<<8 | input.bytes[5])*0.01; + data.Tempera = (input.bytes[6]<<8 | input.bytes[7])*0.01; + data.ORP = (input.bytes[8]<<8 | input.bytes[9]); + if (data.Tempera & 0x80){ + data.Tempera = data.Tempera & 0x7F; + } + if (data.ORP & 0x80){ + data.ORP= data.ORP & 0x7F; + } + }else if(input.bytes[2] === 0x09){ + data.NTU = (input.bytes[4]<<8 | input.bytes[5])*0.1; + data.Tempera = (input.bytes[6]<<8 | input.bytes[7])*0.01; + data.Soil_VWC = (input.bytes[8]<<8 | input.bytes[9])*0.01; + if (data.Tempera & 0x80){ + data.Tempera= data.Tempera & 0x7F; + } + }else if(input.bytes[2] === 0x0A){ + data.Soil_VWC = (input.bytes[4]<<8 | input.bytes[5])*0.01; + data.Soil_Temp = (input.bytes[6]<<8 | input.bytes[7])*0.01; + data.water = (input.bytes[8]<<8 | input.bytes[9]); + data.Soil_EC = input.bytes[10]*0.1; + }else if(input.bytes[2] === 0x0B){ + data.Tempera = (input.bytes[4]<<8 | input.bytes[5])*0.01; + data.LDODO = (input.bytes[6]<<8 | input.bytes[7])*0.01; + data.LDOSat = (input.bytes[8]<<8 | input.bytes[9])*0.1; + if (data.Tempera & 0x80){ + data.Tempera= data.Tempera & 0x7F; + } + }else if(input.bytes[2] === 0x0C){ + data.Tempera = (input.bytes[4]<<8 | input.bytes[5])*0.01; + data.Humidity = (input.bytes[6]<<8 | input.bytes[7])*0.01; + data.WindSpeed = (input.bytes[8]<<8 | input.bytes[9])*0.01; + }else if(input.bytes[2] === 0x0D){ + data.WindDirection = (input.bytes[4]<<8 | input.bytes[5]); + data.Atomsphere = ((input.bytes[6]<<24) | (input.bytes[7]<<16) | (input.bytes[8]<<8)| (input.bytes[9]))*0.01; + }else if(input.bytes[2] === 0x0E){ + data.VOC_0_1 = (input.bytes[4]<<8 | input.bytes[5])*0.1; + }else if(input.bytes[2] === 0x0F){ + data.Nitrogen = (input.bytes[4]<<8 | input.bytes[5]); + data.Phosphorus = (input.bytes[6]<<8 | input.bytes[7]); + data.Potassium = (input.bytes[8]<<8 | input.bytes[9]); + }else if(input.bytes[2] === 0x11){ + data.Velocity = (input.bytes[4]<<8 | input.bytes[5])*0.1; + data.Displacement = (input.bytes[6]<<8 | input.bytes[7])*0.1; + data.Surface = (input.bytes[8]<<8 | input.bytes[9])*0.1; + } + break; + + case 7: + data.Cmd = getCfgCmd(input.bytes[0]); + data.Device = getDeviceName(input.bytes[1]); + if (input.bytes[0] === getCmdToID("ReadConfigReportRsp") + || input.bytes[0] === getCmdToID("ReadConfigReportRsp")) + { + data.MinTime = (input.bytes[2]<<8 | input.bytes[3]); + data.MaxTime = (input.bytes[4]<<8 | input.bytes[5]); + } + else if (input.bytes[0] === getCmdToID("ConfigReportRsp") + || input.bytes[0] === getCmdToID("SetLDOSettingRsp") + || input.bytes[0] === getCmdToID("ORPCalibrateRsp") + || input.bytes[0] === getCmdToID("PHCalibrateRsp") + || input.bytes[0] === getCmdToID("NTUCalibrateRsp") + || input.bytes[0] === getCmdToID("SetWireLengthRsp") + || input.bytes[0] === getCmdToID("SetSoilTypeRsp") + || input.bytes[0] === getCmdToID("SoilCalibrateRsp")) + { + data.Status = (input.bytes[2] === 0x00) ? 'Success' : 'Failure'; + }else if(input.bytes[0] === getCmdToID("GetLDOSettingRsp")){ + data.LDOsAltiud = input.bytes[2]<<8 |input.bytes[3]; + data.LDOsPSU = input.bytes[4]<<8 |input.bytes[5]; + }else if(input.bytes[0] === getCmdToID("GetWireLengthRsp")){ + + data.Length = (input.bytes[2]<<8 |input.bytes[3]); + }else if(input.bytes[0] === getCmdToID("GetSoilTypeRsp")){ + data.SoilType = input.bytes[2]; + } + break; + + default: + return { + errors: ['unknown FPort'], + }; + + } + + return { + data: data, + }; +} + +function encodeDownlink(input) { + var ret = []; + var devid; + var getCmdID; + + getCmdID = getCmdToID(input.data.Cmd); + devid = getDeviceID(input.data.Device); + + if (input.data.Cmd == "ConfigReportReq") + { + var mint = input.data.MinTime; + var maxt = input.data.MaxTime; + ret = ret.concat(getCmdID, devid, (mint >> 8), (mint & 0xFF), (maxt >> 8), (maxt & 0xFF), 0x00, 0x00, 0x00, 0x00,0x00); + }else if (input.data.Cmd == "ReadConfigReportReq" + || input.data.Cmd == "GetLDOSettingReq" + || input.data.Cmd == "GetWireLengthReq" + || input.data.Cmd == "GetSoilTypeReq") + { + ret = ret.concat(getCmdID, devid, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + }else if (input.data.Cmd == "SetLDOSettingReq") + { + var LDOsAltiud = input.data.LDOsAltiud; + var LDOsPSU = input.data.LDOsPSU; + ret = ret.concat(getCmdID, devid, (LDOsAltiud >> 8), (LDOsAltiud & 0xFF), (LDOsPSU >> 8), (LDOsPSU & 0xFF), 0x00, 0x00, 0x00, 0x00, 0x00); + }else if (input.data.Cmd == "ORPCalibrateReq") + { + var StandORP = input.data.StandORP; + ret = ret.concat(getCmdID, devid, (StandORP >> 8), (StandORP & 0xFF), 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + }else if (input.data.Cmd == "PHCalibrateReq") + { + var StandPH = input.data.StandPH; + ret = ret.concat(getCmdID, devid, (StandPH >> 8), (StandPH & 0xFF), 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + }else if (input.data.Cmd == "NTUCalibrateReq") + { + var StandNTU = input.data.StandNTU; + ret = ret.concat(getCmdID, devid, (StandNTU >> 8), (StandNTU & 0xFF), 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + }else if (input.data.Cmd == "SetWireLengthReq") + { + var Length = input.data.Length/10; + ret = ret.concat(getCmdID, devid, (Length >> 8), (Length & 0xFF), 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + }else if (input.data.Cmd == "SetSoilTypeReq") + { + var SoildType = input.data.SoildType; + ret = ret.concat(getCmdID, devid, SoildType, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + }else if (input.data.Cmd == "SoilCalibrateReq") + { + var VWCDelt = input.data.VWCDelt; + ret = ret.concat(getCmdID, devid, VWCDelt, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + } + + return { + fPort: 7, + bytes: ret + }; +} + +function decodeDownlink(input) { + var data = {}; + switch (input.fPort) { + case 7: + data.Cmd = getCfgCmd(input.bytes[0]); + data.Device = getDeviceName(input.bytes[1]); + if (input.bytes[0] === getCmdToID("ConfigReportReq")) + { + data.MinTime = (input.bytes[2]<<8 | input.bytes[3]); + data.MaxTime = (input.bytes[4]<<8 | input.bytes[5]); + }else if (input.bytes[0] === getCmdToID("ReadConfigReportReq") + ||input.bytes[0] === getCmdToID("GetLDOSettingReq") + || input.bytes[0]== getCmdToID("GetWireLengthReq") + || input.bytes[0] == getCmdToID("GetSoilTypeReq")) + { + + }else if (input.bytes[0] === getCmdToID("SetLDOSettingReq")) + { + data.LDOsAltiud = (input.bytes[2]<<8 | input.bytes[3]); + data.LDOsPSU = (input.bytes[4]<<8 | input.bytes[5]); + }else if (input.bytes[0]== getCmdToID("ORPCalibrateReq")) + { + data.StandORP = (input.bytes[2]<<8 | input.bytes[3]); + + }else if (input.bytes[0] == getCmdToID("PHCalibrateReq")) + { + data.StandPH = (input.bytes[2]<<8 | input.bytes[3]); + + }else if (input.bytes[0]== getCmdToID("NTUCalibrateReq")) + { + data.StandNTU = (input.bytes[2]<<8 | input.bytes[3]); + + }else if (input.bytes[0]== getCmdToID("SetWireLengthReq")) + { + data.Length = (input.bytes[2]<<8 | input.bytes[3])*10; + + }else if (input.bytes[0]== getCmdToID("SetSoilTypeReq")) + { + data.SoildType = input.bytes[2]; + + }else if (input.bytes[0]== getCmdToID("SoilCalibrateReq")) + { + data.VWCDelt = input.bytes[2]+"%"; + } + + + break; + + default: + return { + rrors: ['invalid FPort'], + }; + } + + return { + data: data, + }; +} + diff --git a/vendor/netvox/payload/r718pa4.js b/vendor/netvox/payload/r718pa4.js new file mode 100644 index 0000000000..6d3d3ca0b4 --- /dev/null +++ b/vendor/netvox/payload/r718pa4.js @@ -0,0 +1,155 @@ +function getCfgCmd(cfgcmd){ + var cfgcmdlist = { + 0x01: "ConfigReportReq", + 0x81: "ConfigReportRsp", + 0x02: "ReadConfigReportReq", + 0x82: "ReadConfigReportRsp" + }; + return cfgcmdlist[cfgcmd]; +} + +function getCmdToID(cmdtype){ + if (cmdtype == "ConfigReportReq") + return 0x01; + else if (cmdtype == "ConfigReportRsp") + return 0x81; + else if (cmdtype == "ReadConfigReportReq") + return 0x02; + else if (cmdtype == "ReadConfigReportRsp") + return 0x82; +} + + +function getDeviceName(dev){ + var deviceName = { + 0x57: "R718PA4" + }; + return deviceName[dev]; +} + +function getDeviceID(devName){ + var deviceName = { + "R718PA4": 0x57 + }; + return deviceName[devName]; +} + +function padLeft(str, len) { + str = '' + str; + if (str.length >= len) { + return str; + } else { + return padLeft("0" + str, len); + } +} + +function decodeUplink(input) { + var data = {}; + switch (input.fPort) { + case 6: + if (input.bytes[2] === 0x00) + { + data.Device = getDeviceName(input.bytes[1]); + data.SWver = input.bytes[3]/10; + data.HWver = input.bytes[4]; + data.Datecode = padLeft(input.bytes[5].toString(16), 2) + padLeft(input.bytes[6].toString(16), 2) + padLeft(input.bytes[7].toString(16), 2) + padLeft(input.bytes[8].toString(16), 2); + + return { + data: data, + }; + } + + data.Device = getDeviceName(input.bytes[1]); + if (input.bytes[3] & 0x80) + { + var tmp_v = input.bytes[3] & 0x7F; + data.Volt = (tmp_v / 10).toString() + '(low battery)'; + } + else + data.Volt = input.bytes[3]/10; + if(input.bytes[2] === 0x06){ + data.NO2 = (input.bytes[4]<<8 | input.bytes[5])*0.1; + data.SO2 = (input.bytes[6]<<8 | input.bytes[7]); + data.H2S = (input.bytes[8]<<8 | input.bytes[9])*0.1; + } + + break; + + case 7: + data.Cmd = getCfgCmd(input.bytes[0]); + data.Device = getDeviceName(input.bytes[1]); + if (input.bytes[0] === getCmdToID("ConfigReportRsp")) + { + data.Status = (input.bytes[2] === 0x00) ? 'Success' : 'Failure'; + } + else if (input.bytes[0] === getCmdToID("ReadConfigReportRsp")) + { + data.MinTime = (input.bytes[2]<<8 | input.bytes[3]); + data.MaxTime = (input.bytes[4]<<8 | input.bytes[5]); + } + break; + + default: + return { + errors: ['unknown FPort'], + }; + + } + + return { + data: data, + }; +} + +function encodeDownlink(input) { + var ret = []; + var devid; + var getCmdID; + + getCmdID = getCmdToID(input.data.Cmd); + devid = getDeviceID(input.data.Device); + + if (input.data.Cmd == "ConfigReportReq") + { + var mint = input.data.MinTime; + var maxt = input.data.MaxTime; + ret = ret.concat(getCmdID, devid, (mint >> 8), (mint & 0xFF), (maxt >> 8), (maxt & 0xFF), 0x00, 0x00, 0x00, 0x00,0x00); + } + else if (input.data.Cmd == "ReadConfigReportReq") + { + ret = ret.concat(getCmdID, devid, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + } + + return { + fPort: 7, + bytes: ret + }; +} + +function decodeDownlink(input) { + var data = {}; + switch (input.fPort) { + case 7: + data.Cmd = getCfgCmd(input.bytes[0]); + data.Device = getDeviceName(input.bytes[1]); + if (input.bytes[0] === getCmdToID("ConfigReportReq")) + { + data.MinTime = (input.bytes[2]<<8 | input.bytes[3]); + data.MaxTime = (input.bytes[4]<<8 | input.bytes[5]); + }else if(input.bytes[0] === getCmdToID("ReadConfigReportReq")){ + + } + + break; + + default: + return { + rrors: ['invalid FPort'], + }; + } + + return { + data: data, + }; +} + diff --git a/vendor/netvox/payload/r718pb.js b/vendor/netvox/payload/r718pb.js new file mode 100644 index 0000000000..5289d878c1 --- /dev/null +++ b/vendor/netvox/payload/r718pb.js @@ -0,0 +1,367 @@ +function getCfgCmd(cfgcmd){ + var cfgcmdlist = { + 0x01: "ConfigReportReq", + 0x81: "ConfigReportRsp", + 0x02: "ReadConfigReportReq", + 0x82: "ReadConfigReportRsp", + 0x03: "SetLDOSettingReq", + 0x83: "SetLDOSettingRsp", + 0x04: "GetLDOSettingReq", + 0x84: "GetLDOSettingRsp", + 0x05: "ORPCalibrateReq", + 0x85: "ORPCalibrateRsp", + 0x06: "PHCalibrateReq", + 0x86: "PHCalibrateRsp", + 0x07: "NTUCalibrateReq", + 0x87: "NTUCalibrateRsp", + 0x08: "SetWireLengthReq", + 0x88: "SetWireLengthRsp", + 0x09: "GetWireLengthReq", + 0x89: "GetWireLengthRsp", + 0x0A: "SetSoilTypeReq", + 0x8A: "SetSoilTypeRsp", + 0x0B: "GetSoilTypeReq", + 0x8B: "GetSoilTypeRsp", + 0x0C: "SoilCalibrateReq", + 0x8C: "SoilCalibrateRsp", + }; + return cfgcmdlist[cfgcmd]; +} + +function getCmdToID(cmdtype){ + if (cmdtype == "ConfigReportReq") + return 0x01; + else if (cmdtype == "ConfigReportRsp") + return 0x81; + else if (cmdtype == "ReadConfigReportReq") + return 0x02; + else if (cmdtype == "ReadConfigReportRsp") + return 0x82; + else if (cmdtype == "SetLDOSettingReq") + return 0x03; + else if (cmdtype == "SetLDOSettingRsp") + return 0x83; + else if (cmdtype == "GetLDOSettingReq") + return 0x04; + else if (cmdtype == "GetLDOSettingRsp") + return 0x84; + else if (cmdtype == "ORPCalibrateReq") + return 0x05; + else if (cmdtype == "ORPCalibrateRsp") + return 0x85; + else if (cmdtype == "PHCalibrateReq") + return 0x06; + else if (cmdtype == "PHCalibrateRsp") + return 0x86; + else if (cmdtype == "NTUCalibrateReq") + return 0x07; + else if (cmdtype == "NTUCalibrateRsp") + return 0x87; + else if (cmdtype == "SetWireLengthReq") + return 0x08; + else if (cmdtype == "SetWireLengthRsp") + return 0x88; + else if (cmdtype == "GetWireLengthReq") + return 0x09; + else if (cmdtype == "GetWireLengthRsp") + return 0x89; + else if (cmdtype == "SetSoilTypeReq") + return 0x0A; + else if (cmdtype == "SetSoilTypeRsp") + return 0x8A; + else if (cmdtype == "GetSoilTypeReq") + return 0x0B; + else if (cmdtype == "GetSoilTypeRsp") + return 0x8B; + else if (cmdtype == "SoilCalibrateReq") + return 0x0C; + else if (cmdtype == "SoilCalibrateRsp") + return 0x8C; +} + + +function getDeviceName(dev){ + var deviceName = { + 0x58: "R718PB" + }; + return deviceName[dev]; +} + +function getDeviceID(devName){ + var deviceName = { + "R718PB": 0x58 + }; + return deviceName[devName]; +} + +function padLeft(str, len) { + str = '' + str; + if (str.length >= len) { + return str; + } else { + return padLeft("0" + str, len); + } +} + +function decodeUplink(input) { + var data = {}; + switch (input.fPort) { + case 6: + if (input.bytes[2] === 0x00) + { + data.Device = getDeviceName(input.bytes[1]); + data.SWver = input.bytes[3]/10; + data.HWver = input.bytes[4]; + data.Datecode = padLeft(input.bytes[5].toString(16), 2) + padLeft(input.bytes[6].toString(16), 2) + padLeft(input.bytes[7].toString(16), 2) + padLeft(input.bytes[8].toString(16), 2); + + return { + data: data, + }; + } + data.Device = getDeviceName(input.bytes[1]); + if (input.bytes[3] & 0x80) + { + var tmp_v = input.bytes[3] & 0x7F; + data.Volt = (tmp_v / 10).toString() + '(low battery)'; + } + else{ + data.Volt = input.bytes[3]/10; + } + if(input.bytes[2] === 0x01){ + data.PM1_0_CF = (input.bytes[4]<<8 | input.bytes[5]); + data.PM2_5_CF = (input.bytes[6]<<8 | input.bytes[7]); + data.PM10_CF = (input.bytes[8]<<8 | input.bytes[9]); + }else if(input.bytes[2] === 0x02){ + data.PM1_0 = (input.bytes[4]<<8 | input.bytes[5]); + data.PM2_5 = (input.bytes[6]<<8 | input.bytes[7]); + data.PM10 = (input.bytes[8]<<8 | input.bytes[9]); + }else if(input.bytes[2] === 0x03){ + data.PM0_3UM = (input.bytes[4]<<16 | input.bytes[5]<<8 | input.bytes[6]); + if (data.PM0_3UM & 0x80){ + data.PM0_3UM = data.PM0_3UM & 0x7F; + } + data.PM0_5UM = (input.bytes[7]<<8 | input.bytes[8]); + data.PM1_0UM =(input.bytes[9]<<8 | input.bytes[10]); + }else if(input.bytes[2] === 0x04){ + data.PM2_5UM = (input.bytes[4]<<8 | input.bytes[5]); + data.PM5_0UM = (input.bytes[6]<<8 | input.bytes[7]); + data.PM10UM = (input.bytes[8]<<8 | input.bytes[9]); + }else if(input.bytes[2] === 0x05){ + data.O3 = (input.bytes[4]<<8 | input.bytes[5])*0.1; + data.CO = (input.bytes[6]<<8 | input.bytes[7])*0.1; + data.NO = (input.bytes[8]<<8 | input.bytes[9])*0.1; + }else if(input.bytes[2] === 0x06){ + data.NO2 = (input.bytes[4]<<8 | input.bytes[5])*0.1; + data.SO2 = (input.bytes[6]<<8 | input.bytes[7]); + data.H2S = (input.bytes[8]<<8 | input.bytes[9])*0.1; + }else if(input.bytes[2] === 0x07){ + data.CO2_0_1 = (input.bytes[4]<<8 | input.bytes[5])*0.1; + data.NH3 = (input.bytes[6]<<8 | input.bytes[7])*0.1; + data.Noise = (input.bytes[8]<<8 | input.bytes[9])*0.1; + }else if(input.bytes[2] === 0x08){ + data.PH = (input.bytes[4]<<8 | input.bytes[5])*0.01; + data.Tempera = (input.bytes[6]<<8 | input.bytes[7])*0.01; + data.ORP = (input.bytes[8]<<8 | input.bytes[9]); + if (data.Tempera & 0x80){ + data.Tempera = data.Tempera & 0x7F; + } + if (data.ORP & 0x80){ + data.ORP= data.ORP & 0x7F; + } + }else if(input.bytes[2] === 0x09){ + data.NTU = (input.bytes[4]<<8 | input.bytes[5])*0.1; + data.Tempera = (input.bytes[6]<<8 | input.bytes[7])*0.01; + data.Soil_VWC = (input.bytes[8]<<8 | input.bytes[9])*0.01; + if (data.Tempera & 0x80){ + data.Tempera= data.Tempera & 0x7F; + } + }else if(input.bytes[2] === 0x0A){ + data.Soil_VWC = (input.bytes[4]<<8 | input.bytes[5])*0.01; + data.Soil_Temp = (input.bytes[6]<<8 | input.bytes[7])*0.01; + data.water = (input.bytes[8]<<8 | input.bytes[9]); + data.Soil_EC = input.bytes[10]*0.1; + }else if(input.bytes[2] === 0x0B){ + data.Tempera = (input.bytes[4]<<8 | input.bytes[5])*0.01; + data.LDODO = (input.bytes[6]<<8 | input.bytes[7])*0.01; + data.LDOSat = (input.bytes[8]<<8 | input.bytes[9])*0.1; + if (data.Tempera & 0x80){ + data.Tempera= data.Tempera & 0x7F; + } + }else if(input.bytes[2] === 0x0C){ + data.Tempera = (input.bytes[4]<<8 | input.bytes[5])*0.01; + data.Humidity = (input.bytes[6]<<8 | input.bytes[7])*0.01; + data.WindSpeed = (input.bytes[8]<<8 | input.bytes[9])*0.01; + }else if(input.bytes[2] === 0x0D){ + data.WindDirection = (input.bytes[4]<<8 | input.bytes[5]); + data.Atomsphere = ((input.bytes[6]<<24) | (input.bytes[7]<<16) | (input.bytes[8]<<8)| (input.bytes[9]))*0.01; + }else if(input.bytes[2] === 0x0E){ + data.VOC_0_1 = (input.bytes[4]<<8 | input.bytes[5])*0.1; + }else if(input.bytes[2] === 0x0F){ + data.Nitrogen = (input.bytes[4]<<8 | input.bytes[5]); + data.Phosphorus = (input.bytes[6]<<8 | input.bytes[7]); + data.Potassium = (input.bytes[8]<<8 | input.bytes[9]); + }else if(input.bytes[2] === 0x10){ + data.Soil_VWC = (input.bytes[4]<<8 | input.bytes[5])*0.01; + data.Soil_Temperature = (input.bytes[6]<<8 | input.bytes[7])*0.01; + data.Soli_EC = (input.bytes[8]<<8 | input.bytes[9])*0.001; + } + + break; + + case 7: + data.Cmd = getCfgCmd(input.bytes[0]); + data.Device = getDeviceName(input.bytes[1]); + if (input.bytes[0] === getCmdToID("ReadConfigReportRsp") + || input.bytes[0] === getCmdToID("ReadConfigReportRsp")) + { + data.MinTime = (input.bytes[2]<<8 | input.bytes[3]); + data.MaxTime = (input.bytes[4]<<8 | input.bytes[5]); + } + else if (input.bytes[0] === getCmdToID("ConfigReportRsp") + || input.bytes[0] === getCmdToID("SetLDOSettingRsp") + || input.bytes[0] === getCmdToID("ORPCalibrateRsp") + || input.bytes[0] === getCmdToID("PHCalibrateRsp") + || input.bytes[0] === getCmdToID("NTUCalibrateRsp") + || input.bytes[0] === getCmdToID("SetWireLengthRsp") + || input.bytes[0] === getCmdToID("SetSoilTypeRsp") + || input.bytes[0] === getCmdToID("SoilCalibrateRsp")) + { + data.Status = (input.bytes[2] === 0x00) ? 'Success' : 'Failure'; + }else if(input.bytes[0] === getCmdToID("GetLDOSettingRsp")){ + data.LDOsAltiud = input.bytes[2]<<8 |input.bytes[3]; + data.LDOsPSU = input.bytes[4]<<8 |input.bytes[5]; + }else if(input.bytes[0] === getCmdToID("GetWireLengthRsp")){ + + data.Length = (input.bytes[2]<<8 |input.bytes[3]); + }else if(input.bytes[0] === getCmdToID("GetSoilTypeRsp")){ + data.SoilType = input.bytes[2]; + } + break; + + default: + return { + errors: ['unknown FPort'], + }; + + } + + return { + data: data, + }; +} + +function encodeDownlink(input) { + var ret = []; + var devid; + var getCmdID; + + getCmdID = getCmdToID(input.data.Cmd); + devid = getDeviceID(input.data.Device); + + if (input.data.Cmd == "ConfigReportReq") + { + var mint = input.data.MinTime; + var maxt = input.data.MaxTime; + ret = ret.concat(getCmdID, devid, (mint >> 8), (mint & 0xFF), (maxt >> 8), (maxt & 0xFF), 0x00, 0x00, 0x00, 0x00,0x00); + }else if (input.data.Cmd == "ReadConfigReportReq" + || input.data.Cmd == "GetLDOSettingReq" + || input.data.Cmd == "GetWireLengthReq" + || input.data.Cmd == "GetSoilTypeReq") + { + ret = ret.concat(getCmdID, devid, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + }else if (input.data.Cmd == "SetLDOSettingReq") + { + var LDOsAltiud = input.data.LDOsAltiud; + var LDOsPSU = input.data.LDOsPSU; + ret = ret.concat(getCmdID, devid, (LDOsAltiud >> 8), (LDOsAltiud & 0xFF), (LDOsPSU >> 8), (LDOsPSU & 0xFF), 0x00, 0x00, 0x00, 0x00, 0x00); + }else if (input.data.Cmd == "ORPCalibrateReq") + { + var StandORP = input.data.StandORP; + ret = ret.concat(getCmdID, devid, (StandORP >> 8), (StandORP & 0xFF), 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + }else if (input.data.Cmd == "PHCalibrateReq") + { + var StandPH = input.data.StandPH; + ret = ret.concat(getCmdID, devid, (StandPH >> 8), (StandPH & 0xFF), 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + }else if (input.data.Cmd == "NTUCalibrateReq") + { + var StandNTU = input.data.StandNTU; + ret = ret.concat(getCmdID, devid, (StandNTU >> 8), (StandNTU & 0xFF), 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + }else if (input.data.Cmd == "SetWireLengthReq") + { + var Length = input.data.Length/10; + ret = ret.concat(getCmdID, devid, (Length >> 8), (Length & 0xFF), 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + }else if (input.data.Cmd == "SetSoilTypeReq") + { + var SoildType = input.data.SoildType; + ret = ret.concat(getCmdID, devid, SoildType, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + }else if (input.data.Cmd == "SoilCalibrateReq") + { + var VWCDelt = input.data.VWCDelt; + ret = ret.concat(getCmdID, devid, VWCDelt, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + } + + return { + fPort: 7, + bytes: ret + }; +} + +function decodeDownlink(input) { + var data = {}; + switch (input.fPort) { + case 7: + data.Cmd = getCfgCmd(input.bytes[0]); + data.Device = getDeviceName(input.bytes[1]); + if (input.bytes[0] === getCmdToID("ConfigReportReq")) + { + data.MinTime = (input.bytes[2]<<8 | input.bytes[3]); + data.MaxTime = (input.bytes[4]<<8 | input.bytes[5]); + }else if (input.bytes[0] === getCmdToID("ReadConfigReportReq") + ||input.bytes[0] === getCmdToID("GetLDOSettingReq") + || input.bytes[0]== getCmdToID("GetWireLengthReq") + || input.bytes[0] == getCmdToID("GetSoilTypeReq")) + { + + }else if (input.bytes[0] === getCmdToID("SetLDOSettingReq")) + { + data.LDOsAltiud = (input.bytes[2]<<8 | input.bytes[3]); + data.LDOsPSU = (input.bytes[4]<<8 | input.bytes[5]); + }else if (input.bytes[0]== getCmdToID("ORPCalibrateReq")) + { + data.StandORP = (input.bytes[2]<<8 | input.bytes[3]); + + }else if (input.bytes[0] == getCmdToID("PHCalibrateReq")) + { + data.StandPH = (input.bytes[2]<<8 | input.bytes[3]); + + }else if (input.bytes[0]== getCmdToID("NTUCalibrateReq")) + { + data.StandNTU = (input.bytes[2]<<8 | input.bytes[3]); + + }else if (input.bytes[0]== getCmdToID("SetWireLengthReq")) + { + data.Length = (input.bytes[2]<<8 | input.bytes[3])*10; + + }else if (input.bytes[0]== getCmdToID("SetSoilTypeReq")) + { + data.SoildType = input.bytes[2]; + + }else if (input.bytes[0]== getCmdToID("SoilCalibrateReq")) + { + data.VWCDelt = input.bytes[2]+"%"; + } + + + break; + + default: + return { + rrors: ['invalid FPort'], + }; + } + + return { + data: data, + }; +} + diff --git a/vendor/netvox/payload/rp02.js b/vendor/netvox/payload/rp02.js new file mode 100644 index 0000000000..6790e0d1d2 --- /dev/null +++ b/vendor/netvox/payload/rp02.js @@ -0,0 +1,333 @@ +function getCfgCmd(cfgcmd){ + var cfgcmdlist = { + 0x90: "Off", + 0x91: "On", + 0x92: "Off(Cant manually On After Off)", + 0x93: "ClearEnergy", + 0x94: "ResetToFactory", + 0x95: "LeakageCurrentSeftTest", + 0x96: "ClearError/AlarmLog", + 0x01: "ConfigReportReq", + 0x81: "ConfigReportRsp", + 0x02: "ReadConfigReportReq", + 0x82: "ReadConfigReportRsp", + 0x03: "SetPassThroughModeReq", + 0x83: "SetPassThroughModeRsq", + 0x04: "GetPassThroughModeReq", + 0x84: "GetPassThroughModeRsq", + 0x05: "SetProtectionRep", + 0x85: "SetProtectionRsp", + 0x06: "GetTripCntReq", + 0x86: "GetTripCntRsq", + 0x07: "GetAlarmInfoReq(For 1P)", + 0x87: "GetAlarmInfoRsq(For 1P)", + 0x08: "GetAlarmInfoRep(For 3P)", + 0x88: "GetAlarmInfoRsp1(For 3P)", + 0x89: "GetAlarmInfoRsp2(For 3P)", + 0x8A: "GetAlarmInfoRsp3(For 3P)", + }; + return cfgcmdlist[cfgcmd]; +} + +function getCmdToID(cmdtype){ + if (cmdtype == "ConfigReportReq") + return 0x01; + else if (cmdtype == "ConfigReportRsp") + return 0x81; + else if (cmdtype == "ReadConfigReportReq") + return 0x02; + else if (cmdtype == "ReadConfigReportRsp") + return 0x82; + else if (cmdtype == "SetPassThroughModeReq") + return 0x03; + else if (cmdtype == "SetPassThroughModeRsq") + return 0x83; + else if (cmdtype == "GetPassThroughModeReq") + return 0x04; + else if (cmdtype == "GetPassThroughModeRsq") + return 0x84; + else if (cmdtype == "SetProtectionRep") + return 0x05; + else if (cmdtype == "SetProtectionRsp") + return 0x85; + else if (cmdtype == "GetTripCntReq") + return 0x06; + else if (cmdtype == "GetTripCntRsq") + return 0x86; + else if (cmdtype == "GetAlarmInfoReq(For 1P)") + return 0x07; + else if (cmdtype == "GetAlarmInfoRsq(For 1P)") + return 0x87; + else if (cmdtype == "GetAlarmInfoRep(For 3P)") + return 0x08; + else if (cmdtype == "GetAlarmInfoRsp1(For 3P)") + return 0x88; + else if (cmdtype == "GetAlarmInfoRsp2(For 3P)") + return 0x89; + else if (cmdtype == "GetAlarmInfoRsp3(For 3P)") + return 0x8A; + else if (cmdtype == "Off") + return 0x90; + else if (cmdtype == "On") + return 0x91; + else if (cmdtype == "Off(Cant manually On After Off)") + return 0x92; + else if (cmdtype == "ClearEnergy") + return 0x93; + else if (cmdtype == "ResetToFactory") + return 0x94; + else if (cmdtype == "LeakageCurrentSeftTest") + return 0x95; + else if (cmdtype == "ClearError/AlarmLog") + return 0x96; +} + + +function getDeviceName(dev){ + var deviceName = { + 0x9C: "RP02" + }; + return deviceName[dev]; +} + +function getDeviceID(devName){ + var deviceName = { + "RP02": 0x9C + }; + return deviceName[devName]; +} + +function padLeft(str, len) { + str = '' + str; + if (str.length >= len) { + return str; + } else { + return padLeft("0" + str, len); + } +} + +function decodeUplink(input) { + var data = {}; + switch (input.fPort) { + case 6: + if (input.bytes[2] === 0x00) + { + data.Device = getDeviceName(input.bytes[1]); + data.SWver = input.bytes[3]/10; + data.HWver = input.bytes[4]; + data.Datecode = padLeft(input.bytes[5].toString(16), 2) + padLeft(input.bytes[6].toString(16), 2) + padLeft(input.bytes[7].toString(16), 2) + padLeft(input.bytes[8].toString(16), 2); + + return { + data: data, + }; + } + data.Device = getDeviceName(input.bytes[1]); + data.BreakerRS485Addr = input.bytes[3]; + if(input.bytes[2] === 0x01){ + data.BreakerType = input.bytes[4]; + data.BreakerProtectStatusBits_1P = input.bytes[5]; + data.AlarmStatusBits_1P = input.bytes[6]; + data.Pre_TripStatusBits_1P = input.bytes[7]; + data.TripStatusBits_1P = input.bytes[8]; + data.HandOrAutoControlAndSelfTestStatus = input.bytes[9]; + }else if(input.bytes[2] === 0x02){ + data.Current = (input.bytes[4]<<8 | input.bytes[5]); + data.Voltage = (input.bytes[6]<<8 | input.bytes[7]); + data.Power = (input.bytes[8]<<8 | input.bytes[9]); + data.Temperature = input.bytes[10]; + }else if(input.bytes[2] === 0x03){ + data.Energy = (input.bytes[4]<<24 | input.bytes[5]<<16 | input.bytes[6]<<8 |input.bytes[7]); + data.Frequency = input.bytes[8]; + data.PowerFactor =input.bytes[9]; + }else if(input.bytes[2] === 0x04){ + data.LeakageCurrent = (input.bytes[4]<<8 | input.bytes[5]); + data.OnOffTotalCount = (input.bytes[6]<<24 | input.bytes[7]<<16 | input.bytes[8]<<8 |input.bytes[9]); + }else if(input.bytes[2] === 0x11){ + data.BreakerTYpe = input.bytes[4]; + data.BreakerProtectStatusBits = (input.bytes[5]<<8 | input.bytes[6]); + data.AlarmStatusBits = (input.bytes[7]<<8 | input.bytes[8]); + data.PreTripStatusBits = (input.bytes[9]<<8 | input.bytes[10]); + }else if(input.bytes[2] === 0x12){ + data.TripStatusBits = (input.bytes[4]<<8 | input.bytes[5]); + data.APhaseCurrent = (input.bytes[6]<<8 | input.bytes[7])*10; + data.BphaseCurrent = (input.bytes[8]<<8 | input.bytes[9])*10; + }else if(input.bytes[2] === 0x13){ + data.CPhaseCurrent = (input.bytes[4]<<8 | input.bytes[5])*10; + data.AphaseVoltage = (input.bytes[6]<<8 | input.bytes[7]); + data.BPhaseVoltage = (input.bytes[8]<<8 | input.bytes[9]); + data.Temperature = input.bytes[10]; + }else if(input.bytes[2] === 0x014){ + data.CPhaseVoltage = (input.bytes[4]<<8 | input.bytes[5]); + data.APhasePower = (input.bytes[6]<<8 | input.bytes[7]); + data.BPhasePower = (input.bytes[8]<<8 | input.bytes[9]); + data.Frequency = input.bytes[10]; + }else if(input.bytes[2] === 0x15){ + data.CPhasePower = (input.bytes[4]<<8 | input.bytes[5]); + data.APhaseEnergy = (input.bytes[6]<<24 | input.bytes[7]<<16 |input.bytes[8]<<8 | input.bytes[9]); + }else if(input.bytes[2] === 0x16){ + data.BPhaseEnergy = (input.bytes[4]<<24 | input.bytes[5]<<16 | input.bytes[6]<<8 | input.bytes[7]); + data.APhasePowerFactor = input.bytes[8]; + data.CPhasePowerFactor = input.bytes[9]; + data.BPhasePowerFactor = input.bytes[10]; + }else if(input.bytes[2] === 0x17){ + data.CPhaseEnergy = (input.bytes[4]<<24 | input.bytes[5]<<16| input.bytes[6]<<8 | input.bytes[7]); + data.HandOrAutoControlStatus = input.bytes[8]; + if(input.bytes[9]===0x00){ + data.OnOffStatus = "Off"; + }else if(input.bytes[9]===0x01){ + data.OnOffStatus = "On"; + }else{ + data.OnOffStatus = input.bytes[9]; + } + }else if(input.bytes[2] === 0x18){ + data.LeakageCurrent = (input.bytes[4]<<8 | input.bytes[5]); + data.OnOffTotalCount = (input.bytes[6]<<24 | input.bytes[7]<<16 |input.bytes[8]<<8 | input.bytes[9]); + } + break; + + case 7: + data.Cmd = getCfgCmd(input.bytes[0]); + data.Device = getDeviceName(input.bytes[1]); + if (input.bytes[0] === getCmdToID("ReadConfigReportRsp") ) + { + data.MinTime = (input.bytes[2]<<8 | input.bytes[3]); + data.MaxTime = (input.bytes[4]<<8 | input.bytes[5]); + } + else if (input.bytes[0] === getCmdToID("ConfigReportRsp") + || input.bytes[0] === getCmdToID("SetPassThroughModeRsq") + || input.bytes[0] === getCmdToID("SetProtectionRsp")) + { + data.Status = (input.bytes[2] === 0x00) ? 'Success' : 'Failure'; + }else if(input.bytes[0] === getCmdToID("GetPassThroughModeRsq")){ + data.PassThroughModeOn = input.bytes[2]; + }else if(input.bytes[0] === getCmdToID("GetTripCntRsq")){ + data.OverLoadTripCnt = input.bytes[2]; + data.ShortCircuitTripCnt = input.bytes[3]; + data.LeakageCurrentTripCnt = input.bytes[4]; + data.UnderVoltagetTripCnt = input.bytes[5]; + data.OverVoltagetTripCnt = input.bytes[6]; + data.TemperaturetTripCnt = input.bytes[7]; + data.RemoteSelfTesttTripCnt = input.bytes[8]; + data.LeakingPhaseTripCnt = input.bytes[9]; + }else if(input.bytes[0] === getCmdToID("GetAlarmInfoRsq(For 1P)")){ + data.AlarmCurrent = (input.bytes[2]<<8 | input.bytes[3]); + data.AlarmLeakageCurrent = (input.bytes[4]<<8 | input.bytes[5]); + data.AlarmVoltage = (input.bytes[6]<<8 | input.bytes[7]); + data.AlarmTemperature = input.bytes[8]; + }else if(input.bytes[0] === getCmdToID("GetAlarmInfoRsp1(For 3P)")){ + data.AlarmAPhaseCurrent = (input.bytes[2]<<8 | input.bytes[3]); + data.AlarmBPhaseCurrent = (input.bytes[4]<<8 | input.bytes[5]); + data.AlarmCPhaseCurrent = (input.bytes[6]<<8 | input.bytes[7]); + data.AlarmHPhaseCurrent = (input.bytes[8]<<8 | input.bytes[9]); + }else if(input.bytes[0] === getCmdToID("GetAlarmInfoRsp2(For 3P)")){ + data.AlarmLeakageCurrent = (input.bytes[2]<<8 | input.bytes[3]); + data.AlarmAPhaseVoltage = (input.bytes[4]<<8 | input.bytes[5]); + data.AlarmBPhaseVoltage = (input.bytes[6]<<8 | input.bytes[7]); + data.AlarmCPhaseVoltage = (input.bytes[8]<<8 | input.bytes[9]); + }else if(input.bytes[0] === getCmdToID("GetAlarmInfoRsp3(For 3P)")){ + data.AlarmTemperature = input.bytes[2]; + }else if(input.bytes[0] === getCmdToID("Off") + || input.bytes[0] === getCmdToID("On") + || input.bytes[0] === getCmdToID("Off(Cant manually On After Off)") + || input.bytes[0] === getCmdToID("ClearEnergy") + || input.bytes[0] === getCmdToID("ResetToFactory") + || input.bytes[0] === getCmdToID("LeakageCurrentSeftTest") + || input.bytes[0] === getCmdToID("ClearError/AlarmLog")){ + data.BreakerRS485Addr = input.bytes[2]; + } + break; + + default: + return { + errors: ['unknown FPort'], + }; + + } + + return { + data: data, + }; +} + +function encodeDownlink(input) { + var ret = []; + var devid; + var getCmdID; + + getCmdID = getCmdToID(input.data.Cmd); + devid = getDeviceID(input.data.Device); + + if (input.data.Cmd == "ConfigReportReq") + { + var mint = input.data.MinTime; + var maxt = input.data.MaxTime; + ret = ret.concat(getCmdID, devid, (mint >> 8), (mint & 0xFF), (maxt >> 8), (maxt & 0xFF), 0x00, 0x00, 0x00, 0x00,0x00); + }else if (input.data.Cmd == "ReadConfigReportReq" + ||input.data.Cmd == "GetPassThroughModeReq" + ) + { + ret = ret.concat(getCmdID, devid, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + }else if (input.data.Cmd == "SetPassThroughModeReq" + ||input.data.Cmd == "GetTripCntReq" + ||input.data.Cmd == "GetAlarmInfoReq(For 1P)" + ||input.data.Cmd == "GetAlarmInfoRep(For 3P)") + { + var PassThroughModeOn = input.data.PassThroughModeOn; + ret = ret.concat(getCmdID, devid, PassThroughModeOn, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + }else if (input.data.Cmd == "SetProtectionRep") + { + var BreakerRS485Addr = input.data.BreakerRS485Addr; + var ProtectionType = input.data.ProtectionType; + var ProtectionAction = input.data.ProtectionAction; + ret = ret.concat(getCmdID, devid, BreakerRS485Addr, ProtectionType, ProtectionAction, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + } + + return { + fPort: 7, + bytes: ret + }; +} + +function decodeDownlink(input) { + var data = {}; + switch (input.fPort) { + case 7: + data.Cmd = getCfgCmd(input.bytes[0]); + data.Device = getDeviceName(input.bytes[1]); + if (input.bytes[0] === getCmdToID("ConfigReportReq")) + { + data.MinTime = (input.bytes[2]<<8 | input.bytes[3]); + data.MaxTime = (input.bytes[4]<<8 | input.bytes[5]); + }else if (input.bytes[0] === getCmdToID("ReadConfigReportReq") + ||input.bytes[0] === getCmdToID("GetPassThroughModeReq") + ||input.bytes[0] === getCmdToID("GetTripCntReq") + ||input.bytes[0] === getCmdToID("GetAlarmInfoReq(For 1P)")) + { + + }else if (input.bytes[0] === getCmdToID("SetPassThroughModeReq")) + { + data.PassThroughModeOn = input.bytes[2]; + }else if (input.bytes[0] === getCmdToID("SetProtectionRep")) + { + data.BreakerRS485Addr = input.bytes[2]; + data.ProtectionType = input.bytes[3]; + data.ProtectionAction = input.bytes[4]; + }else if (input.bytes[0] === getCmdToID("GetAlarmInfoRep(For 3P)")) + { + data.BreakerRS485Addr = input.bytes[2]; + } + + + break; + + default: + return { + rrors: ['invalid FPort'], + }; + } + + return { + data: data, + }; +} + diff --git a/vendor/netvox/r718pa-codec.yaml b/vendor/netvox/r718pa-codec.yaml new file mode 100644 index 0000000000..cd2a6b4559 --- /dev/null +++ b/vendor/netvox/r718pa-codec.yaml @@ -0,0 +1,566 @@ +uplinkDecoder: + fileName: payload/r718pa.js + examples: + - description: Startup version report + input: + fPort: 6 + bytes: [0x01, 0x57, 0x00, 0x6E, 0x06, 0x20, 0x23, 0x09, 0x11, 0x00, 0x00] + output: + data: + Device: 'R718PA' + SWver: 11 + HWver: 6 + Datecode: '20230911' + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x57, 0x01, 0x77, 0x09, 0x08, 0x00, 0x19, 0x01, 0x00, 0x00] + output: + data: + Device: 'R718PA' + Volt: 11.9 + PM1_0_CF: 2312 + PM2_5_CF: 25 + PM10_CF: 256 + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x57, 0x02, 0x77, 0x09, 0x09, 0x00, 0x10, 0x01, 0x00, 0x00] + output: + data: + Device: 'R718PA' + Volt: 11.9 + PM1_0: 2313 + PM2_5: 16 + PM10: 256 + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x57, 0x03, 0x60, 0x09, 0x09, 0x00, 0x10, 0x01, 0x00, 0x00] + output: + data: + Device: 'R718PA' + Volt: 9.6 + PM0_3UM: 592128 + PM0_5UM: 4097 + PM1_0UM: 0 + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x57, 0x04, 0x60, 0x03, 0x09, 0x00, 0x10, 0x01, 0x00, 0x00] + output: + data: + Device: 'R718PA' + Volt: 9.6 + PM2_5UM: 777 + PM5_0UM: 16 + PM10UM: 256 + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x57, 0x05, 0x60, 0x09, 0x09, 0x00, 0x10, 0x03, 0x02, 0x00] + output: + data: + Device: 'R718PA' + Volt: 9.6 + O3: 231.3 + CO: 1.6 + NO: 77 + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x57, 0x06, 0x55, 0x09, 0x09, 0x00, 0x10, 0x01, 0x00, 0x00] + output: + data: + Device: 'R718PA' + Volt: 8.5 + NO2: 231.3 + SO2: 16 + H2S: 25.6 + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x57, 0x07, 0x60, 0x09, 0x01, 0x00, 0x10, 0x01, 0x00, 0x00] + output: + data: + Device: 'R718PA' + Volt: 9.6 + CO2_0_1: 230.5 + NH3: 1.6 + Noise: 25.6 + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x57, 0x08, 0x60, 0x09, 0x09, 0x00, 0x10, 0x01, 0x00, 0x00] + output: + data: + Device: 'R718PA' + Volt: 9.6 + PH: 23.13 + Tempera: 0.16 + ORP: 256 + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x57, 0x09, 0x60, 0x09, 0x05, 0x00, 0x10, 0x01, 0x00, 0x00] + output: + data: + Device: 'R718PA' + Volt: 9.6 + NTU: 230.9 + Tempera: 0.16 + Soil_VWC: 2.56 + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x57, 0x0A, 0x60, 0x09, 0x09, 0x00, 0x10, 0x01, 0x00, 0x00] + output: + data: + Device: 'R718PA' + Volt: 9.6 + Soil_VWC: 23.13 + Soil_Temp: 0.16 + water: 256 + Soil_EC: 0 + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x57, 0x0B, 0x33, 0x09, 0x09, 0x00, 0x10, 0x01, 0x00, 0x00] + output: + data: + Device: 'R718PA' + Volt: 5.1 + Tempera: 23.13 + LDODO: 0.16 + LDOSat: 25.6 + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x57, 0x0C, 0x60, 0x09, 0x09, 0x00, 0x10, 0x01, 0x00, 0x00] + output: + data: + Device: 'R718PA' + Volt: 9.6 + Tempera: 23.13 + Humidity: 0.16 + WindSpeed: 2.56 + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x57, 0x0D, 0x60, 0x09, 0x09, 0x00, 0x10, 0x01, 0x01, 0x00] + output: + data: + Device: 'R718PA' + Volt: 9.6 + WindDirection: 2313 + Atomsphere: 10488.33 + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x57, 0x0E, 0x60, 0x09, 0x09, 0x00, 0x10, 0x01, 0x00, 0x00] + output: + data: + Device: 'R718PA' + Volt: 9.6 + VOC_0_1: 231.3 + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x57, 0x0F, 0x60, 0x09, 0x09, 0x00, 0x10, 0x01, 0x00, 0x00] + output: + data: + Device: 'R718PA' + Volt: 9.6 + Nitrogen: 2313 + Phosphorus: 16 + Potassium: 256 + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x57, 0x011, 0x60, 0x09, 0x09, 0x00, 0x10, 0x01, 0x00, 0x00] + output: + data: + Device: 'R718PA' + Volt: 9.6 + Velocity: 231.3 + Displacement: 1.6 + Surface: 25.6 + + - description: Configure report response + input: + fPort: 7 + bytes: [0x81, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportRsp' + Device: 'R718PA' + Status: 'Success' + + - description: Read configure report response + input: + fPort: 7 + bytes: [0x82, 0x57, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'ReadConfigReportRsp' + Device: 'R718PA' + MinTime: 900 + MaxTime: 1800 + + - description: Read configure report response + input: + fPort: 7 + bytes: [0x83, 0x57, 0x00, 0x84, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'SetLDOSettingRsp' + Device: 'R718PA' + Status: 'Success' + + - description: GetLDOSettingRsp + input: + fPort: 7 + bytes: [0x84, 0x57, 0x03, 0x05, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'GetLDOSettingRsp' + Device: 'R718PA' + LDOsAltiud: 773 + LDOsPSU: 1800 + + - description: ORPCalibrateRsp + input: + fPort: 7 + bytes: [0x85, 0x57, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'ORPCalibrateRsp' + Device: 'R718PA' + Status: 'Failure' + + - description: PHCalibrateRsp + input: + fPort: 7 + bytes: [0x86, 0x57, 0x07, 0x84, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'PHCalibrateRsp' + Device: 'R718PA' + Status: 'Failure' + + - description: NTUCalibrateRsp + input: + fPort: 7 + bytes: [0x87, 0x57, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'NTUCalibrateRsp' + Device: 'R718PA' + Status: 'Failure' + + - description: SetWireLengthRsp + input: + fPort: 7 + bytes: [0x88, 0x57, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'SetWireLengthRsp' + Device: 'R718PA' + Status: 'Failure' + + - description: GetWireLengthRsp + input: + fPort: 7 + bytes: [0x89, 0x57, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'GetWireLengthRsp' + Device: 'R718PA' + Length: 900 + + - description: SetSoilTypeRsp + input: + fPort: 7 + bytes: [0x8A, 0x57, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'SetSoilTypeRsp' + Device: 'R718PA' + Status: 'Failure' + + - description: GetSoilTypeRsp + input: + fPort: 7 + bytes: [0x8B, 0x57, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'GetSoilTypeRsp' + Device: 'R718PA' + SoilType: 3 + + - description: SoilCalibrateRsp + input: + fPort: 7 + bytes: [0x8C, 0x57, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'SoilCalibrateRsp' + Device: 'R718PA' + Status: 'Failure' + +downlinkDecoder: + fileName: payload/r718pa.js + examples: + - description: Configure report request + input: + fPort: 7 + bytes: [0x01, 0x57, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'ConfigReportReq' + Device: 'R718PA' + MinTime: 900 + MaxTime: 1800 + + - description: Read configure report request + input: + fPort: 7 + bytes: [0x02, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R718PA' + + - description: SetLDOSettingReq + input: + fPort: 7 + bytes: [0x03, 0x57, 0x04, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetLDOSettingReq' + Device: 'R718PA' + LDOsAltiud: 1024 + LDOsPSU: 768 + + - description: GetLDOSettingReq + input: + fPort: 7 + bytes: [0x04, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetLDOSettingReq' + Device: 'R718PA' + + - description: ORPCalibrateReq + input: + fPort: 7 + bytes: [0x05, 0x57, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ORPCalibrateReq' + Device: 'R718PA' + StandORP: 2048 + + - description: PHCalibrateReq + input: + fPort: 7 + bytes: [0x06, 0x57, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'PHCalibrateReq' + Device: 'R718PA' + StandPH: 1792 + + - description: NTUCalibrateReq + input: + fPort: 7 + bytes: [0x07, 0x57, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'NTUCalibrateReq' + Device: 'R718PA' + StandNTU: 1024 + + - description: SetWireLengthReq + input: + fPort: 7 + bytes: [0x08, 0x57, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetWireLengthReq' + Device: 'R718PA' + Length: 10240 + + - description: GetWireLengthReq + input: + fPort: 7 + bytes: [0x09, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetWireLengthReq' + Device: 'R718PA' + + - description: SetSoilTypeReq + input: + fPort: 7 + bytes: [0x0A, 0x57, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetSoilTypeReq' + Device: 'R718PA' + SoildType: 6 + + - description: GetSoilTypeReq + input: + fPort: 7 + bytes: [0x0B, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetSoilTypeReq' + Device: 'R718PA' + + - description: SoilCalibrateReq + input: + fPort: 7 + bytes: [0x0C, 0x57, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SoilCalibrateReq' + Device: 'R718PA' + VWCDelt: 8% + +downlinkEncoder: + fileName: payload/r718pa.js + examples: + - description: Configure report request + input: + data: + Cmd: 'ConfigReportReq' + Device: 'R718PA' + MinTime: 900 + MaxTime: 1800 + output: + fPort: 7 + bytes: [0x01, 0x57, 0x03, 0x84, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: Read configure report request + input: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R718PA' + output: + fPort: 7 + bytes: [0x02, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: SetLDOSettingReq + input: + data: + Cmd: 'SetLDOSettingReq' + Device: 'R718PA' + LDOsAltiud: 500 + LDOsPSU: 1800 + output: + fPort: 7 + bytes: [0x03, 0x57, 0x01, 0xF4, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: GetLDOSettingReq + input: + data: + Cmd: 'GetLDOSettingReq' + Device: 'R718PA' + output: + fPort: 7 + bytes: [0x04, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: ORPCalibrateReq + input: + data: + Cmd: 'ORPCalibrateReq' + Device: 'R718PA' + StandORP: 500 + output: + fPort: 7 + bytes: [0x05, 0x57, 0x01, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: PHCalibrateReq + input: + data: + Cmd: 'PHCalibrateReq' + Device: 'R718PA' + StandPH: 1800 + output: + fPort: 7 + bytes: [0x06, 0x57, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: NTUCalibrateReq + input: + data: + Cmd: 'NTUCalibrateReq' + Device: 'R718PA' + StandNTU: 500 + output: + fPort: 7 + bytes: [0x07, 0x57, 0x01, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: SetWireLengthReq + input: + data: + Cmd: 'SetWireLengthReq' + Device: 'R718PA' + Length: 5000 + output: + fPort: 7 + bytes: [0x08, 0x57, 0x01, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: GetWireLengthReq + input: + data: + Cmd: 'GetWireLengthReq' + Device: 'R718PA' + output: + fPort: 7 + bytes: [0x09, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: SetSoilTypeReq + input: + data: + Cmd: 'SetSoilTypeReq' + Device: 'R718PA' + SoildType: 8 + output: + fPort: 7 + bytes: [0x0A, 0x57, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: GetSoilTypeReq + input: + data: + Cmd: 'GetSoilTypeReq' + Device: 'R718PA' + output: + fPort: 7 + bytes: [0x0B, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: SoilCalibrateReq + input: + data: + Cmd: 'SoilCalibrateReq' + Device: 'R718PA' + VWCDelt: 50 + output: + fPort: 7 + bytes: [0x0C, 0x57, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] diff --git a/vendor/netvox/r718pa.yaml b/vendor/netvox/r718pa.yaml new file mode 100644 index 0000000000..133caa9e0c --- /dev/null +++ b/vendor/netvox/r718pa.yaml @@ -0,0 +1,59 @@ +name: R718PA - Wireless Bottom-installed Ultrasonic Liquid Level Sensor +description: The R718PA is a wireless communication device that measures the liquid level with an ultrasonic liquid level sensor. Ultrasonic liquid level sensor installed at the bottom of the container, it may measure water, gasoline, diesel and small, medium, large capacity storage tanks (metal, plastic, glass material). R718PA22 main unit and the ultrasonic liquid level sensor communicate via RS485 interface, and the detected data is sent to the other equipment shown which employs compliance LoraWANTM wireless communication protocol standards. + +hardwareVersions: + - version: '4' + numeric: 4 + +firmwareVersions: + - version: '11' + numeric: 11 + hardwareVersions: + - '4' + + profiles: + EU863-870: + id: profile-eu868 + codec: r718pa-codec + AS923: + id: profile-as923 + codec: r718pa-codec + US902-928: + id: profile-us915 + codec: r718pa-codec + AU915-928: + id: profile-au915 + codec: r718pa-codec + KR920-923: + id: profile-kr920 + codec: r718pa-codec + IN865-867: + id: profile-in865 + codec: r718pa-codec + CN470-510: + id: profile-cn470 + codec: r718pa-codec + +dimensions: + width: 88.19 + length: 112 + height: 32 + +weight: 200 + +operatingConditions: + temperature: + min: -20 + max: 55 + relativeHumidity: + min: 0 + max: 0.9 + +keyProvisioning: + - custom + - join server + +keySecurity: none + +productURL: http://www.netvox.com.tw/product.asp?pro=R718PA +dataSheetURL: http://www.netvox.com.tw/um/R718PA/R718PAdatasheet.pdf diff --git a/vendor/netvox/r718pa4-codec.yaml b/vendor/netvox/r718pa4-codec.yaml new file mode 100644 index 0000000000..7c23301b7c --- /dev/null +++ b/vendor/netvox/r718pa4-codec.yaml @@ -0,0 +1,92 @@ +uplinkDecoder: + fileName: payload/r718pa4.js + examples: + - description: Startup version report + input: + fPort: 6 + bytes: [0x01, 0x57, 0x00, 0x6E, 0x06, 0x20, 0x23, 0x09, 0x11, 0x00, 0x00] + output: + data: + Device: 'R718PA4' + SWver: 11 + HWver: 6 + Datecode: '20230911' + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x57, 0x06, 0x55, 0x09, 0x09, 0x00, 0x10, 0x01, 0x00, 0x00] + output: + data: + Device: 'R718PA4' + Volt: 8.5 + NO2: 231.3 + SO2: 16 + H2S: 25.6 + + - description: Configure report response + input: + fPort: 7 + bytes: [0x81, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportRsp' + Device: 'R718PA4' + Status: 'Success' + + - description: Read configure report response + input: + fPort: 7 + bytes: [0x82, 0x57, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'ReadConfigReportRsp' + Device: 'R718PA4' + MinTime: 900 + MaxTime: 1800 + +downlinkDecoder: + fileName: payload/r718pa4.js + examples: + - description: Configure report request + input: + fPort: 7 + bytes: [0x01, 0x57, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'ConfigReportReq' + Device: 'R718PA4' + MinTime: 900 + MaxTime: 1800 + + - description: Read configure report request + input: + fPort: 7 + bytes: [0x02, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R718PA4' + +downlinkEncoder: + fileName: payload/r718pa4.js + examples: + - description: Configure report request + input: + data: + Cmd: 'ConfigReportReq' + Device: 'R718PA4' + MinTime: 900 + MaxTime: 1800 + output: + fPort: 7 + bytes: [0x01, 0x57, 0x03, 0x84, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: Read configure report request + input: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R718PA4' + output: + fPort: 7 + bytes: [0x02, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] diff --git a/vendor/netvox/r718pa4.yaml b/vendor/netvox/r718pa4.yaml new file mode 100644 index 0000000000..af8c2d052b --- /dev/null +++ b/vendor/netvox/r718pa4.yaml @@ -0,0 +1,59 @@ +name: R718PA4 - Wireless Bottom-installed Ultrasonic Liquid Level Sensor +description: The R718PA4 is a wireless communication device that measures the liquid level with an ultrasonic liquid level sensor. Ultrasonic liquid level sensor installed at the bottom of the container, it may measure water, gasoline, diesel and small, medium, large capacity storage tanks (metal, plastic, glass material). R718PA22 main unit and the ultrasonic liquid level sensor communicate via RS485 interface, and the detected data is sent to the other equipment shown which employs compliance LoraWANTM wireless communication protocol standards. + +hardwareVersions: + - version: '4' + numeric: 4 + +firmwareVersions: + - version: '11' + numeric: 11 + hardwareVersions: + - '4' + + profiles: + EU863-870: + id: profile-eu868 + codec: r718pa4-codec + AS923: + id: profile-as923 + codec: r718pa4-codec + US902-928: + id: profile-us915 + codec: r718pa4-codec + AU915-928: + id: profile-au915 + codec: r718pa4-codec + KR920-923: + id: profile-kr920 + codec: r718pa4-codec + IN865-867: + id: profile-in865 + codec: r718pa4-codec + CN470-510: + id: profile-cn470 + codec: r718pa4-codec + +dimensions: + width: 88.19 + length: 112 + height: 32 + +weight: 200 + +operatingConditions: + temperature: + min: -20 + max: 55 + relativeHumidity: + min: 0 + max: 0.9 + +keyProvisioning: + - custom + - join server + +keySecurity: none + +productURL: http://www.netvox.com.tw/product.asp?pro=R718PA4 +dataSheetURL: http://www.netvox.com.tw/um/R718PA4/R718PA4datasheet.pdf diff --git a/vendor/netvox/r718pb-codec.yaml b/vendor/netvox/r718pb-codec.yaml new file mode 100644 index 0000000000..fe8af8c6b8 --- /dev/null +++ b/vendor/netvox/r718pb-codec.yaml @@ -0,0 +1,567 @@ +uplinkDecoder: + fileName: payload/r718pb.js + examples: + - description: Startup version report + input: + fPort: 6 + bytes: [0x01, 0x58, 0x00, 0x6E, 0x06, 0x20, 0x23, 0x09, 0x11, 0x00, 0x00] + output: + data: + Device: 'R718PB' + SWver: 11 + HWver: 6 + Datecode: '20230911' + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x58, 0x01, 0x77, 0x09, 0x08, 0x00, 0x19, 0x01, 0x00, 0x00] + output: + data: + Device: 'R718PB' + Volt: 11.9 + PM1_0_CF: 2312 + PM2_5_CF: 25 + PM10_CF: 256 + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x58, 0x02, 0x77, 0x09, 0x09, 0x00, 0x10, 0x01, 0x00, 0x00] + output: + data: + Device: 'R718PB' + Volt: 11.9 + PM1_0: 2313 + PM2_5: 16 + PM10: 256 + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x58, 0x03, 0x60, 0x09, 0x09, 0x00, 0x10, 0x01, 0x00, 0x00] + output: + data: + Device: 'R718PB' + Volt: 9.6 + PM0_3UM: 592128 + PM0_5UM: 4097 + PM1_0UM: 0 + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x58, 0x04, 0x60, 0x03, 0x09, 0x00, 0x10, 0x01, 0x00, 0x00] + output: + data: + Device: 'R718PB' + Volt: 9.6 + PM2_5UM: 777 + PM5_0UM: 16 + PM10UM: 256 + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x58, 0x05, 0x60, 0x09, 0x09, 0x00, 0x10, 0x03, 0x02, 0x00] + output: + data: + Device: 'R718PB' + Volt: 9.6 + O3: 231.3 + CO: 1.6 + NO: 77 + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x58, 0x06, 0x55, 0x09, 0x09, 0x00, 0x10, 0x01, 0x00, 0x00] + output: + data: + Device: 'R718PB' + Volt: 8.5 + NO2: 231.3 + SO2: 16 + H2S: 25.6 + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x58, 0x07, 0x60, 0x09, 0x01, 0x00, 0x10, 0x01, 0x00, 0x00] + output: + data: + Device: 'R718PB' + Volt: 9.6 + CO2_0_1: 230.5 + NH3: 1.6 + Noise: 25.6 + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x58, 0x08, 0x60, 0x09, 0x09, 0x00, 0x10, 0x01, 0x00, 0x00] + output: + data: + Device: 'R718PB' + Volt: 9.6 + PH: 23.13 + Tempera: 0.16 + ORP: 256 + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x58, 0x09, 0x60, 0x09, 0x05, 0x00, 0x10, 0x01, 0x00, 0x00] + output: + data: + Device: 'R718PB' + Volt: 9.6 + NTU: 230.9 + Tempera: 0.16 + Soil_VWC: 2.56 + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x58, 0x0A, 0x60, 0x09, 0x09, 0x00, 0x10, 0x01, 0x00, 0x00] + output: + data: + Device: 'R718PB' + Volt: 9.6 + Soil_VWC: 23.13 + Soil_Temp: 0.16 + water: 256 + Soil_EC: 0 + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x58, 0x0B, 0x33, 0x09, 0x09, 0x00, 0x10, 0x01, 0x00, 0x00] + output: + data: + Device: 'R718PB' + Volt: 5.1 + Tempera: 23.13 + LDODO: 0.16 + LDOSat: 25.6 + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x58, 0x0C, 0x60, 0x09, 0x09, 0x00, 0x10, 0x01, 0x00, 0x00] + output: + data: + Device: 'R718PB' + Volt: 9.6 + Tempera: 23.13 + Humidity: 0.16 + WindSpeed: 2.56 + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x58, 0x0D, 0x60, 0x09, 0x09, 0x00, 0x10, 0x01, 0x01, 0x00] + output: + data: + Device: 'R718PB' + Volt: 9.6 + WindDirection: 2313 + Atomsphere: 10488.33 + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x58, 0x0E, 0x60, 0x09, 0x09, 0x00, 0x10, 0x01, 0x00, 0x00] + output: + data: + Device: 'R718PB' + Volt: 9.6 + VOC_0_1: 231.3 + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x58, 0x0F, 0x60, 0x09, 0x09, 0x00, 0x10, 0x01, 0x00, 0x00] + output: + data: + Device: 'R718PB' + Volt: 9.6 + Nitrogen: 2313 + Phosphorus: 16 + Potassium: 256 + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x58, 0x010, 0x60, 0x09, 0x09, 0x00, 0x10, 0x01, 0x00, 0x00] + output: + data: + Device: 'R718PB' + Volt: 9.6 + Soil_VWC: 23.13 + Soil_Temperature: 0.16 + Soli_EC: 0.256 + + - description: Configure report response + input: + fPort: 7 + bytes: [0x81, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportRsp' + Device: 'R718PB' + Status: 'Success' + + - description: Read configure report response + input: + fPort: 7 + bytes: [0x82, 0x58, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'ReadConfigReportRsp' + Device: 'R718PB' + MinTime: 900 + MaxTime: 1800 + + - description: Read configure report response + input: + fPort: 7 + bytes: [0x83, 0x58, 0x00, 0x84, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'SetLDOSettingRsp' + Device: 'R718PB' + Status: 'Success' + + - description: GetLDOSettingRsp + input: + fPort: 7 + bytes: [0x84, 0x58, 0x03, 0x05, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'GetLDOSettingRsp' + Device: 'R718PB' + LDOsAltiud: 773 + LDOsPSU: 1800 + + - description: ORPCalibrateRsp + input: + fPort: 7 + bytes: [0x85, 0x58, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'ORPCalibrateRsp' + Device: 'R718PB' + Status: 'Failure' + + - description: PHCalibrateRsp + input: + fPort: 7 + bytes: [0x86, 0x58, 0x07, 0x84, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'PHCalibrateRsp' + Device: 'R718PB' + Status: 'Failure' + + - description: NTUCalibrateRsp + input: + fPort: 7 + bytes: [0x87, 0x58, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'NTUCalibrateRsp' + Device: 'R718PB' + Status: 'Failure' + + - description: SetWireLengthRsp + input: + fPort: 7 + bytes: [0x88, 0x58, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'SetWireLengthRsp' + Device: 'R718PB' + Status: 'Failure' + + - description: GetWireLengthRsp + input: + fPort: 7 + bytes: [0x89, 0x58, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'GetWireLengthRsp' + Device: 'R718PB' + Length: 900 + + - description: SetSoilTypeRsp + input: + fPort: 7 + bytes: [0x8A, 0x58, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'SetSoilTypeRsp' + Device: 'R718PB' + Status: 'Failure' + + - description: GetSoilTypeRsp + input: + fPort: 7 + bytes: [0x8B, 0x58, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'GetSoilTypeRsp' + Device: 'R718PB' + SoilType: 3 + + - description: SoilCalibrateRsp + input: + fPort: 7 + bytes: [0x8C, 0x58, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'SoilCalibrateRsp' + Device: 'R718PB' + Status: 'Failure' + +downlinkDecoder: + fileName: payload/r718pb.js + examples: + - description: Configure report request + input: + fPort: 7 + bytes: [0x01, 0x58, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'ConfigReportReq' + Device: 'R718PB' + MinTime: 900 + MaxTime: 1800 + + - description: Read configure report request + input: + fPort: 7 + bytes: [0x02, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R718PB' + + - description: SetLDOSettingReq + input: + fPort: 7 + bytes: [0x03, 0x58, 0x04, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetLDOSettingReq' + Device: 'R718PB' + LDOsAltiud: 1024 + LDOsPSU: 768 + + - description: GetLDOSettingReq + input: + fPort: 7 + bytes: [0x04, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetLDOSettingReq' + Device: 'R718PB' + + - description: ORPCalibrateReq + input: + fPort: 7 + bytes: [0x05, 0x58, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ORPCalibrateReq' + Device: 'R718PB' + StandORP: 2048 + + - description: PHCalibrateReq + input: + fPort: 7 + bytes: [0x06, 0x58, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'PHCalibrateReq' + Device: 'R718PB' + StandPH: 1792 + + - description: NTUCalibrateReq + input: + fPort: 7 + bytes: [0x07, 0x58, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'NTUCalibrateReq' + Device: 'R718PB' + StandNTU: 1024 + + - description: SetWireLengthReq + input: + fPort: 7 + bytes: [0x08, 0x58, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetWireLengthReq' + Device: 'R718PB' + Length: 10240 + + - description: GetWireLengthReq + input: + fPort: 7 + bytes: [0x09, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetWireLengthReq' + Device: 'R718PB' + + - description: SetSoilTypeReq + input: + fPort: 7 + bytes: [0x0A, 0x58, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetSoilTypeReq' + Device: 'R718PB' + SoildType: 6 + + - description: GetSoilTypeReq + input: + fPort: 7 + bytes: [0x0B, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetSoilTypeReq' + Device: 'R718PB' + + - description: SoilCalibrateReq + input: + fPort: 7 + bytes: [0x0C, 0x58, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SoilCalibrateReq' + Device: 'R718PB' + VWCDelt: 8% + +downlinkEncoder: + fileName: payload/r718pb.js + examples: + - description: Configure report request + input: + data: + Cmd: 'ConfigReportReq' + Device: 'R718PB' + MinTime: 900 + MaxTime: 1800 + output: + fPort: 7 + bytes: [0x01, 0x58, 0x03, 0x84, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: Read configure report request + input: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R718PB' + output: + fPort: 7 + bytes: [0x02, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: SetLDOSettingReq + input: + data: + Cmd: 'SetLDOSettingReq' + Device: 'R718PB' + LDOsAltiud: 500 + LDOsPSU: 1800 + output: + fPort: 7 + bytes: [0x03, 0x58, 0x01, 0xF4, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: GetLDOSettingReq + input: + data: + Cmd: 'GetLDOSettingReq' + Device: 'R718PB' + output: + fPort: 7 + bytes: [0x04, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: ORPCalibrateReq + input: + data: + Cmd: 'ORPCalibrateReq' + Device: 'R718PB' + StandORP: 500 + output: + fPort: 7 + bytes: [0x05, 0x58, 0x01, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: PHCalibrateReq + input: + data: + Cmd: 'PHCalibrateReq' + Device: 'R718PB' + StandPH: 1800 + output: + fPort: 7 + bytes: [0x06, 0x58, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: NTUCalibrateReq + input: + data: + Cmd: 'NTUCalibrateReq' + Device: 'R718PB' + StandNTU: 500 + output: + fPort: 7 + bytes: [0x07, 0x58, 0x01, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: SetWireLengthReq + input: + data: + Cmd: 'SetWireLengthReq' + Device: 'R718PB' + Length: 5000 + output: + fPort: 7 + bytes: [0x08, 0x58, 0x01, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: GetWireLengthReq + input: + data: + Cmd: 'GetWireLengthReq' + Device: 'R718PB' + output: + fPort: 7 + bytes: [0x09, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: SetSoilTypeReq + input: + data: + Cmd: 'SetSoilTypeReq' + Device: 'R718PB' + SoildType: 8 + output: + fPort: 7 + bytes: [0x0A, 0x58, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: GetSoilTypeReq + input: + data: + Cmd: 'GetSoilTypeReq' + Device: 'R718PB' + output: + fPort: 7 + bytes: [0x0B, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: SoilCalibrateReq + input: + data: + Cmd: 'SoilCalibrateReq' + Device: 'R718PB' + VWCDelt: 50 + output: + fPort: 7 + bytes: [0x0C, 0x58, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] diff --git a/vendor/netvox/r718pb.yaml b/vendor/netvox/r718pb.yaml new file mode 100644 index 0000000000..9b50cb8b0a --- /dev/null +++ b/vendor/netvox/r718pb.yaml @@ -0,0 +1,59 @@ +name: R718PB - Wireless Bottom-installed Ultrasonic Liquid Level Sensor +description: The R718PB is a wireless communication device that measures the liquid level with an ultrasonic liquid level sensor. Ultrasonic liquid level sensor installed at the bottom of the container, it may measure water, gasoline, diesel and small, medium, large capacity storage tanks (metal, plastic, glass material). R718PB main unit and the ultrasonic liquid level sensor communicate via RS485 interface, and the detected data is sent to the other equipment shown which employs compliance LoraWANTM wireless communication protocol standards. + +hardwareVersions: + - version: '4' + numeric: 4 + +firmwareVersions: + - version: '11' + numeric: 11 + hardwareVersions: + - '4' + + profiles: + EU863-870: + id: profile-eu868 + codec: r718pb-codec + AS923: + id: profile-as923 + codec: r718pb-codec + US902-928: + id: profile-us915 + codec: r718pb-codec + AU915-928: + id: profile-au915 + codec: r718pb-codec + KR920-923: + id: profile-kr920 + codec: r718pb-codec + IN865-867: + id: profile-in865 + codec: r718pb-codec + CN470-510: + id: profile-cn470 + codec: r718pb-codec + +dimensions: + width: 88.19 + length: 112 + height: 32 + +weight: 200 + +operatingConditions: + temperature: + min: -20 + max: 55 + relativeHumidity: + min: 0 + max: 0.9 + +keyProvisioning: + - custom + - join server + +keySecurity: none + +productURL: http://www.netvox.com.tw/product.asp?pro=R718PB +dataSheetURL: http://www.netvox.com.tw/um/R718PB/R718PBdatasheet.pdf diff --git a/vendor/netvox/rp02-codec.yaml b/vendor/netvox/rp02-codec.yaml new file mode 100644 index 0000000000..2b199c0f3d --- /dev/null +++ b/vendor/netvox/rp02-codec.yaml @@ -0,0 +1,515 @@ +uplinkDecoder: + fileName: payload/rp02.js + examples: + - description: Startup version report + input: + fPort: 6 + bytes: [0x01, 0x9C, 0x00, 0x6E, 0x06, 0x20, 0x23, 0x09, 0x11, 0x00, 0x00] + output: + data: + Device: 'RP02' + SWver: 11 + HWver: 6 + Datecode: '20230911' + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x9C, 0x01, 0x13, 0x09, 0x08, 0x00, 0x19, 0x01, 0x09, 0x00] + output: + data: + Device: 'RP02' + BreakerRS485Addr: 19 + BreakerType: 9 + BreakerProtectStatusBits_1P: 8 + AlarmStatusBits_1P: 0 + Pre_TripStatusBits_1P: 25 + TripStatusBits_1P: 1 + HandOrAutoControlAndSelfTestStatus: 9 + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x9C, 0x02, 0x13, 0x09, 0x09, 0x00, 0x10, 0x01, 0x08, 0x02] + output: + data: + Device: 'RP02' + BreakerRS485Addr: 19 + Current: 2313 + Voltage: 16 + Power: 264 + Temperature: 2 + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x9C, 0x03, 0x60, 0x00, 0x09, 0x00, 0x10, 0x01, 0x00, 0x00] + output: + data: + Device: 'RP02' + BreakerRS485Addr: 96 + Energy: 589840 + Frequency: 1 + PowerFactor: 0 + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x9C, 0x04, 0x60, 0x03, 0x09, 0x00, 0x10, 0x01, 0x00, 0x00] + output: + data: + Device: 'RP02' + BreakerRS485Addr: 96 + LeakageCurrent: 777 + OnOffTotalCount: 1048832 + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x9C, 0x11, 0x60, 0x09, 0x09, 0x00, 0x10, 0x03, 0x02, 0x00] + output: + data: + Device: 'RP02' + BreakerRS485Addr: 96 + BreakerTYpe: 9 + BreakerProtectStatusBits: 2304 + AlarmStatusBits: 4099 + PreTripStatusBits: 512 + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x9C, 0x12, 0x55, 0x09, 0x09, 0x00, 0x10, 0x01, 0x00, 0x00] + output: + data: + Device: 'RP02' + BreakerRS485Addr: 85 + TripStatusBits: 2313 + APhaseCurrent: 160 + BphaseCurrent: 2560 + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x9C, 0x13, 0x60, 0x09, 0x01, 0x00, 0x10, 0x01, 0x00, 0x00] + output: + data: + Device: 'RP02' + BreakerRS485Addr: 96 + CPhaseCurrent: 23050 + AphaseVoltage: 16 + BPhaseVoltage: 256 + Temperature: 0 + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x9C, 0x14, 0x60, 0x09, 0x09, 0x00, 0x10, 0x01, 0x00, 0x00] + output: + data: + Device: 'RP02' + BreakerRS485Addr: 96 + CPhaseVoltage: 2313 + APhasePower: 16 + BPhasePower: 256 + Frequency: 0 + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x9C, 0x15, 0x60, 0x09, 0x05, 0x00, 0x10, 0x01, 0x00, 0x00] + output: + data: + Device: 'RP02' + BreakerRS485Addr: 96 + CPhasePower: 2309 + APhaseEnergy: 1048832 + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x9C, 0x16, 0x60, 0x00, 0x09, 0x00, 0x10, 0x01, 0x00, 0x00] + output: + data: + Device: 'RP02' + BreakerRS485Addr: 96 + BPhaseEnergy: 589840 + APhasePowerFactor: 1 + CPhasePowerFactor: 0 + BPhasePowerFactor: 0 + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x9C, 0x17, 0x33, 0x00, 0x08, 0x00, 0x00, 0x01, 0x00, 0x00] + output: + data: + Device: 'RP02' + BreakerRS485Addr: 51 + CPhaseEnergy: 524288 + HandOrAutoControlStatus: 1 + OnOffStatus: 'Off' + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x9C, 0x18, 0x60, 0x09, 0x09, 0x00, 0x10, 0x01, 0x00, 0x00] + output: + data: + Device: 'RP02' + BreakerRS485Addr: 96 + LeakageCurrent: 2313 + OnOffTotalCount: 1048832 + + - description: Configure report response + input: + fPort: 7 + bytes: [0x81, 0x9C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportRsp' + Device: 'RP02' + Status: 'Success' + + - description: Read configure report response + input: + fPort: 7 + bytes: [0x82, 0x9C, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'ReadConfigReportRsp' + Device: 'RP02' + MinTime: 900 + MaxTime: 1800 + + - description: SetPassThroughModeRsq + input: + fPort: 7 + bytes: [0x83, 0x9C, 0x00, 0x84, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'SetPassThroughModeRsq' + Device: 'RP02' + Status: 'Success' + + - description: GetPassThroughModeRsq + input: + fPort: 7 + bytes: [0x84, 0x9C, 0x03, 0x05, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'GetPassThroughModeRsq' + Device: 'RP02' + PassThroughModeOn: 3 + + - description: SetProtectionRsp + input: + fPort: 7 + bytes: [0x85, 0x9C, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'SetProtectionRsp' + Device: 'RP02' + Status: 'Failure' + + - description: GetTripCntRsq + input: + fPort: 7 + bytes: [0x86, 0x9C, 0x07, 0x04, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'GetTripCntRsq' + Device: 'RP02' + OverLoadTripCnt: 7 + ShortCircuitTripCnt: 4 + LeakageCurrentTripCnt: 7 + UnderVoltagetTripCnt: 8 + OverVoltagetTripCnt: 1 + TemperaturetTripCnt: 0 + RemoteSelfTesttTripCnt: 20 + LeakingPhaseTripCnt: 1 + + - description: GetAlarmInfoRsq(For 1P) + input: + fPort: 7 + bytes: [0x87, 0x9C, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'GetAlarmInfoRsq(For 1P)' + Device: 'RP02' + AlarmCurrent: 900 + AlarmLeakageCurrent: 1800 + AlarmVoltage: 256 + AlarmTemperature: 20 + + - description: GetAlarmInfoRsp1(For 3P) + input: + fPort: 7 + bytes: [0x88, 0x9C, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'GetAlarmInfoRsp1(For 3P)' + Device: 'RP02' + AlarmAPhaseCurrent: 900 + AlarmBPhaseCurrent: 1800 + AlarmCPhaseCurrent: 256 + AlarmHPhaseCurrent: 5121 + + - description: GetAlarmInfoRsp2(For 3P) + input: + fPort: 7 + bytes: [0x89, 0x9C, 0x03, 0x84, 0x07, 0x08, 0x01, 0x01, 0x14, 0x03, 0x00] + output: + data: + Cmd: 'GetAlarmInfoRsp2(For 3P)' + Device: 'RP02' + AlarmLeakageCurrent: 900 + AlarmAPhaseVoltage: 1800 + AlarmBPhaseVoltage: 257 + AlarmCPhaseVoltage: 5123 + + - description: GetAlarmInfoRsp3(For 3P) + input: + fPort: 7 + bytes: [0x8A, 0x9C, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'GetAlarmInfoRsp3(For 3P)' + Device: 'RP02' + AlarmTemperature: 3 + + - description: OffCmd + input: + fPort: 7 + bytes: [0x90, 0x9C, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'Off' + Device: 'RP02' + BreakerRS485Addr: 3 + + - description: OnCmd + input: + fPort: 7 + bytes: [0x91, 0x9C, 0x07, 0x84, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'On' + Device: 'RP02' + BreakerRS485Addr: 7 + + - description: Off(Cant manually On After Off) + input: + fPort: 7 + bytes: [0x92, 0x9C, 0x14, 0x84, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'Off(Cant manually On After Off)' + Device: 'RP02' + BreakerRS485Addr: 20 + + - description: ClearEnergy + input: + fPort: 7 + bytes: [0x93, 0x9C, 0x11, 0x84, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'ClearEnergy' + Device: 'RP02' + BreakerRS485Addr: 17 + + - description: ResetToFactory + input: + fPort: 7 + bytes: [0x94, 0x9C, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'ResetToFactory' + Device: 'RP02' + BreakerRS485Addr: 3 + + - description: LeakageCurrentSeftTest + input: + fPort: 7 + bytes: [0x95, 0x9C, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'LeakageCurrentSeftTest' + Device: 'RP02' + BreakerRS485Addr: 3 + + - description: ClearError/AlarmLog + input: + fPort: 7 + bytes: [0x96, 0x9C, 0x07, 0x84, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'ClearError/AlarmLog' + Device: 'RP02' + BreakerRS485Addr: 7 + +downlinkDecoder: + fileName: payload/rp02.js + examples: + - description: Configure report request + input: + fPort: 7 + bytes: [0x01, 0x9C, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'ConfigReportReq' + Device: 'RP02' + MinTime: 900 + MaxTime: 1800 + + - description: Read configure report request + input: + fPort: 7 + bytes: [0x02, 0x9C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigReportReq' + Device: 'RP02' + + - description: SetPassThroughModeReq + input: + fPort: 7 + bytes: [0x03, 0x9C, 0x04, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetPassThroughModeReq' + Device: 'RP02' + PassThroughModeOn: 4 + + - description: GetPassThroughModeReq + input: + fPort: 7 + bytes: [0x04, 0x9C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetPassThroughModeReq' + Device: 'RP02' + + - description: SetProtectionRep + input: + fPort: 7 + bytes: [0x05, 0x9C, 0x08, 0x10, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetProtectionRep' + Device: 'RP02' + BreakerRS485Addr: 8 + ProtectionType: 16 + ProtectionAction: 17 + + - description: GetTripCntReq + input: + fPort: 7 + bytes: [0x06, 0x9C, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetTripCntReq' + Device: 'RP02' + + - description: GetAlarmInfoReq(For 1P) + input: + fPort: 7 + bytes: [0x07, 0x9C, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetAlarmInfoReq(For 1P)' + Device: 'RP02' + + - description: GetAlarmInfoRep(For 3P) + input: + fPort: 7 + bytes: [0x08, 0x9C, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetAlarmInfoRep(For 3P)' + Device: 'RP02' + BreakerRS485Addr: 20 + +downlinkEncoder: + fileName: payload/rp02.js + examples: + - description: Configure report request + input: + data: + Cmd: 'ConfigReportReq' + Device: 'RP02' + MinTime: 900 + MaxTime: 1800 + output: + fPort: 7 + bytes: [0x01, 0x9C, 0x03, 0x84, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: Read configure report request + input: + data: + Cmd: 'ReadConfigReportReq' + Device: 'RP02' + output: + fPort: 7 + bytes: [0x02, 0x9C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: SetPassThroughModeReq + input: + data: + Cmd: 'SetPassThroughModeReq' + Device: 'RP02' + PassThroughModeOn: 5 + output: + fPort: 7 + bytes: [0x03, 0x9C, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: GetPassThroughModeReq + input: + data: + Cmd: 'GetPassThroughModeReq' + Device: 'RP02' + output: + fPort: 7 + bytes: [0x04, 0x9C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: SetProtectionRep + input: + data: + Cmd: 'SetProtectionRep' + Device: 'RP02' + BreakerRS485Addr: 20 + ProtectionType: 50 + ProtectionAction: 16 + output: + fPort: 7 + bytes: [0x05, 0x9C, 0x14, 0x32, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: GetTripCntReq + input: + data: + Cmd: 'GetTripCntReq' + Device: 'RP02' + PassThroughModeOn: 32 + output: + fPort: 7 + bytes: [0x06, 0x9C, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: GetAlarmInfoReq(For 1P) + input: + data: + Cmd: 'GetAlarmInfoReq(For 1P)' + Device: 'RP02' + PassThroughModeOn: 50 + output: + fPort: 7 + bytes: [0x07, 0x9C, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: GetAlarmInfoRep(For 3P) + input: + data: + Cmd: 'GetAlarmInfoRep(For 3P)' + Device: 'RP02' + PassThroughModeOn: 55 + output: + fPort: 7 + bytes: [0x08, 0x9C, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] diff --git a/vendor/netvox/rp02.yaml b/vendor/netvox/rp02.yaml new file mode 100644 index 0000000000..589189b2b1 --- /dev/null +++ b/vendor/netvox/rp02.yaml @@ -0,0 +1,59 @@ +name: RP02 - Wireless Bottom-installed Ultrasonic Liquid Level Sensor +description: The RP02 is a wireless communication device that measures the liquid level with an ultrasonic liquid level sensor. Ultrasonic liquid level sensor installed at the bottom of the container, it may measure water, gasoline, diesel and small, medium, large capacity storage tanks (metal, plastic, glass material). RP0222 main unit and the ultrasonic liquid level sensor communicate via RS485 interface, and the detected data is sent to the other equipment shown which employs compliance LoraWANTM wireless communication protocol standards. + +hardwareVersions: + - version: '4' + numeric: 4 + +firmwareVersions: + - version: '11' + numeric: 11 + hardwareVersions: + - '4' + + profiles: + EU863-870: + id: profile-eu868 + codec: rp02-codec + AS923: + id: profile-as923 + codec: rp02-codec + US902-928: + id: profile-us915 + codec: rp02-codec + AU915-928: + id: profile-au915 + codec: rp02-codec + KR920-923: + id: profile-kr920 + codec: rp02-codec + IN865-867: + id: profile-in865 + codec: rp02-codec + CN470-510: + id: profile-cn470 + codec: rp02-codec + +dimensions: + width: 88.19 + length: 112 + height: 32 + +weight: 200 + +operatingConditions: + temperature: + min: -20 + max: 55 + relativeHumidity: + min: 0 + max: 0.9 + +keyProvisioning: + - custom + - join server + +keySecurity: none + +productURL: http://www.netvox.com.tw/product.asp?pro=RP02 +dataSheetURL: http://www.netvox.com.tw/um/RP02/RP02datasheet.pdf