diff --git a/vendor/netvox/index.yaml b/vendor/netvox/index.yaml old mode 100755 new mode 100644 index d58d385898..4858c22b8d --- a/vendor/netvox/index.yaml +++ b/vendor/netvox/index.yaml @@ -30,7 +30,10 @@ endDevices: - r31508 - r31509 - r31510 + - r315la - r602a + - r602b + - r603 - r711 - r711a - r718a @@ -38,6 +41,12 @@ endDevices: - r718ad - r718b - r718b2 + - r718ce + - r718ce2 + - r718ce4 + - r718cj + - r718cj2 + - r718cj4 - r718ck - r718ck2 - r718cn @@ -51,6 +60,7 @@ endDevices: - r718e - r718ea - r718eb + - r718ec - r718f - r718f2 - r718g @@ -64,6 +74,7 @@ endDevices: - r718j2 - r718ka - r718ka2 + - r718kb - r718lb - r718lb2 - r718ma @@ -81,6 +92,8 @@ endDevices: - r718pa22 - r718pe - r718pb + - r718pb15a + - r718pc - r718q - r718qa - r718t2 @@ -107,6 +120,7 @@ endDevices: - r72615a - r72616 - r72616a + - r72632a01 - r72716 - r730ck2 - r730ct2 @@ -119,8 +133,26 @@ endDevices: - r831b - r831c - r831d + - r900a01 + - r900a01o1 + - r900a02 + - r900a02o1 + - r900a03 + - r900a03o1 + - r900nac1 + - r900nac3 + - r900nac6 + - r900ndc + - r900pb02 + - r900pb02o1 + - r900pb03 + - r900pb03o1 + - r900pd01 + - r900pd01o1 - ra02a - ra02c + - ra02d1 + - ra02g - ra07w - ra0715 - ra0715y diff --git a/vendor/netvox/payload/r211.js b/vendor/netvox/payload/r211.js index 14b0f0ab64..2d0298f1eb 100755 --- a/vendor/netvox/payload/r211.js +++ b/vendor/netvox/payload/r211.js @@ -131,6 +131,17 @@ function decodeUplink(input) { data: data, }; } + if (input.bytes[2] === 0x80) + { + 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, + }; + } case 0x21: data.Cmd = getCmd(input.bytes[0]); diff --git a/vendor/netvox/payload/r315.js b/vendor/netvox/payload/r315.js index 57d7e4d599..c62eedf51b 100755 --- a/vendor/netvox/payload/r315.js +++ b/vendor/netvox/payload/r315.js @@ -101,9 +101,67 @@ function decodeUplink(input) { data.Humi = input.bytes[10]*0.5; } } - else if (input.bytes[2] == 0x02) - data.Illuminance = (input.bytes[4]<<8 | input.bytes[5]); - + else if (input.bytes[2] == 0x02){ + data.Illuminance = (input.bytes[4]<<8 | input.bytes[5])+"Lux"; + data.LowTemperatureAlarm = input.bytes[6] & 1; + data.HighTemperatureAlarm = input.bytes[6]>>1 & 1; + data.LowHumidityAlarm = input.bytes[6]>>2 & 1; + data.HighHumidityAlarm = input.bytes[6]>>3 & 1; + data.LowIlluminanceAlarm = input.bytes[6]>>4 & 1; + data.HighIlluminanceAlarm = input.bytes[6]>>5 & 1; + } + else if(input.bytes[2] == 0x011){ + let FunctionEnable = (input.bytes[5]<<8 |input.bytes[6]); + data.THSensor = FunctionEnable & 1; + data.LightSensor = FunctionEnable>>1 & 1; + data.PIRSensor = FunctionEnable>>2 & 1; + data.EmergenceButton = FunctionEnable>>3 & 1; + data.TiltSensor = FunctionEnable>>4 & 1; + data.InternalContactSwitch = FunctionEnable>>5 & 1; + data.ExternalContactSwitch1 = FunctionEnable>>6 & 1; + data.ExternalContactSwitch2 = FunctionEnable>>7 & 1; + data.InternalShockSensor = FunctionEnable>>8 & 1; + data.ExternalShockSensor = FunctionEnable>>9 & 1; + data.ExternalDryContactPointIN = FunctionEnable>>10 & 1; + data.DryContactPointOut = FunctionEnable>>11 & 1; + data.ExternalWaterLeakSenor1 = FunctionEnable>>12 & 1; + data.ExternalWaterLeakSenor2 = FunctionEnable>>13 & 1; + data.ExternalSeatSensor = FunctionEnable>>14 & 1; + data.ExternalGlassSensor1 = FunctionEnable>>15 & 1; + data.ExternalGlassSensor2 = input.bytes[4]& 1; + + let BinarySensorReport = (input.bytes[7]<<8 | input.bytes[8]); + data.PIRSensorState = BinarySensorReport & 1; + data.EmergenceButtonaLAlarmState = BinarySensorReport>>1 & 1; + data.TiltSensorState = BinarySensorReport>>2 & 1; + data.InternalContactSwitchSensorState = BinarySensorReport>>3 & 1; + data.ExternalContactSwitch1SensorState = BinarySensorReport>>4 & 1; + data.ExternalContactSwitch2SensorState = BinarySensorReport>>5 & 1; + data.InternalShockSensorState = BinarySensorReport>>6 & 1; + data.ExternalShockSensorState = BinarySensorReport>>7 & 1; + data.ExternalDryContactPointINState = BinarySensorReport>>8 & 1; + data.ExternalWaterLeak1SenorState = BinarySensorReport>>9 & 1; + data.ExternalWaterLeak2SenorState = BinarySensorReport>>10 & 1; + data.ExternalSeatSenorState = BinarySensorReport>>11 & 1; + data.ExternalGlassSenor1State = BinarySensorReport>>12 & 1; + data.ExternalGlassSenor2State = BinarySensorReport>>13 & 1; + } + else if(input.bytes[2] == 0x12){ + if (input.bytes[4] & 0x80){ + var tmpval = (input.bytes[4]<<8 | input.bytes[5]); + data.Temp = (0x10000 - tmpval)/100 * -1; + }else{ + data.Temp = (input.bytes[4]<<8 | input.bytes[5])/100; + } + data.Humidity = (input.bytes[6]<<8 | input.bytes[7])*0.01 +"%"; + data.Illuminance = (input.bytes[8]<<8 | input.bytes[9])+"Lux"; + data.LowTemperatureAlarm = input.bytes[10] & 1; + data.HighTemperatureAlarm = input.bytes[10]>>1 & 1; + data.LowHumidityAlarm = input.bytes[10]>>2 & 1; + data.HighHumidityAlarm = input.bytes[10]>>3 & 1; + data.LowIlluminanceAlarm = input.bytes[10]>>4 & 1; + data.HighIlluminanceAlarm = input.bytes[10]>>5 & 1; + } break; case 7: diff --git a/vendor/netvox/payload/r315la.js b/vendor/netvox/payload/r315la.js new file mode 100755 index 0000000000..e2c220b957 --- /dev/null +++ b/vendor/netvox/payload/r315la.js @@ -0,0 +1,184 @@ +function getCfgCmd(cfgcmd){ + var cfgcmdlist = { + 1: "ConfigReportReq", + 129: "ConfigReportRsp", + 2: "ReadConfigReportReq", + 130: "ReadConfigReportRsp", + 3: "SetOnDistanceThresholdRreq", + 131: "SetOnDistanceThresholdRrsq", + 4: "GetOnDistanceThresholdRreq", + 132: "GetOnDistanceThresholdRrsp", + }; + return cfgcmdlist[cfgcmd]; +} + +function getCmdToID(cmdtype){ + if (cmdtype == "ConfigReportReq") + return 1; + else if (cmdtype == "ConfigReportRsp") + return 129; + else if (cmdtype == "ReadConfigReportReq") + return 2; + else if (cmdtype == "ReadConfigReportRsp") + return 130; + else if (cmdtype == "SetOnDistanceThresholdRreq") + return 3; + else if (cmdtype == "SetOnDistanceThresholdRrsq") + return 131; + else if (cmdtype == "GetOnDistanceThresholdRreq") + return 4; + else if (cmdtype == "GetOnDistanceThresholdRrsp") + return 132; +} + +function getDeviceName(dev){ + var deviceName = { + 221: "R315LA" + }; + return deviceName[dev]; +} + +function getDeviceID(devName){ + var deviceName = { + "R315LA": 221 + }; + 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; + + data.VModbusID = input.bytes[4]; + data.Status = (input.bytes[5] == 0x00) ? 'Off' : 'On'; + data.Distance = (input.bytes[6]<<8 | input.bytes[7])+"mm"; + data.LowDistanceAlarm = input.bytes[8] & 1; + data.HightDistanceAlarm = input.bytes[8]>>1 & 1; + break; + + case 7: + data.Cmd = getCfgCmd(input.bytes[0]); + data.Device = getDeviceName(input.bytes[1]); + + if ((input.bytes[0] === getCmdToID("ConfigReportRsp")) + || (input.bytes[0] === getCmdToID("SetOnDistanceThresholdRrsq"))) + { + 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]); + data.BatteryChange = input.bytes[6]/10; + data.DistanceChange = (input.bytes[7]<<8 | input.bytes[8])+"mm" + } + else if (input.bytes[0] === getCmdToID("GetOnDistanceThresholdRrsp")) + { + data.OnDistanceThreshold = (input.bytes[2]<<8 | input.bytes[3])+"mm"; + } + + 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; + var battery = input.data.BatteryChange*10; + var distance = input.data.DistanceChange; + ret = ret.concat(getCmdID, devid, (mint >> 8), (mint & 0xFF), (maxt >> 8), (maxt & 0xFF), battery, (distance >> 8), (distance & 0xFF), 0x00, 0x00); + } + else if (input.data.Cmd == "SetOnDistanceThresholdRreq") + { + var onDistanceThreshold = input.data.OnDistanceThreshold; + ret = ret.concat(getCmdID, devid, (onDistanceThreshold >> 8), (onDistanceThreshold & 0xFF), 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + } + else if ((input.data.Cmd == "ReadConfigReportReq") + || (input.data.Cmd == "GetOnDistanceThresholdRreq")) + { + 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]); + data.BatteryChange = input.bytes[6]/10; + data.DistanceChange = (input.bytes[7]<<8 | input.bytes[8])+"mm" + } + else if (input.bytes[0] === getCmdToID("SetOnDistanceThresholdRreq")) + { + data.OnDistanceThreshold = (input.bytes[2]<<8 | input.bytes[3])+"mm"; + } + break; + + default: + return { + errors: ['invalid FPort'], + }; + } + + return { + data: data, + }; +} diff --git a/vendor/netvox/payload/r602b.js b/vendor/netvox/payload/r602b.js new file mode 100755 index 0000000000..16ce115ce8 --- /dev/null +++ b/vendor/netvox/payload/r602b.js @@ -0,0 +1,171 @@ +function getCfgCmd(cfgcmd){ + var cfgcmdlist = { + 1: "ConfigReportReq", + 129: "ConfigReportRsp", + 2: "ReadConfigReportReq", + 130: "ReadConfigReportRsp", + 3: "StartWarningWithAckReq", + 131: "StartWarningWithAckRsp", + 144: "StartWarning" + }; + return cfgcmdlist[cfgcmd]; +} + +function getDeviceName(dev){ + var deviceName = { + 105: "R602B" + }; + return deviceName[dev]; +} + +function getCmdToID(cmdtype){ + if (cmdtype == "ConfigReportReq") + return 1; + else if (cmdtype == "ConfigReportRsp") + return 129; + else if (cmdtype == "ReadConfigReportReq") + return 2; + else if (cmdtype == "ReadConfigReportRsp") + return 130; + else if (cmdtype == "StartWarningWithAckReq") + return 3; + else if (cmdtype == "StartWarningWithAckRsp") + return 131; + else if (cmdtype == "StartWarning") + return 144; +} + +function getDeviceID(devName){ + if (devName == "R602B") + return 105; +} + +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.HeartBeatTime = (input.bytes[3]<<8 | input.bytes[4]); + data.WarningStatus = (input.bytes[5] === 0x00) ? 'No warning' : 'Warning'; + if (input.bytes[6] & 0x80) + { + var tmp_v = input.bytes[6] & 0x7F; + data.Battery = (tmp_v / 10).toString() + '(low battery)'; + } + else + data.Battery = input.bytes[6]/10; + + + break; + + case 7: + data.Cmd = getCfgCmd(input.bytes[0]); + data.Device = getDeviceName(input.bytes[1]); + if ((input.bytes[0] === getCmdToID("ConfigReportRsp")) || (input.bytes[0] === getCmdToID("StartWarningWithAckRsp"))) + { + 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); + } + else if ((input.data.Cmd == "StartWarningWithAckReq") || (input.data.Cmd == "StartWarning")) + { + var warning_mode = input.data.WarningMode; + var strobe_mode = input.data.StrobeMode; + var warning_dur = input.data.WarningDuration; + ret = ret.concat(getCmdID, devid, warning_mode, strobe_mode, (warning_dur >> 8), (warning_dur & 0xFF), 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("StartWarningWithAckReq")) || (input.bytes[0] === getCmdToID("StartWarning"))) + { + data.WarningMode = input.bytes[2]; + data.StrobeMode = input.bytes[3]; + data.WarningDuration = (input.bytes[4]<<8 | input.bytes[5]); + } + + break; + + default: + return { + errors: ['invalid FPort'], + }; + } + + return { + data: data, + }; +} \ No newline at end of file diff --git a/vendor/netvox/payload/r603.js b/vendor/netvox/payload/r603.js new file mode 100755 index 0000000000..fbc7d41597 --- /dev/null +++ b/vendor/netvox/payload/r603.js @@ -0,0 +1,316 @@ +function getCfgCmd(cfgcmd){ + var cfgcmdlist = { + 1: "ConfigReportReq", + 129: "ConfigReportRsp", + 2: "ReadConfigReportReq", + 130: "ReadConfigReportRsp", + 3: "StartSirenReq", + + 4: "SetPeriodSirenReq", + 132: "SetPeriodSirenRsp", + 5: "GetPeriodSirenReq", + 133: "GetPeriodSirenRsp", + 6: "StopPeriodSirenReq", + 134: "StopPeriodSirenRsp", + 7: "SetLEDColorReq", + 135: "SetLEDColorRsp", + 8: "GetLEDColorReq", + 136: "GetLEDColorRsp", + 9: "SetContactSwitchTriggerAlarmReq", + 137: "SetContactSwitchTriggerAlarmRsp", + 10: "GetContactSwitchTriggerAlarmReq", + 138: "GetContactSwitchTriggerAlarmRsp", + }; + return cfgcmdlist[cfgcmd]; +} + +function getCmdToID(cmdtype){ + if (cmdtype == "ConfigReportReq") + return 1; + else if (cmdtype == "ConfigReportRsp") + return 129; + else if (cmdtype == "ReadConfigReportReq") + return 2; + else if (cmdtype == "ReadConfigReportRsp") + return 130; + else if (cmdtype == "StartSirenReq") + return 3; + + else if (cmdtype == "SetPeriodSirenReq") + return 4; + else if (cmdtype == "SetPeriodSirenRsp") + return 132; + else if (cmdtype == "GetPeriodSirenReq") + return 5; + else if (cmdtype == "GetPeriodSirenRsp") + return 133; + else if (cmdtype == "StopPeriodSirenReq") + return 6; + else if (cmdtype == "StopPeriodSirenRsp") + return 134; + else if (cmdtype == "SetLEDColorReq") + return 7; + else if (cmdtype == "SetLEDColorRsp") + return 135; + else if (cmdtype == "GetLEDColorReq") + return 8; + else if (cmdtype == "GetLEDColorRsp") + return 136; + else if (cmdtype == "SetContactSwitchTriggerAlarmReq") + return 9; + else if (cmdtype == "SetContactSwitchTriggerAlarmRsp") + return 137; + else if (cmdtype == "GetContactSwitchTriggerAlarmReq") + return 10; + else if (cmdtype == "GetContactSwitchTriggerAlarmRsp") + return 138; +} + +function getDeviceName(dev){ + var deviceName = { + 222: "R603" + }; + return deviceName[dev]; +} + +function getDeviceID(devName){ + var deviceName = { + "R603": 222 + }; + return deviceName[devName]; +} +function getSirenNoType(id){ + var type = { + 0X00:"EmergencyMode", + 0X01:"Doorbel", + 0X02:"Burglar", + 0X03:"FireMode", + 0X04:"Help", + 0X05:"No Smoking", + 0X06:"Poor Air Quality", + 0X07:"The temperature is too high", + 0X08:"Thief", + 0X09:"Welcome" + }; + return type[id]; +} +function getSirenNoTypeByName(name){ + var typeList = { + "EmergencyMode":0X00, + "Doorbel":0X01, + "Burglar":0X02, + "FireMode":0X03, + "Help":0X04, + "No Smoking":0X05, + "Poor Air Quality":0X06, + "The temperature is too high":0X07, + "Thief":0X08, + "Welcome":0X09 + }; + return typeList[name]; +} +function getStrobeModeType(id){ + var type = { + 0X00:"NoLedIndication", + 0X01:"LedBlinkMode1 in Parallel to Warning", + 0X02:"LedBlinkMode2 in Parallel to Warning" + }; + return type[id]; +} +function getStrobeModeTypeByName(name){ + var typeList = { + "NoLedIndication":0X00, + "LedBlinkMode1 in Parallel to Warning":0X01, + "LedBlinkMode2 in Parallel to Warning":0X02 + }; + return typeList[name]; +} +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; + + data.WarningStatus = (input.bytes[4] == 0x00) ? 'NoWarnring' : 'Warning'; + data.DCPowerFailureAlarm = (input.bytes[6] == 0x00) ? 'NoWarnring' : 'Warning'; + break; + + case 7: + data.Cmd = getCfgCmd(input.bytes[0]); + data.Device = getDeviceName(input.bytes[1]); + + if ((input.bytes[0] === getCmdToID("ConfigReportRsp")) + || (input.bytes[0] === getCmdToID("SetPeriodSirenRsp")) + || (input.bytes[0] === getCmdToID("StopPeriodSirenRsp")) + || (input.bytes[0] === getCmdToID("SetLEDColorRsp")) + || (input.bytes[0] === getCmdToID("SetContactSwitchTriggerAlarmRsp"))) + { + 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]); + } + else if (input.bytes[0] === getCmdToID("GetPeriodSirenRsp")) + { + data.SirenNo = getSirenNoType(input.bytes[2]); + data.SirenLevel = input.bytes[3]; + data.StrobeMode = getStrobeModeType(input.bytes[4]); + data.Duration = (input.bytes[5]<<8 | input.bytes[6]); + data.PeriodTime = (input.bytes[7]<<8 | input.bytes[8]); + } + else if (input.bytes[0] === getCmdToID("GetLEDColorRsp")) + { + data.Red = input.bytes[2]; + data.Green = input.bytes[3]; + data.Blue = input.bytes[4]; + } + else if (input.bytes[0] === getCmdToID("GetContactSwitchTriggerAlarmRsp")) + { + data.SirenNo = getSirenNoType(input.bytes[2]); + data.SirenLevel = input.bytes[3]; + data.StrobeMode = getStrobeModeType(input.bytes[4]); + data.Duration = (input.bytes[5]<<8 | input.bytes[6]); + } + + 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 == "GetPeriodSirenReq") + || (input.data.Cmd == "StopPeriodSirenReq") + || (input.data.Cmd == "GetLEDColorReq")) + { + ret = ret.concat(getCmdID, devid, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + } + else if ((input.data.Cmd == "StartSirenReq") + || (input.data.Cmd == "SetContactSwitchTriggerAlarmReq") ) + { + var sirenNo = getSirenNoTypeByName(input.data.SirenNo); + var siren = input.data.SirenLevel; + var strobeMode = getStrobeModeTypeByName(input.data.StrobeMode); + var duration = input.data.Duration; + ret = ret.concat(getCmdID, devid, sirenNo, siren, strobeMode, (duration >> 8), (duration & 0xFF), 0x00, 0x00, 0x00, 0x00); + } + else if ((input.data.Cmd == "SetPeriodSirenReq") ) + { + var sirenNo = getSirenNoTypeByName(input.data.SirenNo); + var siren = input.data.SirenLevel; + var strobeMode = getStrobeModeTypeByName(input.data.StrobeMode); + var duration = input.data.Duration; + var periodTime = input.data.PeriodTime; + ret = ret.concat(getCmdID, devid, sirenNo, siren, strobeMode,(duration >> 8), (duration & 0xFF), (periodTime >> 8), (periodTime & 0xFF), 0x00, 0x00); + } + else if ((input.data.Cmd == "SetLEDColorReq") ) + { + var red = input.data.Red; + var green = input.data.Green; + var blue = input.data.Blue; + ret = ret.concat(getCmdID, devid, red, green, blue, 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("StartSirenReq")) + ||(input.bytes[0] === getCmdToID("SetContactSwitchTriggerAlarmReq"))) + { + data.SirenNo= getSirenNoType(input.bytes[2]); + data.SirenLevel=input.bytes[3]; + data.StrobeMode=getStrobeModeType(input.bytes[4]) + data.Duration=(input.bytes[5]<<8 | input.bytes[6]); + } + else if (input.bytes[0] === getCmdToID("SetPeriodSirenReq")) + { + data.SirenNo= getSirenNoType(input.bytes[2]); + data.SirenLevel=input.bytes[3]; + data.StrobeMode=getStrobeModeType(input.bytes[4]) + data.Duration=(input.bytes[5]<<8 | input.bytes[6]); + data.PeriodTime=(input.bytes[7]<<8 | input.bytes[8]); + } + else if (input.bytes[0] === getCmdToID("SetLEDColorReq")) + { + data.Red= input.bytes[2]; + data.Green=input.bytes[3]; + data.Blue=input.bytes[4]; + } + break; + + default: + return { + errors: ['invalid FPort'], + }; + } + + return { + data: data, + }; +} diff --git a/vendor/netvox/payload/r718ce.js b/vendor/netvox/payload/r718ce.js new file mode 100644 index 0000000000..e3931eb6b7 --- /dev/null +++ b/vendor/netvox/payload/r718ce.js @@ -0,0 +1,208 @@ +function getCfgCmd(cfgcmd){ + var cfgcmdlist = { + 1: "ConfigReportReq", + 129: "ConfigReportRsp", + 2: "ReadConfigReportReq", + 130: "ReadConfigReportRsp", + 3: "SetThermocoupleTypeReq", + 131: "SetThermocoupleTypeRsp", + 4: "GetThermocoupleTypeReq", + 132: "GetThermocoupleTypeRsp" + }; + return cfgcmdlist[cfgcmd]; +} + +function getDeviceName(dev){ + var deviceName = { + 148: "R718CE" + }; + return deviceName[dev]; +} + +function getCmdToID(cmdtype){ + if (cmdtype == "ConfigReportReq") + return 1; + else if (cmdtype == "ConfigReportRsp") + return 129; + else if (cmdtype == "ReadConfigReportReq") + return 2; + else if (cmdtype == "ReadConfigReportRsp") + return 130; + else if (cmdtype == "SetThermocoupleTypeReq") + return 3; + else if (cmdtype == "SetThermocoupleTypeRsp") + return 131; + else if (cmdtype == "GetThermocoupleTypeReq") + return 4; + else if (cmdtype == "GetThermocoupleTypeRsp") + return 132; +} + +function getDeviceType(devName){ + if (devName == "R718CE") + return 148; +} + +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, + }; + } + + if (input.bytes[3] & 0x80) { + var tmp_v = input.bytes[3] & 0x7F; + // 解析电压:高4位为整数部分,低4位为小数部分 + var intPart = (tmp_v >> 4) & 0x0F; + var decPart = tmp_v & 0x0F; + data.Volt = (intPart + decPart / 10).toString() + '(low battery)'; + } else { + // 解析电压:高4位为整数部分,低4位为小数部分 + var intPart = (input.bytes[3] >> 4) & 0x0F; + var decPart = input.bytes[3] & 0x0F; + data.Volt = intPart + decPart / 10; + } + + data.Device = getDeviceName(input.bytes[1]); + + // Temperature handling (2 bytes, signed) + var tempVal = (input.bytes[4] << 8) | input.bytes[5]; + if (input.bytes[4] & 0x80) { + data.Temp = (0x10000 - tempVal) * -1; + } else { + data.Temp = tempVal; + } + + break; + + case 7: + data.Device = getDeviceName(input.bytes[1]); + data.Cmd = getCfgCmd(input.bytes[0]); + + if (input.bytes[0] === 0x81) { + data.Status = (input.bytes[2] === 0x00) ? 'Success' : 'Failure'; + } else if (input.bytes[0] === 0x82) { + data.MinTime = (input.bytes[2] << 8) | input.bytes[3]; + data.MaxTime = (input.bytes[4] << 8) | input.bytes[5]; + // 解析BatteryChange:高4位为整数部分,低4位为小数部分 + var intPart = (input.bytes[6] >> 4) & 0x0F; + var decPart = input.bytes[6] & 0x0F; + data.BatteryChange = intPart + decPart / 10; + + // TemperatureChange handling (2 bytes, signed) + var tempChgVal = (input.bytes[7] << 8) | input.bytes[8]; + if (input.bytes[7] & 0x80) { + data.TempChange = (0x10000 - tempChgVal) / 10 * -1; + } else { + data.TempChange = tempChgVal / 10; + } + } else if (input.bytes[0] === 0x83) { + data.Status = (input.bytes[2] === 0x00) ? 'Success' : 'Failure'; + } else if (input.bytes[0] === 0x84) { + data.ThermocoupleType = input.bytes[2]; + } + break; + + default: + return { + errors: ['unknown FPort'], + }; + } + + return { + data: data, + }; +} + +function encodeDownlink(input) { + var ret = []; + var devid; + var port; + var getCmdID; + + getCmdID = getCmdToID(input.data.Cmd); + devid = getDeviceType(input.data.Device); + + if (input.data.Cmd == "ConfigReportReq") { + var mint = input.data.MinTime; + var maxt = input.data.MaxTime; + // 将BatteryChange转换为高4位为整数部分,低4位为小数部分 + var batteryChgInt = Math.floor(input.data.BatteryChange); + var batteryChgDec = Math.round((input.data.BatteryChange - batteryChgInt) * 10); + var batteryChg = (batteryChgInt << 4) | batteryChgDec; + var tempChg = input.data.TempChange * 10; + + port = 7; + ret = ret.concat(getCmdID, devid, (mint >> 8), (mint & 0xFF), (maxt >> 8), (maxt & 0xFF), batteryChg, (tempChg >> 8), (tempChg & 0xFF), 0x00, 0x00); + } else if (input.data.Cmd == "ReadConfigReportReq") { + port = 7; + ret = ret.concat(getCmdID, devid, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + } else if (input.data.Cmd == "SetThermocoupleTypeReq") { + var thermoType = input.data.ThermocoupleType; + port = 7; + ret = ret.concat(getCmdID, devid, thermoType, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + } else if (input.data.Cmd == "GetThermocoupleTypeReq") { + port = 7; + ret = ret.concat(getCmdID, devid, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + } + + return { + fPort: port, + bytes: ret + }; +} + +function decodeDownlink(input) { + var data = {}; + switch (input.fPort) { + case 7: + data.Device = getDeviceName(input.bytes[1]); + data.Cmd = getCfgCmd(input.bytes[0]); + + if (input.bytes[0] === getCmdToID("ConfigReportReq")) { + data.MinTime = (input.bytes[2] << 8) | input.bytes[3]; + data.MaxTime = (input.bytes[4] << 8) | input.bytes[5]; + // 解析BatteryChange:高4位为整数部分,低4位为小数部分 + var intPart = (input.bytes[6] >> 4) & 0x0F; + var decPart = input.bytes[6] & 0x0F; + data.BatteryChange = intPart + decPart / 10; + + // TemperatureChange handling (2 bytes, signed) + var tempChgVal = (input.bytes[7] << 8) | input.bytes[8]; + if (input.bytes[7] & 0x80) { + data.TempChange = (0x10000 - tempChgVal) / 10 * -1; + } else { + data.TempChange = tempChgVal / 10; + } + } else if (input.bytes[0] === getCmdToID("SetThermocoupleTypeReq")) { + data.ThermocoupleType = input.bytes[2]; + } + break; + + default: + return { + errors: ['invalid FPort'], + }; + } + + return { + data: data, + }; +} \ No newline at end of file diff --git a/vendor/netvox/payload/r718ce2.js b/vendor/netvox/payload/r718ce2.js new file mode 100644 index 0000000000..d31c0ed24a --- /dev/null +++ b/vendor/netvox/payload/r718ce2.js @@ -0,0 +1,217 @@ +function getCfgCmd(cfgcmd){ + var cfgcmdlist = { + 1: "ConfigReportReq", + 129: "ConfigReportRsp", + 2: "ReadConfigReportReq", + 130: "ReadConfigReportRsp", + 3: "SetThermocoupleTypeReq", + 131: "SetThermocoupleTypeRsp", + 4: "GetThermocoupleTypeReq", + 132: "GetThermocoupleTypeRsp" + }; + return cfgcmdlist[cfgcmd]; +} + +function getDeviceName(dev){ + var deviceName = { + 148: "R718CE", + 25: "R718CE2" + }; + return deviceName[dev]; +} + +function getCmdToID(cmdtype){ + if (cmdtype == "ConfigReportReq") + return 1; + else if (cmdtype == "ConfigReportRsp") + return 129; + else if (cmdtype == "ReadConfigReportReq") + return 2; + else if (cmdtype == "ReadConfigReportRsp") + return 130; + else if (cmdtype == "SetThermocoupleTypeReq") + return 3; + else if (cmdtype == "SetThermocoupleTypeRsp") + return 131; + else if (cmdtype == "GetThermocoupleTypeReq") + return 4; + else if (cmdtype == "GetThermocoupleTypeRsp") + return 132; +} + +function getDeviceType(devName){ + if (devName == "R718CE") + return 148; + else if (devName == "R718CE2") + return 25; +} + +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, + }; + } + + // 在decodeUplink函数中,将电压解析部分修改为: + if (input.bytes[3] & 0x80) { + var tmp_v = input.bytes[3] & 0x7F; + data.Volt = (tmp_v * 0.1).toString() + '(low battery)'; + } else { + data.Volt = input.bytes[3] * 0.1; + } + + data.Device = getDeviceName(input.bytes[1]); + + // Temperature1 handling (2 bytes, signed) + var temp1Val = (input.bytes[4] << 8) | input.bytes[5]; + if (input.bytes[4] & 0x80) { + data.Temp1 = ((0x10000 - temp1Val) * -1) / 10; + } else { + data.Temp1 = temp1Val / 10; + } + + // Temperature2 handling (2 bytes, signed) + var temp2Val = (input.bytes[6] << 8) | input.bytes[7]; + if (input.bytes[6] & 0x80) { + data.Temp2 = ((0x10000 - temp2Val) * -1) / 10; + } else { + data.Temp2 = temp2Val / 10; + } + + // ThresholdAlarm handling + data.ThresholdAlarm = input.bytes[8]; + + break; + + case 7: + data.Device = getDeviceName(input.bytes[1]); + data.Cmd = getCfgCmd(input.bytes[0]); + + if (input.bytes[0] === 0x81) { + data.Status = (input.bytes[2] === 0x00) ? 'Success' : 'Failure'; + } else if (input.bytes[0] === 0x82) { + data.MinTime = (input.bytes[2] << 8) | input.bytes[3]; + data.MaxTime = (input.bytes[4] << 8) | input.bytes[5]; + // 解析BatteryChange:高4位为整数部分,低4位为小数部分 + var intPart = (input.bytes[6] >> 4) & 0x0F; + var decPart = input.bytes[6] & 0x0F; + data.BatteryChange = intPart + decPart / 10; + + // TemperatureChange handling (2 bytes, signed) + var tempChgVal = (input.bytes[7] << 8) | input.bytes[8]; + if (input.bytes[7] & 0x80) { + data.TempChange = ((0x10000 - tempChgVal) * -1) / 10; + } else { + data.TempChange = tempChgVal / 10; + } + } else if (input.bytes[0] === 0x83) { + data.Status = (input.bytes[2] === 0x00) ? 'Success' : 'Failure'; + } else if (input.bytes[0] === 0x84) { + data.ThermocoupleType = input.bytes[2]; + } + break; + + default: + return { + errors: ['unknown FPort'], + }; + } + + return { + data: data, + }; +} + +function encodeDownlink(input) { + var ret = []; + var devid; + var port; + var getCmdID; + + getCmdID = getCmdToID(input.data.Cmd); + devid = getDeviceType(input.data.Device); + + if (input.data.Cmd == "ConfigReportReq") { + var mint = input.data.MinTime; + var maxt = input.data.MaxTime; + // 将BatteryChange转换为高4位为整数部分,低4位为小数部分 + var batteryChgInt = Math.floor(input.data.BatteryChange); + var batteryChgDec = Math.round((input.data.BatteryChange - batteryChgInt) * 10); + var batteryChg = (batteryChgInt << 4) | batteryChgDec; + var tempChg = input.data.TempChange * 10; + + port = 7; + ret = ret.concat(getCmdID, devid, (mint >> 8), (mint & 0xFF), (maxt >> 8), (maxt & 0xFF), batteryChg, (tempChg >> 8), (tempChg & 0xFF), 0x00, 0x00); + } else if (input.data.Cmd == "ReadConfigReportReq") { + port = 7; + ret = ret.concat(getCmdID, devid, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + } else if (input.data.Cmd == "SetThermocoupleTypeReq") { + var thermoType = input.data.ThermocoupleType; + port = 7; + ret = ret.concat(getCmdID, devid, thermoType, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + } else if (input.data.Cmd == "GetThermocoupleTypeReq") { + port = 7; + ret = ret.concat(getCmdID, devid, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + } + + return { + fPort: port, + bytes: ret + }; +} + +function decodeDownlink(input) { + var data = {}; + switch (input.fPort) { + case 7: + data.Device = getDeviceName(input.bytes[1]); + data.Cmd = getCfgCmd(input.bytes[0]); + + if (input.bytes[0] === getCmdToID("ConfigReportReq")) { + data.MinTime = (input.bytes[2] << 8) | input.bytes[3]; + data.MaxTime = (input.bytes[4] << 8) | input.bytes[5]; + // 解析BatteryChange:高4位为整数部分,低4位为小数部分 + var intPart = (input.bytes[6] >> 4) & 0x0F; + var decPart = input.bytes[6] & 0x0F; + data.BatteryChange = intPart + decPart / 10; + + // TemperatureChange handling (2 bytes, signed) + var tempChgVal = (input.bytes[7] << 8) | input.bytes[8]; + if (input.bytes[7] & 0x80) { + data.TempChange = ((0x10000 - tempChgVal) * -1) / 10; + } else { + data.TempChange = tempChgVal / 10; + } + } else if (input.bytes[0] === getCmdToID("SetThermocoupleTypeReq")) { + data.ThermocoupleType = input.bytes[2]; + } + break; + + default: + return { + errors: ['invalid FPort'], + }; + } + + return { + data: data, + }; +} \ No newline at end of file diff --git a/vendor/netvox/payload/r718ce4.js b/vendor/netvox/payload/r718ce4.js new file mode 100644 index 0000000000..4e8a05538c --- /dev/null +++ b/vendor/netvox/payload/r718ce4.js @@ -0,0 +1,243 @@ +function getCfgCmd(cfgcmd){ + var cfgcmdlist = { + 1: "ConfigReportReq", + 129: "ConfigReportRsp", + 2: "ReadConfigReportReq", + 130: "ReadConfigReportRsp", + 3: "SetThermocoupleTypeReq", + 131: "SetThermocoupleTypeRsp", + 4: "GetThermocoupleTypeReq", + 132: "GetThermocoupleTypeRsp" + }; + return cfgcmdlist[cfgcmd]; +} + +function getDeviceName(dev){ + var deviceName = { + 60: "R718CE4" + }; + return deviceName[dev]; +} + +function getCmdToID(cmdtype){ + if (cmdtype == "ConfigReportReq") + return 1; + else if (cmdtype == "ConfigReportRsp") + return 129; + else if (cmdtype == "ReadConfigReportReq") + return 2; + else if (cmdtype == "ReadConfigReportRsp") + return 130; + else if (cmdtype == "SetThermocoupleTypeReq") + return 3; + else if (cmdtype == "SetThermocoupleTypeRsp") + return 131; + else if (cmdtype == "GetThermocoupleTypeReq") + return 4; + else if (cmdtype == "GetThermocoupleTypeRsp") + return 132; +} + +function getDeviceType(devName){ + if (devName == "R718CE4") + return 60; +} + +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, + }; + } + + if (input.bytes[2] === 0x01) { + // 修改后的电压解析逻辑:直接将字节值乘以0.1 + if (input.bytes[3] & 0x80) { + var tmp_v = input.bytes[3] & 0x7F; + data.Volt = (tmp_v * 0.1).toString() + '(low battery)'; + } else { + data.Volt = input.bytes[3] * 0.1; + } + + data.Device = getDeviceName(input.bytes[1]); + + // Temperature1 handling (2 bytes, signed) + var tempVal1 = (input.bytes[4] << 8) | input.bytes[5]; + if (input.bytes[4] & 0x80) { + data.Temp1 = (0x10000 - tempVal1) / 10 * -1; + } else { + data.Temp1 = tempVal1 / 10; + } + + // Temperature2 handling (2 bytes, signed) + var tempVal2 = (input.bytes[6] << 8) | input.bytes[7]; + if (input.bytes[6] & 0x80) { + data.Temp2 = (0x10000 - tempVal2) / 10 * -1; + } else { + data.Temp2 = tempVal2 / 10; + } + } else if (input.bytes[2] === 0x02) { + // 修改后的电压解析逻辑:直接将字节值乘以0.1 + if (input.bytes[3] & 0x80) { + var tmp_v = input.bytes[3] & 0x7F; + data.Volt = (tmp_v * 0.1).toString() + '(low battery)'; + } else { + data.Volt = input.bytes[3] * 0.1; + } + + data.Device = getDeviceName(input.bytes[1]); + + // Temperature3 handling (2 bytes, signed) + var tempVal3 = (input.bytes[4] << 8) | input.bytes[5]; + if (input.bytes[4] & 0x80) { + data.Temp3 = (0x10000 - tempVal3) / 10 * -1; + } else { + data.Temp3 = tempVal3 / 10; + } + + // Temperature4 handling (2 bytes, signed) + var tempVal4 = (input.bytes[6] << 8) | input.bytes[7]; + if (input.bytes[6] & 0x80) { + data.Temp4 = (0x10000 - tempVal4) / 10 * -1; + } else { + data.Temp4 = tempVal4 / 10; + } + } + + break; + + case 7: + data.Device = getDeviceName(input.bytes[1]); + data.Cmd = getCfgCmd(input.bytes[0]); + + if (input.bytes[0] === 0x81) { + data.Status = (input.bytes[2] === 0x00) ? 'Success' : 'Failure'; + } else if (input.bytes[0] === 0x82) { + data.MinTime = (input.bytes[2] << 8) | input.bytes[3]; + data.MaxTime = (input.bytes[4] << 8) | input.bytes[5]; + // 修改后的BatteryChange解析逻辑:直接将字节值乘以0.1 + if (input.bytes[6] & 0x80) { + var tmp_bc = input.bytes[6] & 0x7F; + data.BatteryChange = tmp_bc * 0.1; + } else { + data.BatteryChange = input.bytes[6] * 0.1; + } + + // TemperatureChange handling (2 bytes, signed) + var tempChgVal = (input.bytes[7] << 8) | input.bytes[8]; + if (input.bytes[7] & 0x80) { + data.TempChange = (0x10000 - tempChgVal) / 10 * -1; + } else { + data.TempChange = tempChgVal / 10; + } + } else if (input.bytes[0] === 0x83) { + data.Status = (input.bytes[2] === 0x00) ? 'Success' : 'Failure'; + } else if (input.bytes[0] === 0x84) { + data.ThermocoupleType = input.bytes[2]; + } + break; + + default: + return { + errors: ['unknown FPort'], + }; + } + + return { + data: data, + }; +} + +function encodeDownlink(input) { + var ret = []; + var devid; + var port; + var getCmdID; + + getCmdID = getCmdToID(input.data.Cmd); + devid = getDeviceType(input.data.Device); + + if (input.data.Cmd == "ConfigReportReq") { + var mint = input.data.MinTime; + var maxt = input.data.MaxTime; + // 修改后的BatteryChange编码逻辑:直接将值乘以10 + var batteryChg = Math.round(input.data.BatteryChange * 10); + var tempChg = Math.round(input.data.TempChange * 10); + + port = 7; + ret = ret.concat(getCmdID, devid, (mint >> 8), (mint & 0xFF), (maxt >> 8), (maxt & 0xFF), batteryChg, (tempChg >> 8), (tempChg & 0xFF), 0x00, 0x00); + } else if (input.data.Cmd == "ReadConfigReportReq") { + port = 7; + ret = ret.concat(getCmdID, devid, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + } else if (input.data.Cmd == "SetThermocoupleTypeReq") { + var thermoType = input.data.ThermocoupleType; + port = 7; + ret = ret.concat(getCmdID, devid, thermoType, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + } else if (input.data.Cmd == "GetThermocoupleTypeReq") { + port = 7; + ret = ret.concat(getCmdID, devid, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + } + + return { + fPort: port, + bytes: ret + }; +} + +function decodeDownlink(input) { + var data = {}; + switch (input.fPort) { + case 7: + data.Device = getDeviceName(input.bytes[1]); + data.Cmd = getCfgCmd(input.bytes[0]); + + if (input.bytes[0] === getCmdToID("ConfigReportReq")) { + data.MinTime = (input.bytes[2] << 8) | input.bytes[3]; + data.MaxTime = (input.bytes[4] << 8) | input.bytes[5]; + // 修改后的BatteryChange解析逻辑:直接将字节值乘以0.1 + if (input.bytes[6] & 0x80) { + var tmp_bc = input.bytes[6] & 0x7F; + data.BatteryChange = tmp_bc * 0.1; + } else { + data.BatteryChange = input.bytes[6] * 0.1; + } + + // TemperatureChange handling (2 bytes, signed) + var tempChgVal = (input.bytes[7] << 8) | input.bytes[8]; + if (input.bytes[7] & 0x80) { + data.TempChange = (0x10000 - tempChgVal) / 10 * -1; + } else { + data.TempChange = tempChgVal / 10; + } + } else if (input.bytes[0] === getCmdToID("SetThermocoupleTypeReq")) { + data.ThermocoupleType = input.bytes[2]; + } + break; + + default: + return { + errors: ['invalid FPort'], + }; + } + + return { + data: data, + }; +} \ No newline at end of file diff --git a/vendor/netvox/payload/r718cj.js b/vendor/netvox/payload/r718cj.js new file mode 100644 index 0000000000..13b7148f0a --- /dev/null +++ b/vendor/netvox/payload/r718cj.js @@ -0,0 +1,212 @@ +function getCfgCmd(cfgcmd){ + var cfgcmdlist = { + 1: "ConfigReportReq", + 129: "ConfigReportRsp", + 2: "ReadConfigReportReq", + 130: "ReadConfigReportRsp", + 3: "SetThermocoupleTypeReq", + 131: "SetThermocoupleTypeRsp", + 4: "GetThermocoupleTypeReq", + 132: "GetThermocoupleTypeRsp" + }; + return cfgcmdlist[cfgcmd]; +} + +function getDeviceName(dev){ + var deviceName = { + 144: "R718CJ" + }; + return deviceName[dev]; +} + +function getCmdToID(cmdtype){ + if (cmdtype == "ConfigReportReq") + return 1; + else if (cmdtype == "ConfigReportRsp") + return 129; + else if (cmdtype == "ReadConfigReportReq") + return 2; + else if (cmdtype == "ReadConfigReportRsp") + return 130; + else if (cmdtype == "SetThermocoupleTypeReq") + return 3; + else if (cmdtype == "SetThermocoupleTypeRsp") + return 131; + else if (cmdtype == "GetThermocoupleTypeReq") + return 4; + else if (cmdtype == "GetThermocoupleTypeRsp") + return 132; +} + +function getDeviceType(devName){ + if (devName == "R718CJ") + return 144; +} + +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, + }; + } + + if (input.bytes[2] === 0x01) { + // 修改后的电压解析逻辑:直接将字节值乘以0.1 + if (input.bytes[3] & 0x80) { + var tmp_v = input.bytes[3] & 0x7F; + data.Volt = (tmp_v * 0.1).toString() + '(low battery)'; + } else { + data.Volt = input.bytes[3] * 0.1; + } + + data.Device = getDeviceName(input.bytes[1]); + + // Temperature handling (2 bytes, signed) + var tempVal = (input.bytes[4] << 8) | input.bytes[5]; + if (input.bytes[4] & 0x80) { + data.Temp = (0x10000 - tempVal) / 10 * -1; + } else { + data.Temp = tempVal / 10; + } + + // Threshold Alarm + data.ThresholdAlarm = input.bytes[6]; + } + + break; + + case 7: + data.Device = getDeviceName(input.bytes[1]); + data.Cmd = getCfgCmd(input.bytes[0]); + + if (input.bytes[0] === 0x81) { + data.Status = (input.bytes[2] === 0x00) ? 'Success' : 'Failure'; + } else if (input.bytes[0] === 0x82) { + data.MinTime = (input.bytes[2] << 8) | input.bytes[3]; + data.MaxTime = (input.bytes[4] << 8) | input.bytes[5]; + // 修改后的BatteryChange解析逻辑:直接将字节值乘以0.1 + if (input.bytes[6] & 0x80) { + var tmp_bc = input.bytes[6] & 0x7F; + data.BatteryChange = tmp_bc * 0.1; + } else { + data.BatteryChange = input.bytes[6] * 0.1; + } + + // TemperatureChange handling (2 bytes, signed) + var tempChgVal = (input.bytes[7] << 8) | input.bytes[8]; + if (input.bytes[7] & 0x80) { + data.TempChange = (0x10000 - tempChgVal) / 10 * -1; + } else { + data.TempChange = tempChgVal / 10; + } + } else if (input.bytes[0] === 0x83) { + data.Status = (input.bytes[2] === 0x00) ? 'Success' : 'Failure'; + } else if (input.bytes[0] === 0x84) { + data.ThermocoupleType = input.bytes[2]; + } + break; + + default: + return { + errors: ['unknown FPort'], + }; + } + + return { + data: data, + }; +} + +function encodeDownlink(input) { + var ret = []; + var devid; + var port; + var getCmdID; + + getCmdID = getCmdToID(input.data.Cmd); + devid = getDeviceType(input.data.Device); + + if (input.data.Cmd == "ConfigReportReq") { + var mint = input.data.MinTime; + var maxt = input.data.MaxTime; + // 修改后的BatteryChange编码逻辑:直接将值乘以10 + var batteryChg = Math.round(input.data.BatteryChange * 10); + var tempChg = Math.round(input.data.TempChange * 10); + + port = 7; + ret = ret.concat(getCmdID, devid, (mint >> 8), (mint & 0xFF), (maxt >> 8), (maxt & 0xFF), batteryChg, (tempChg >> 8), (tempChg & 0xFF), 0x00, 0x00); + } else if (input.data.Cmd == "ReadConfigReportReq") { + port = 7; + ret = ret.concat(getCmdID, devid, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + } else if (input.data.Cmd == "SetThermocoupleTypeReq") { + var thermoType = input.data.ThermocoupleType; + port = 7; + ret = ret.concat(getCmdID, devid, thermoType, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + } else if (input.data.Cmd == "GetThermocoupleTypeReq") { + port = 7; + ret = ret.concat(getCmdID, devid, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + } + + return { + fPort: port, + bytes: ret + }; +} + +function decodeDownlink(input) { + var data = {}; + switch (input.fPort) { + case 7: + data.Device = getDeviceName(input.bytes[1]); + data.Cmd = getCfgCmd(input.bytes[0]); + + if (input.bytes[0] === getCmdToID("ConfigReportReq")) { + data.MinTime = (input.bytes[2] << 8) | input.bytes[3]; + data.MaxTime = (input.bytes[4] << 8) | input.bytes[5]; + // 修改后的BatteryChange解析逻辑:直接将字节值乘以0.1 + if (input.bytes[6] & 0x80) { + var tmp_bc = input.bytes[6] & 0x7F; + data.BatteryChange = tmp_bc * 0.1; + } else { + data.BatteryChange = input.bytes[6] * 0.1; + } + + // TemperatureChange handling (2 bytes, signed) + var tempChgVal = (input.bytes[7] << 8) | input.bytes[8]; + if (input.bytes[7] & 0x80) { + data.TempChange = (0x10000 - tempChgVal) / 10 * -1; + } else { + data.TempChange = tempChgVal / 10; + } + } else if (input.bytes[0] === getCmdToID("SetThermocoupleTypeReq")) { + data.ThermocoupleType = input.bytes[2]; + } + break; + + default: + return { + errors: ['invalid FPort'], + }; + } + + return { + data: data, + }; +} \ No newline at end of file diff --git a/vendor/netvox/payload/r718cj2.js b/vendor/netvox/payload/r718cj2.js new file mode 100644 index 0000000000..27070c562a --- /dev/null +++ b/vendor/netvox/payload/r718cj2.js @@ -0,0 +1,242 @@ +function getCfgCmd(cfgcmd){ + var cfgcmdlist = { + 0x01: "ConfigReportReq", + 0x81: "ConfigReportRsp", + 0x02: "ReadConfigReportReq", + 0x82: "ReadConfigReportRsp", + 0x03: "SetThermocoupleTypeReq", + 0x83: "SetThermocoupleTypeRsp", + 0x04: "GetThermocoupleTypeReq", + 0x84: "GetThermocoupleTypeRsp" + }; + return cfgcmdlist[cfgcmd]; +} + +function getDeviceName(dev){ + var deviceName = { + 0x14: "R718B2", + 0x15: "R718CJ2", + 0x16: "R718CK2", + 0x17: "R718CT2", + 0x18: "R718CN2", + 0x19: "R718CE2", + 0x78: "R730CJ2", + 0x79: "R730CK2", + 0x7A: "R730CT2", + 0x7B: "R730CN2", + 0x7C: "R730CE2" + }; + return deviceName[dev]; +} + +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 == "SetThermocoupleTypeReq") + return 0x03; + else if (cmdtype == "SetThermocoupleTypeRsp") + return 0x83; + else if (cmdtype == "GetThermocoupleTypeReq") + return 0x04; + else if (cmdtype == "GetThermocoupleTypeRsp") + return 0x84; +} + +function getDeviceType(devName){ + if (devName == "R718B2") + return 0x14; + else if (devName == "R718CJ2") + return 0x15; + else if (devName == "R718CK2") + return 0x16; + else if (devName == "R718CT2") + return 0x17; + else if (devName == "R718CN2") + return 0x18; + else if (devName == "R718CE2") + return 0x19; + else if (devName == "R730CJ2") + return 0x78; + else if (devName == "R730CK2") + return 0x79; + else if (devName == "R730CT2") + return 0x7A; + else if (devName == "R730CN2") + return 0x7B; + else if (devName == "R730CE2") + return 0x7C; +} + +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, + }; + } + + 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; + + data.Device = getDeviceName(input.bytes[1]); + if (input.bytes[4] & 0x80) + { + var tmpval1 = (input.bytes[4]<<8 | input.bytes[5]); + data.Temperature1 = (0x10000 - tmpval1)/10 * -1; + } + else + data.Temperature1 = (input.bytes[4]<<8 | input.bytes[5])/10; + + if (input.bytes[6] & 0x80) + { + var tmpval2 = (input.bytes[6]<<8 | input.bytes[7]); + data.Temperature2 = (0x10000 - tmpval2)/10 * -1; + } + else + data.Temperature2 = (input.bytes[6]<<8 | input.bytes[7])/10; + + // Threshold alarm + if (input.bytes.length > 8) { + data.ThresholdAlarm_R718CX2 = input.bytes[8]; + } + + break; + + case 7: + data.Device = getDeviceName(input.bytes[1]); + switch (input.bytes[0]) { + case 0x81: + data.Cmd = getCfgCmd(input.bytes[0]); + data.Status = (input.bytes[2] === 0x00) ? 'Success' : 'Failure'; + break; + case 0x82: + data.Cmd = getCfgCmd(input.bytes[0]); + data.MinTime = (input.bytes[2]<<8 | input.bytes[3]); + data.MaxTime = (input.bytes[4]<<8 | input.bytes[5]); + data.BatteryChange = input.bytes[6]/10; + data.TemperatureChange = (input.bytes[7]<<8 | input.bytes[8])/10; + break; + case 0x83: + data.Cmd = getCfgCmd(input.bytes[0]); + data.Status = (input.bytes[2] === 0x00) ? 'Success' : 'Failure'; + break; + case 0x84: + data.Cmd = getCfgCmd(input.bytes[0]); + data.ThermocoupleType = input.bytes[2]; + break; + } + break; + + default: + return { + errors: ['unknown FPort'], + }; + + } + + + return { + data: data, + }; + } + +function encodeDownlink(input) { + var ret = []; + var devid; + var port; + var getCmdID; + + getCmdID = getCmdToID(input.data.Cmd); + devid = getDeviceType(input.data.Device); + port = 7; + + switch (input.data.Cmd) { + case "ConfigReportReq": + var mint = input.data.MinTime; + var maxt = input.data.MaxTime; + var batteryChg = input.data.BatteryChange * 10; + var tempChg = input.data.TemperatureChange * 10; + ret = ret.concat(getCmdID, devid, (mint >> 8), (mint & 0xFF), (maxt >> 8), (maxt & 0xFF), batteryChg, (tempChg >> 8), (tempChg & 0xFF), 0x00, 0x00); + break; + case "ReadConfigReportReq": + ret = ret.concat(getCmdID, devid, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + break; + case "SetThermocoupleTypeReq": + var type = input.data.ThermocoupleType; + ret = ret.concat(getCmdID, devid, type, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + break; + case "GetThermocoupleTypeReq": + ret = ret.concat(getCmdID, devid, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + break; + } + + return { + fPort: port, + bytes: ret + }; +} + +function decodeDownlink(input) { + var data = {}; + switch (input.fPort) { + case 7: + data.Device = getDeviceName(input.bytes[1]); + switch (input.bytes[0]) { + case 0x01: + data.Cmd = getCfgCmd(input.bytes[0]); + data.MinTime = (input.bytes[2]<<8 | input.bytes[3]); + data.MaxTime = (input.bytes[4]<<8 | input.bytes[5]); + data.BatteryChange = input.bytes[6]/10; + data.TemperatureChange = (input.bytes[7]<<8 | input.bytes[8])/10; + break; + case 0x02: + data.Cmd = getCfgCmd(input.bytes[0]); + break; + case 0x03: + data.Cmd = getCfgCmd(input.bytes[0]); + data.ThermocoupleType = input.bytes[2]; + break; + case 0x04: + data.Cmd = getCfgCmd(input.bytes[0]); + break; + } + break; + + default: + return { + errors: ['invalid FPort'], + }; + } + + return { + data: data, + }; +} \ No newline at end of file diff --git a/vendor/netvox/payload/r718cj4.js b/vendor/netvox/payload/r718cj4.js new file mode 100644 index 0000000000..595097c083 --- /dev/null +++ b/vendor/netvox/payload/r718cj4.js @@ -0,0 +1,232 @@ +function getCfgCmd(cfgcmd){ + var cfgcmdlist = { + 0x01: "ConfigReportReq", + 0x81: "ConfigReportRsp", + 0x02: "ReadConfigReportReq", + 0x82: "ReadConfigReportRsp", + 0x03: "SetThermocoupleTypeReq", + 0x83: "SetThermocoupleTypeRsp", + 0x04: "GetThermocoupleTypeReq", + 0x84: "GetThermocoupleTypeRsp" + }; + return cfgcmdlist[cfgcmd]; +} + +function getDeviceName(dev){ + var deviceName = { + 0x38: "R718CJ4", + 0x90: "R718CJ4", + 0x91: "R718CJ4" + }; + return deviceName[dev]; +} + +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 == "SetThermocoupleTypeReq") + return 0x03; + else if (cmdtype == "SetThermocoupleTypeRsp") + return 0x83; + else if (cmdtype == "GetThermocoupleTypeReq") + return 0x04; + else if (cmdtype == "GetThermocoupleTypeRsp") + return 0x84; +} + +function getDeviceType(devName){ + if (devName == "R718CJ4") + return 0x90; +} + +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, + }; + } + + 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; + + data.Device = getDeviceName(input.bytes[1]); + + // Process temperature values based on report type + if (input.bytes[2] === 0x01) { + // Temperature1 and Temperature2 + if (input.bytes[4] & 0x80) + { + var tmpval1 = (input.bytes[4]<<8 | input.bytes[5]); + data.Temperature1 = (0x10000 - tmpval1)/10 * -1; + } + else + data.Temperature1 = (input.bytes[4]<<8 | input.bytes[5])/10; + + if (input.bytes[6] & 0x80) + { + var tmpval2 = (input.bytes[6]<<8 | input.bytes[7]); + data.Temperature2 = (0x10000 - tmpval2)/10 * -1; + } + else + data.Temperature2 = (input.bytes[6]<<8 | input.bytes[7])/10; + } + else if (input.bytes[2] === 0x02) { + // Temperature3 and Temperature4 + if (input.bytes[4] & 0x80) + { + var tmpval1 = (input.bytes[4]<<8 | input.bytes[5]); + data.Temperature3 = (0x10000 - tmpval1)/10 * -1; + } + else + data.Temperature3 = (input.bytes[4]<<8 | input.bytes[5])/10; + + if (input.bytes[6] & 0x80) + { + var tmpval2 = (input.bytes[6]<<8 | input.bytes[7]); + data.Temperature4 = (0x10000 - tmpval2)/10 * -1; + } + else + data.Temperature4 = (input.bytes[6]<<8 | input.bytes[7])/10; + } + + break; + + case 7: + data.Device = getDeviceName(input.bytes[1]); + switch (input.bytes[0]) { + case 0x81: + data.Cmd = getCfgCmd(input.bytes[0]); + data.Status = (input.bytes[2] === 0x00) ? 'Success' : 'Failure'; + break; + case 0x82: + data.Cmd = getCfgCmd(input.bytes[0]); + data.MinTime = (input.bytes[2]<<8 | input.bytes[3]); + data.MaxTime = (input.bytes[4]<<8 | input.bytes[5]); + data.BatteryChange = input.bytes[6]/10; + data.TemperatureChange = (input.bytes[7]<<8 | input.bytes[8])/10; + break; + case 0x83: + data.Cmd = getCfgCmd(input.bytes[0]); + data.Status = (input.bytes[2] === 0x00) ? 'Success' : 'Failure'; + break; + case 0x84: + data.Cmd = getCfgCmd(input.bytes[0]); + data.ThermocoupleType = input.bytes[2]; + break; + } + break; + + default: + return { + errors: ['unknown FPort'], + }; + + } + + + return { + data: data, + }; + } + +function encodeDownlink(input) { + var ret = []; + var devid; + var port; + var getCmdID; + + getCmdID = getCmdToID(input.data.Cmd); + devid = getDeviceType(input.data.Device); + port = 7; + + switch (input.data.Cmd) { + case "ConfigReportReq": + var mint = input.data.MinTime; + var maxt = input.data.MaxTime; + var batteryChg = input.data.BatteryChange * 10; + var tempChg = input.data.TemperatureChange * 10; + ret = ret.concat(getCmdID, devid, (mint >> 8), (mint & 0xFF), (maxt >> 8), (maxt & 0xFF), batteryChg, (tempChg >> 8), (tempChg & 0xFF), 0x00, 0x00); + break; + case "ReadConfigReportReq": + ret = ret.concat(getCmdID, devid, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + break; + case "SetThermocoupleTypeReq": + var type = input.data.ThermocoupleType; + ret = ret.concat(getCmdID, devid, type, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + break; + case "GetThermocoupleTypeReq": + ret = ret.concat(getCmdID, devid, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + break; + } + + return { + fPort: port, + bytes: ret + }; +} + +function decodeDownlink(input) { + var data = {}; + switch (input.fPort) { + case 7: + data.Device = getDeviceName(input.bytes[1]); + switch (input.bytes[0]) { + case 0x01: + data.Cmd = getCfgCmd(input.bytes[0]); + data.MinTime = (input.bytes[2]<<8 | input.bytes[3]); + data.MaxTime = (input.bytes[4]<<8 | input.bytes[5]); + data.BatteryChange = input.bytes[6]/10; + data.TemperatureChange = (input.bytes[7]<<8 | input.bytes[8])/10; + break; + case 0x02: + data.Cmd = getCfgCmd(input.bytes[0]); + break; + case 0x03: + data.Cmd = getCfgCmd(input.bytes[0]); + data.ThermocoupleType = input.bytes[2]; + break; + case 0x04: + data.Cmd = getCfgCmd(input.bytes[0]); + break; + } + break; + + default: + return { + errors: ['invalid FPort'], + }; + } + + return { + data: data, + }; +} \ No newline at end of file diff --git a/vendor/netvox/payload/r718ec.js b/vendor/netvox/payload/r718ec.js new file mode 100755 index 0000000000..8e0bad8e0d --- /dev/null +++ b/vendor/netvox/payload/r718ec.js @@ -0,0 +1,318 @@ + +function getCfgCmd(cfgcmd){ + var cfgcmdlist = { + 1: "ConfigReportReq", + 129: "ConfigReportRsp", + 2: "ReadConfigReportReq", + 130: "ReadConfigReportRsp", + 3: "SetActiveThresholdReq", + 131: "SetActiveThresholdRsp", + 4: "GetActiveThresholdReq", + 132: "GetActiveThresholdRsp", + 7: "SetRestoreReportReq", + 135: "SetRestoreReportRsp", + 8: "GetRestoreReportReq", + 136: "GetRestoreReportRsp" + }; + return cfgcmdlist[cfgcmd]; +} + +function getDeviceName(dev){ + var deviceName = { + 28: "R718EC" + }; + return deviceName[dev]; +} + +const CmdNameIDMap = { + 'ConfigReportReq':0x01, + 'ConfigReportRsp':0x81, + 'ReadConfigReportReq':0x02, + 'ReadConfigReportRsp':0x82, + 'SetActiveThresholdReq':0x03, + 'SetActiveThresholdRsp':0x83, + 'GetActiveThresholdReq':0x04, + 'GetActiveThresholdRsp':0x84, + 'SetFilterVelocityThresholdReq':0x05, + 'GetFilterVelocityThresholdReq':0x06, + 'SetRestoreReportReq':0x07, + 'SetRestoreReportRsp':0x87, + 'GetRestoreReportReq':0x08, + 'GetRestoreReportRsp':0x88 + }; + +function getDeviceID(devName){ + if (devName == "R718EC") + return 28; +} + +function padLeft(str, len) { + str = '' + str; + if (str.length >= len) { + return str; + } else { + return padLeft("0" + str, len); + } +} + +//0x7C00 = infinity +//0xFC00 = −infinity +//0x7C80 = NaN +//0x7BFF = 65504 (max half precision) +function float16Process(h) { + var sign = (h & 0x8000) >> 15; + var exp = (h & 0x7C00) >> 10; + var fraction = h & 0x03FF; + + // 优化1:处理 ±0(原逻辑已覆盖,但显式标注更清晰) + if (exp === 0 && fraction === 0) { + return sign ? -0 : 0; + } + // 非规格化数 + if (exp === 0) { + return (sign ? -1 : 1) * Math.pow(2, -14) * (fraction / Math.pow(2, 10)); + } + // 无穷大/NaN + if (exp === 0x1F) { + return fraction ? NaN : (sign ? -Infinity : Infinity); + } + // 规格化数 + return (sign ? -1 : 1) * Math.pow(2, exp - 15) * (1 + (fraction / Math.pow(2, 10))); +} +function float32Process(h) { + var sign = (h & 0x8000) >> 15; + var exp = (h & 0x7F80) >> 7; + var fraction = (h & 0x007F) << 16; + + if(exp == 0) { + return (sign?-1:1) * Math.pow(2,-126) * (fraction/Math.pow(2, 23)); + } else if (exp == 0xFF) { + return fraction?NaN:((sign?-1:1)*Infinity); + } + + return (sign?-1:1) * Math.pow(2, exp-127) * (1+(fraction/Math.pow(2, 23))); +} + + +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[2] === 0x01) + { + 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; + + data.AccelerationX = parseFloat(float32Process(input.bytes[5]<<8 | input.bytes[4]).toFixed(6)); + data.AccelerationY = parseFloat(float32Process(input.bytes[7]<<8 | input.bytes[6]).toFixed(6)); + data.AccelerationZ = parseFloat(float32Process(input.bytes[9]<<8 | input.bytes[8]).toFixed(6)); + data.ActiveStatus = input.bytes[10]; + } + else if (input.bytes[2] === 0x02) + { + data.VelocityX = parseFloat(float32Process(input.bytes[4]<<8 | input.bytes[3]).toFixed(6)); + data.VelocityY = parseFloat(float32Process(input.bytes[6]<<8 | input.bytes[5]).toFixed(6)); + data.VelocityZ = parseFloat(float32Process(input.bytes[8]<<8 | input.bytes[7]).toFixed(6)); + if (input.bytes[9] & 0x80) + { + var tmpval = (input.bytes[9]<<8 | input.bytes[10]); + data.TemperaturewithNTC = (0x10000 - tmpval)/10 * -1; + } + else + { + data.TemperaturewithNTC = (input.bytes[9]<<8 | input.bytes[10])/10; + } + } + else if (input.bytes[2] === 0x03) + { + 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; + var unsigned = input.bytes[4]<<8 | input.bytes[5]; + var signed16Int = unsigned > 0x7FFF ? unsigned - 0x10000 : unsigned; + data.AngleX = signed16Int * 0.005; + unsigned = input.bytes[6]<<8 | input.bytes[7]; + signed16Int = unsigned > 0x7FFF ? unsigned - 0x10000 : unsigned; + data.AngleY = signed16Int * 0.005; + unsigned = input.bytes[8]<<8 | input.bytes[9]; + signed16Int = unsigned > 0x7FFF ? unsigned - 0x10000 : unsigned; + data.AngleZ = signed16Int * 0.005; + data.LowAngleXAlarm = input.bytes[10] & 1; + data.HighAngleXAlarm = input.bytes[10] >> 1 & 1; + data.LowAngleYAlarm = input.bytes[10] >> 2 & 1; + data.HighAngleYAlarm = input.bytes[10] >> 3 & 1; + data.LowAngleZAlarm = input.bytes[10] >> 4 & 1; + data.HighAngleZAlarm = input.bytes[10] >> 5 & 1; + } + else if (input.bytes[2] === 0x04) + { + 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; + + data.LowAccelerationXAlarm = input.bytes[4] & 1; + data.HighAccelerationXAlarm = input.bytes[4] >> 1 & 1; + data.LowAccelerationYAlarm = input.bytes[4] >> 2 & 1; + data.HighAccelerationYAlarm = input.bytes[4] >> 3 & 1; + data.LowAccelerationZAlarm = input.bytes[4] >> 4 & 1; + data.HighAccelerationZAlarm = input.bytes[4] >> 5 & 1; + + data.LowVelocityXAlarm = input.bytes[5] & 1; + data.HighVelocityXAlarm = input.bytes[5] >> 1 & 1; + data.LowVelocityYAlarm = input.bytes[5] >> 2 & 1; + data.HighVelocityYAlarm = input.bytes[5] >> 3 & 1; + data.LowVelocityZAlarm = input.bytes[5] >> 4 & 1; + data.HighVelocityZAlarm = input.bytes[5] >> 5 & 1; + + data.LowTemperaturewithAlarm = input.bytes[6] & 1; + data.HighTemperaturewithAlarm = input.bytes[6] >> 1 & 1; + + } + + break; + + case 7: + data.Cmd = getCfgCmd(input.bytes[0]); + data.Device = getDeviceName(input.bytes[1]); + if (input.bytes[0] === CmdNameIDMap["ConfigReportRsp"]) + { + data.Status = (input.bytes[2] === 0x00) ? 'Success' : 'Failure'; + } + else if (input.bytes[0] === CmdNameIDMap["ReadConfigReportRsp"]) + { + data.MinTime = (input.bytes[2]<<8 | input.bytes[3]); + data.MaxTime = (input.bytes[4]<<8 | input.bytes[5]); + data.BatteryChange = input.bytes[6]/10; + data.AccelerationChange = (input.bytes[7]<<8 | input.bytes[8]); + } + else if (input.bytes[0] === CmdNameIDMap["SetActiveThresholdRsp"]) + { + data.Status = (input.bytes[2] === 0x00) ? 'Success' : 'Failure'; + } + else if (input.bytes[0] === CmdNameIDMap["GetActiveThresholdRsp"]) + { + data.ActiveThreshold = (input.bytes[2]<<8 | input.bytes[3]); + data.InActiveThreshold = (input.bytes[4]<<8 | input.bytes[5]); + } + else if (input.bytes[0] === CmdNameIDMap["SetRestoreReportRsp"]) + { + data.Status = (input.bytes[2] === 0x00) ? 'Success' : 'Failure'; + } + else if (input.bytes[0] === CmdNameIDMap["GetRestoreReportRsp"]) + { + data.RestoreReportSet = input.bytes[2]; + } + + break; + + default: + return { + errors: ['unknown FPort'], + }; + + } + + return { + data: data, + }; + } + +function encodeDownlink(input) { + var ret = []; + var devid; + var getCmdID; + + getCmdID = CmdNameIDMap[input.data.Cmd]; + devid = getDeviceID(input.data.Device); + + if (input.data.Cmd == "ConfigReportReq") + { + var mint = input.data.MinTime; + var maxt = input.data.MaxTime; + var batteryChg = input.data.BatteryChange * 10; + var accChg = input.data.AccelerationChange; + + ret = ret.concat(getCmdID, devid, (mint >> 8), (mint & 0xFF), (maxt >> 8), (maxt & 0xFF), batteryChg, (accChg >> 8), (accChg & 0xFF), 0x00, 0x00); + } + else if ((input.data.Cmd == "ReadConfigReportReq") || (input.data.Cmd == "GetActiveThresholdReq") || (input.data.Cmd == "GetRestoreReportReq")) + { + ret = ret.concat(getCmdID, devid, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + } + else if (input.data.Cmd == "SetActiveThresholdReq") + { + var actThl = input.data.ActiveThreshold; + var inactThl = input.data.InActiveThreshold; + + ret = ret.concat(getCmdID, devid, (actThl >> 8), (actThl & 0xFF), (inactThl >> 8), (inactThl & 0xFF), 0x00, 0x00, 0x00, 0x00, 0x00); + } + else if (input.data.Cmd == "SetRestoreReportReq") + { + ret = ret.concat(getCmdID, devid, input.data.RestoreReportSet, 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] === CmdNameIDMap["ConfigReportReq"]) + { + data.MinTime = (input.bytes[2]<<8 | input.bytes[3]); + data.MaxTime = (input.bytes[4]<<8 | input.bytes[5]); + data.BatteryChange = input.bytes[6]/10; + data.AccelerationChange = (input.bytes[7]<<8 | input.bytes[8]); + } + else if (input.bytes[0] === CmdNameIDMap["SetActiveThresholdReq"]) + { + data.ActiveThreshold = (input.bytes[2]<<8 | input.bytes[3]); + data.InActiveThreshold = (input.bytes[4]<<8 | input.bytes[5]); + } + else if (input.bytes[0] === CmdNameIDMap["SetRestoreReportReq"]) + { + data.RestoreReportSet = input.bytes[2]; + } + break; + + default: + return { + errors: ['invalid FPort'], + }; + } + + return { + data: data, + }; +} diff --git a/vendor/netvox/payload/r718kb.js b/vendor/netvox/payload/r718kb.js new file mode 100644 index 0000000000..6b46a47ca5 --- /dev/null +++ b/vendor/netvox/payload/r718kb.js @@ -0,0 +1,105 @@ +function getCfgCmd(cmdtype) { + var cfgCmdList = {"ConfigReportReq":0x01,"ConfigReportRsp":0x81,"ReadConfigReportReq":0x02,"ReadConfigReportRsp":0x82}; + return cfgCmdList[cmdtype]; +} + +function getDeviceName(dev) { + var deviceName = { + 0x23:"R718KB" + }; + return deviceName[dev]; +} + +function padLeft(str, len) { + str = '' + str; + if (str.length >= len) { + return str; + } else { + return padLeft("0" + str, len); + } +} + +function decodeUplink(input) { + var data = {}; + var bytes = input.bytes; + var fport = input.fPort; + var res = {"data":data}; + var i = 0; + + if(fport === 6) { + data.Device = getDeviceName(bytes[1]); + + if(bytes[2] === 0x00) { // Startup version report + data.SWver = bytes[3]; + data.HWver = bytes[4]; + data.Datecode = padLeft(bytes[5].toString(16), 2) + padLeft(bytes[6].toString(16), 2) + padLeft(bytes[7].toString(16), 2) + padLeft(bytes[8].toString(16), 2); + } else if(bytes[2] === 0x01) { // Status report + // Fix voltage parsing: use only one byte (bytes[3]) instead of two + data.Volt = bytes[3] / 10; + // Fix resistive value calculation: use bytes 6-8 instead of 4-7 + data.Resistive = bytes[6] * 65536 + bytes[7] * 256 + bytes[8]; + } + } else if(fport === 7) { + data.Device = getDeviceName(bytes[1]); + + if(bytes[0] === 0x81) { // ConfigReportRsp + data.Cmd = 'ConfigReportRsp'; + data.Status = bytes[2] === 0x00 ? 'Success' : 'Failed'; + } else if(bytes[0] === 0x82) { // ReadConfigReportRsp + data.Cmd = 'ReadConfigReportRsp'; + data.MinTime = (bytes[2] << 8) | bytes[3]; + data.MaxTime = (bytes[4] << 8) | bytes[5]; + // Fix BatteryChange: use only one byte (bytes[6]) instead of two + data.BatteryChange = bytes[6] / 10; + // Fix resistive change calculation: use only 3 bytes (bytes 8-10) instead of 4 + data.ResistiveChange = bytes[8] * 65536 + bytes[9] * 256 + bytes[10]; + } + } + + return res; +} + +function encodeDownlink(input) { + var data = input.data; + var res = {"fPort": 7, "bytes":[]}; + + if(data.Cmd === "ConfigReportReq") { + res.bytes = [ + 0x01, 0x23, + data.MinTime >> 8, data.MinTime & 0xFF, + data.MaxTime >> 8, data.MaxTime & 0xFF, + // Fix BatteryChange encoding: use only one byte instead of two + Math.round(data.BatteryChange * 10), + // Add reserved byte after BatteryChange + 0x00, + // Fix ResistiveChange encoding: use only 3 bytes instead of 4 + (data.ResistiveChange >> 16) & 0xFF, (data.ResistiveChange >> 8) & 0xFF, data.ResistiveChange & 0xFF + ]; + } else if(data.Cmd === "ReadConfigReportReq") { + res.bytes = [0x02, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]; + } + + return res; +} + +function decodeDownlink(input) { + var data = {}; + var bytes = input.bytes; + var res = {"data":data}; + + data.Device = getDeviceName(bytes[1]); + + if(bytes[0] === 0x01) { + data.Cmd = 'ConfigReportReq'; + data.MinTime = (bytes[2] << 8) | bytes[3]; + data.MaxTime = (bytes[4] << 8) | bytes[5]; + // Fix BatteryChange decoding: use only one byte instead of two + data.BatteryChange = bytes[6] / 10; + // Fix ResistiveChange decoding: use only 3 bytes instead of 4 + data.ResistiveChange = bytes[8] * 65536 + bytes[9] * 256 + bytes[10]; + } else if(bytes[0] === 0x02) { + data.Cmd = 'ReadConfigReportReq'; + } + + return res; +} \ No newline at end of file diff --git a/vendor/netvox/payload/r718pb15a.js b/vendor/netvox/payload/r718pb15a.js new file mode 100755 index 0000000000..8ab81d9a46 --- /dev/null +++ b/vendor/netvox/payload/r718pb15a.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: "R718PB15A" + }; + return deviceName[dev]; +} + +function getDeviceID(devName){ + var deviceName = { + "R718PB15A": 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/r718pc.js b/vendor/netvox/payload/r718pc.js new file mode 100644 index 0000000000..22ae29fff6 --- /dev/null +++ b/vendor/netvox/payload/r718pc.js @@ -0,0 +1,34 @@ +function getDeviceName(dev) { + var deviceName = { + 0x72:"R718PC" + }; + return deviceName[dev]; +} + +function padLeft(str, len) { + str = '' + str; + if (str.length >= len) { + return str; + } else { + return padLeft("0" + str, len); + } +} + +function decodeUplink(input) { + var data = {}; + var bytes = input.bytes; + var fport = input.fPort; + var res = {"data":data}; + + if(fport === 6) { + data.Device = getDeviceName(bytes[1]); + + if(bytes[2] === 0x00) { // Startup version report + data.SWver = bytes[3]; + data.HWver = bytes[4]; + data.Datecode = padLeft(bytes[5].toString(16), 2) + padLeft(bytes[6].toString(16), 2) + padLeft(bytes[7].toString(16), 2) + padLeft(bytes[8].toString(16), 2); + } + } + + return res; +} \ No newline at end of file diff --git a/vendor/netvox/payload/r900a01.js b/vendor/netvox/payload/r900a01.js new file mode 100755 index 0000000000..9a4feba907 --- /dev/null +++ b/vendor/netvox/payload/r900a01.js @@ -0,0 +1,205 @@ +function getCfgCmd(cfgcmd){ + var cfgcmdlist = { + 1: "ConfigReportReq", + 129: "ConfigReportRsp", + 2: "ReadConfigReportReq", + 130: "ReadConfigReportRsp", + 3: "SetShockSensorSensitivityReq", + 131: "SetShockSensorSensitivityRsp", + 4: "GetShockSensorSensitivityReq", + 132: "GetShockSensorSensitivityRsp", + }; + return cfgcmdlist[cfgcmd]; +} + +function getCmdToID(cmdtype){ + if (cmdtype == "ConfigReportReq") + return 1; + else if (cmdtype == "ConfigReportRsp") + return 129; + else if (cmdtype == "ReadConfigReportReq") + return 2; + else if (cmdtype == "ReadConfigReportRsp") + return 130; + else if (cmdtype == "SetShockSensorSensitivityReq") + return 3; + else if (cmdtype == "SetShockSensorSensitivityRsp") + return 131; + else if (cmdtype == "GetShockSensorSensitivityReq") + return 4; + else if (cmdtype == "GetShockSensorSensitivityRsp") + return 132; +} + +function getDeviceName(dev){ + var deviceName = { + 265: "R900A01", + }; + return deviceName[dev]; +} + +function getDeviceID(devName){ + var deviceName = { + "R900A01": 265, + }; + + 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 22: + if (input.bytes[3] === 0x00) + { + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + data.SWver = input.bytes[4]/10; + data.HWver = input.bytes[5]; + data.Datecode = padLeft(input.bytes[6].toString(16), 2) + padLeft(input.bytes[7].toString(16), 2) + padLeft(input.bytes[8].toString(16), 2) + padLeft(input.bytes[9].toString(16), 2); + + return { + data: data, + }; + } + + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + if (input.bytes[4] & 0x80) + { + var tmp_v = input.bytes[4] & 0x7F; + data.Volt = (tmp_v / 10).toString() + '(low battery)'; + } + else + data.Volt = input.bytes[4]/10; + + if (input.bytes[5] & 0x80) + { + var tmpval = (input.bytes[5]<<8 | input.bytes[6]); + data.Temperature = (0x10000 - tmpval)/100 * -1; + } + else + data.Temperature = (input.bytes[5]<<8 | input.bytes[6])/100+'℃'; + + data.Humidity = (input.bytes[7]<<8 | input.bytes[8])/100+'%'; + + data.LowTemperatureAlarm = input.bytes[9] & 1; + data.HighTemperatureAlarm = input.bytes[9]>>1 & 1; + data.LowHumidityAlarm = input.bytes[9]>>2 & 1; + data.HighHumidityAlarm = input.bytes[9]>>3 & 1; + + if(input.bytes[10] === 0x00){ + data.ShockTamperAlarm = 'NoAlarm'; + }else if(input.bytes[10] === 0x01){ + data.ShockTamperAlarm = 'Alarm'; + } + + break; + + case 23: + data.Cmd = getCfgCmd(input.bytes[0]); + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + if (input.bytes[0] === getCmdToID("ConfigReportRsp") + || input.bytes[0] === getCmdToID("SetShockSensorSensitivityRsp")) + { + data.Status = (input.bytes[3] === 0x00) ? 'Success' : 'Failure'; + } + else if (input.bytes[0] === getCmdToID("ReadConfigReportRsp") ) + { + data.MinTime = (input.bytes[3]<<8 | input.bytes[4]); + data.MaxTime = (input.bytes[5]<<8 | input.bytes[6]); + data.TemperatureChange = (input.bytes[7]<<8 | input.bytes[8])/100+"℃"; + data.HumidityChange = (input.bytes[9]<<8 | input.bytes[10])/100+"%"; + } + else if (input.bytes[0] === getCmdToID("GetShockSensorSensitivityRsp") ) + { + data.ShockSensorSensitivity = input.bytes[3]; + } + + 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; + var temperatureChange = input.data.TemperatureChange*100; + var humidityChange = input.data.HumidityChange*100; + + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF), (mint >> 8), (mint & 0xFF), (maxt >> 8), (maxt & 0xFF), + (temperatureChange >> 8), (temperatureChange & 0xFF),(humidityChange >> 8), (humidityChange & 0xFF)); + } + else if (input.data.Cmd == "ReadConfigReportReq" + || input.data.Cmd == "GetShockSensorSensitivityReq" ) + { + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF)); + } + else if (input.data.Cmd == "SetShockSensorSensitivityReq") + { + var sSensor = input.data.ShockSensorSensitivity; + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF),sSensor); + } + + return { + fPort: 23, + bytes: ret + }; +} + +function decodeDownlink(input) { + var data = {}; + switch (input.fPort) { + case 23: + data.Cmd = getCfgCmd(input.bytes[0]); + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + if (input.bytes[0] === getCmdToID("ConfigReportReq")) + { + data.MinTime = (input.bytes[3]<<8 | input.bytes[4]); + data.MaxTime = (input.bytes[5]<<8 | input.bytes[6]); + data.TemperatureChange = (input.bytes[7]<<8 | input.bytes[8])/100+"℃"; + data.HumidityChange = (input.bytes[9]<<8 | input.bytes[10])/100+"%"; + + } + else if (input.bytes[0] === getCmdToID("SetShockSensorSensitivityReq")) + { + data.ShockSensorSensitivity = input.bytes[3]; + } + + break; + + default: + return { + errors: ['invalid FPort'], + }; + } + + return { + data: data, + }; +} diff --git a/vendor/netvox/payload/r900a01o1.js b/vendor/netvox/payload/r900a01o1.js new file mode 100755 index 0000000000..60f729fc9d --- /dev/null +++ b/vendor/netvox/payload/r900a01o1.js @@ -0,0 +1,325 @@ +function getCfgCmd(cfgcmd){ + var cfgcmdlist = { + 1: "ConfigReportReq", + 129: "ConfigReportRsp", + 2: "ReadConfigReportReq", + 130: "ReadConfigReportRsp", + 3: "SetShockSensorSensitivityReq", + 131: "SetShockSensorSensitivityRsp", + 4: "GetShockSensorSensitivityReq", + 132: "GetShockSensorSensitivityRsp", + + 5: "ConfigDigitalOutPutReq", + 133: "ConfigDigitalOutPutRsp", + 6: "ReadConfigDigitalOutPutReq", + 134: "ReadConfigDigitalOutPutRsp", + 7: "TriggerDigitalOutPutReq", + 135: "TriggerDigitalOutPutRsp", + }; + return cfgcmdlist[cfgcmd]; +} + +function getCmdToID(cmdtype){ + if (cmdtype == "ConfigReportReq") + return 1; + else if (cmdtype == "ConfigReportRsp") + return 129; + else if (cmdtype == "ReadConfigReportReq") + return 2; + else if (cmdtype == "ReadConfigReportRsp") + return 130; + else if (cmdtype == "SetShockSensorSensitivityReq") + return 3; + else if (cmdtype == "SetShockSensorSensitivityRsp") + return 131; + else if (cmdtype == "GetShockSensorSensitivityReq") + return 4; + else if (cmdtype == "GetShockSensorSensitivityRsp") + return 132; + else if (cmdtype == "ConfigDigitalOutPutReq") + return 5; + else if (cmdtype == "ConfigDigitalOutPutRsp") + return 133; + else if (cmdtype == "ReadConfigDigitalOutPutReq") + return 6; + else if (cmdtype == "ReadConfigDigitalOutPutRsp") + return 134; + else if (cmdtype == "TriggerDigitalOutPutReq") + return 7; + else if (cmdtype == "TriggerDigitalOutPutRsp") + return 135; +} + +function getDeviceName(dev){ + var deviceName = { + 273: "R900A01O1", + }; + return deviceName[dev]; +} + +function getDeviceID(devName){ + var deviceName = { + "R900A01O1": 273, + }; + + 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 22: + if (input.bytes[3] === 0x00) + { + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + data.SWver = input.bytes[4]/10; + data.HWver = input.bytes[5]; + data.Datecode = padLeft(input.bytes[6].toString(16), 2) + padLeft(input.bytes[7].toString(16), 2) + padLeft(input.bytes[8].toString(16), 2) + padLeft(input.bytes[9].toString(16), 2); + + return { + data: data, + }; + } + + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + if (input.bytes[4] & 0x80) + { + var tmp_v = input.bytes[4] & 0x7F; + data.Volt = (tmp_v / 10).toString() + '(low battery)'; + } + else + data.Volt = input.bytes[4]/10; + + if (input.bytes[5] & 0x80) + { + var tmpval = (input.bytes[5]<<8 | input.bytes[6]); + data.Temperature = (0x10000 - tmpval)/100 * -1; + } + else + data.Temperature = (input.bytes[5]<<8 | input.bytes[6])/100+'℃'; + + data.Humidity = (input.bytes[7]<<8 | input.bytes[8])/100+'%'; + + data.LowTemperatureAlarm = input.bytes[9] & 1; + data.HighTemperatureAlarm = input.bytes[9]>>1 & 1; + data.LowHumidityAlarm = input.bytes[9]>>2 & 1; + data.HighHumidityAlarm = input.bytes[9]>>3 & 1; + + if(input.bytes[10] === 0x00){ + data.ShockTamperAlarm = 'NoAlarm'; + }else if(input.bytes[10] === 0x01){ + data.ShockTamperAlarm = 'Alarm'; + } + + break; + + case 23: + data.Cmd = getCfgCmd(input.bytes[0]); + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + if (input.bytes[0] === getCmdToID("ConfigReportRsp") + || input.bytes[0] === getCmdToID("SetShockSensorSensitivityRsp") + || input.bytes[0] === getCmdToID("ConfigDigitalOutPutRsp") + || input.bytes[0] === getCmdToID("TriggerDigitalOutPutRsp")) + { + data.Status = (input.bytes[3] === 0x00) ? 'Success' : 'Failure'; + } + else if (input.bytes[0] === getCmdToID("ReadConfigReportRsp") ) + { + data.MinTime = (input.bytes[3]<<8 | input.bytes[4]); + data.MaxTime = (input.bytes[5]<<8 | input.bytes[6]); + data.TemperatureChange = (input.bytes[7]<<8 | input.bytes[8])/100+"℃"; + data.HumidityChange = (input.bytes[9]<<8 | input.bytes[10])/100+"%"; + } + else if (input.bytes[0] === getCmdToID("GetShockSensorSensitivityRsp") ) + { + data.ShockSensorSensitivity = input.bytes[3]; + } + else if (input.bytes[0] === getCmdToID("ReadConfigDigitalOutPutRsp") ) + { + if(input.bytes[3] === 0x00){ + data.DigitalOutPutType = 'NormallyLowLevel'; + }else if(input.bytes[3] === 0x01){ + data.DigitalOutPutType = 'NormallyHighLevel'; + } + data.OutPulseTime = input.bytes[4]+"s"; + data.LowTemperatureAlarm = input.bytes[5] & 1; + data.HighTemperatureAlarm = input.bytes[5]>>1 & 1; + data.LowHumidityAlarm = input.bytes[5]>>2 & 1; + data.HighHumidityAlarm = input.bytes[5]>>3 & 1; + if(input.bytes[6] === 0x00){ + data.Channel = 'Channel1'; + }else if(input.bytes[6] === 0x01){ + data.Channel = 'Channel2'; + } + } + + 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; + var temperatureChange = input.data.TemperatureChange*100; + var humidityChange = input.data.HumidityChange*100; + + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF), (mint >> 8), (mint & 0xFF), (maxt >> 8), (maxt & 0xFF), + (temperatureChange >> 8), (temperatureChange & 0xFF),(humidityChange >> 8), (humidityChange & 0xFF)); + } + else if (input.data.Cmd == "ReadConfigReportReq" + || input.data.Cmd == "GetShockSensorSensitivityReq" ) + { + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF)); + } + else if (input.data.Cmd == "SetShockSensorSensitivityReq") + { + var sSensor = input.data.ShockSensorSensitivity; + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF),sSensor); + } + else if (input.data.Cmd == "ConfigDigitalOutPutReq") + { + var digitalOutPutType; + if(input.data.DigitalOutPutType === 'NormallyLowLevel'){ + digitalOutPutType = 0x00; + }else if(input.data.DigitalOutPutType === 'NormallyHighLevel'){ + digitalOutPutType = 0x01; + } + var outPulseTime = input.data.OutPulseTime; + + var lowTemperatureAlarm = input.data.LowTemperatureAlarm; + var highTemperatureAlarm = input.data.HighTemperatureAlarm; + var lowHumidityAlarm = input.data.LowHumidityAlarm; + var highHumidityAlarm = input.data.HighHumidityAlarm; + + var bindAiarm = lowTemperatureAlarm | highTemperatureAlarm<<1 | lowHumidityAlarm<<2 | highHumidityAlarm<<3; + + var channel; + if(input.data.Channel === 'Channel1'){ + channel = 0x00; + }else if(input.data.Channel === 'Channel2'){ + channel = 0x01; + } + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF),digitalOutPutType,outPulseTime,bindAiarm,channel); + } + else if (input.data.Cmd == "ReadConfigDigitalOutPutReq") + { + var channel; + if(input.data.Channel === 'Channel1'){ + channel = 0x00; + }else if(input.data.Channel === 'Channel2'){ + channel = 0x01; + } + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF),channel); + } + else if (input.data.Cmd == "TriggerDigitalOutPutReq") + { + var outPulseTime = input.data.OutPulseTime; + var channel; + if(input.data.Channel === 'Channel1'){ + channel = 0x00; + }else if(input.data.Channel === 'Channel2'){ + channel = 0x01; + } + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF),outPulseTime,channel); + } + + return { + fPort: 23, + bytes: ret + }; +} + +function decodeDownlink(input) { + var data = {}; + switch (input.fPort) { + case 23: + data.Cmd = getCfgCmd(input.bytes[0]); + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + if (input.bytes[0] === getCmdToID("ConfigReportReq")) + { + data.MinTime = (input.bytes[3]<<8 | input.bytes[4]); + data.MaxTime = (input.bytes[5]<<8 | input.bytes[6]); + data.TemperatureChange = (input.bytes[7]<<8 | input.bytes[8])/100+"℃"; + data.HumidityChange = (input.bytes[9]<<8 | input.bytes[10])/100+"%"; + + } + else if (input.bytes[0] === getCmdToID("SetShockSensorSensitivityReq")) + { + data.ShockSensorSensitivity = input.bytes[3]; + } + else if (input.bytes[0] === getCmdToID("ConfigDigitalOutPutReq")) + { + if(input.bytes[3] === 0x00){ + data.DigitalOutPutType = 'NormallyLowLevel'; + }else if(input.bytes[3] === 0x01){ + data.DigitalOutPutType = 'NormallyHighLevel'; + } + data.OutPulseTime = input.bytes[4]+"s"; + data.LowTemperatureAlarm = input.bytes[5] & 1; + data.HighTemperatureAlarm = input.bytes[5]>>1 & 1; + data.LowHumidityAlarm = input.bytes[5]>>2 & 1; + data.HighHumidityAlarm = input.bytes[5]>>3 & 1; + if(input.bytes[6] === 0x00){ + data.Channel = 'Channel1'; + }else if(input.bytes[6] === 0x01){ + data.Channel = 'Channel2'; + } + } + else if (input.bytes[0] === getCmdToID("ReadConfigDigitalOutPutReq")) + { + if(input.bytes[3] === 0x00){ + data.Channel = 'Channel1'; + }else if(input.bytes[3] === 0x01){ + data.Channel = 'Channel2'; + } + } + else if (input.bytes[0] === getCmdToID("TriggerDigitalOutPutReq")) + { + data.OutPulseTime = input.bytes[3]; + if(input.bytes[4] === 0x00){ + data.Channel = 'Channel1'; + }else if(input.bytes[4] === 0x01){ + data.Channel = 'Channel2'; + } + } + + break; + + default: + return { + errors: ['invalid FPort'], + }; + } + + return { + data: data, + }; +} diff --git a/vendor/netvox/payload/r900a02.js b/vendor/netvox/payload/r900a02.js new file mode 100755 index 0000000000..c1ada489e5 --- /dev/null +++ b/vendor/netvox/payload/r900a02.js @@ -0,0 +1,198 @@ +function getCfgCmd(cfgcmd){ + var cfgcmdlist = { + 1: "ConfigReportReq", + 129: "ConfigReportRsp", + 2: "ReadConfigReportReq", + 130: "ReadConfigReportRsp", + 3: "SetShockSensorSensitivityReq", + 131: "SetShockSensorSensitivityRsp", + 4: "GetShockSensorSensitivityReq", + 132: "GetShockSensorSensitivityRsp", + }; + return cfgcmdlist[cfgcmd]; +} + +function getCmdToID(cmdtype){ + if (cmdtype == "ConfigReportReq") + return 1; + else if (cmdtype == "ConfigReportRsp") + return 129; + else if (cmdtype == "ReadConfigReportReq") + return 2; + else if (cmdtype == "ReadConfigReportRsp") + return 130; + else if (cmdtype == "SetShockSensorSensitivityReq") + return 3; + else if (cmdtype == "SetShockSensorSensitivityRsp") + return 131; + else if (cmdtype == "GetShockSensorSensitivityReq") + return 4; + else if (cmdtype == "GetShockSensorSensitivityRsp") + return 132; +} + +function getDeviceName(dev){ + var deviceName = { + 266: "R900A02", + }; + return deviceName[dev]; +} + +function getDeviceID(devName){ + var deviceName = { + "R900A02": 266, + }; + + 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 22: + if (input.bytes[3] === 0x00) + { + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + data.SWver = input.bytes[4]/10; + data.HWver = input.bytes[5]; + data.Datecode = padLeft(input.bytes[6].toString(16), 2) + padLeft(input.bytes[7].toString(16), 2) + padLeft(input.bytes[8].toString(16), 2) + padLeft(input.bytes[9].toString(16), 2); + + return { + data: data, + }; + } + + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + if (input.bytes[4] & 0x80) + { + var tmp_v = input.bytes[4] & 0x7F; + data.Volt = (tmp_v / 10).toString() + '(low battery)'; + } + else + data.Volt = input.bytes[4]/10; + + if (input.bytes[5] & 0x80) + { + var tmpval = (input.bytes[5]<<8 | input.bytes[6]); + data.Temperature = (0x10000 - tmpval)/100 * -1; + } + else + data.Temperature = (input.bytes[5]<<8 | input.bytes[6])/100+'℃'; + + data.LowTemperatureAlarm = input.bytes[7] & 1; + data.HighTemperatureAlarm = input.bytes[7]>>1 & 1; + + if(input.bytes[8] === 0x00){ + data.ShockTamperAlarm = 'NoAlarm'; + }else if(input.bytes[8] === 0x01){ + data.ShockTamperAlarm = 'Alarm'; + } + + break; + + case 23: + data.Cmd = getCfgCmd(input.bytes[0]); + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + if (input.bytes[0] === getCmdToID("ConfigReportRsp") + || input.bytes[0] === getCmdToID("SetShockSensorSensitivityRsp")) + { + data.Status = (input.bytes[3] === 0x00) ? 'Success' : 'Failure'; + } + else if (input.bytes[0] === getCmdToID("ReadConfigReportRsp") ) + { + data.MinTime = (input.bytes[3]<<8 | input.bytes[4]); + data.MaxTime = (input.bytes[5]<<8 | input.bytes[6]); + data.TemperatureChange = (input.bytes[7]<<8 | input.bytes[8])/100+"℃"; + } + else if (input.bytes[0] === getCmdToID("GetShockSensorSensitivityRsp") ) + { + data.ShockSensorSensitivity = input.bytes[3]; + } + + 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; + var temperatureChange = input.data.TemperatureChange*100; + + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF), (mint >> 8), (mint & 0xFF), (maxt >> 8), (maxt & 0xFF), + (temperatureChange >> 8), (temperatureChange & 0xFF)); + } + else if (input.data.Cmd == "ReadConfigReportReq" + || input.data.Cmd == "GetShockSensorSensitivityReq" ) + { + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF)); + } + else if (input.data.Cmd == "SetShockSensorSensitivityReq") + { + var sSensor = input.data.ShockSensorSensitivity; + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF),sSensor); + } + + return { + fPort: 23, + bytes: ret + }; +} + +function decodeDownlink(input) { + var data = {}; + switch (input.fPort) { + case 23: + data.Cmd = getCfgCmd(input.bytes[0]); + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + if (input.bytes[0] === getCmdToID("ConfigReportReq")) + { + data.MinTime = (input.bytes[3]<<8 | input.bytes[4]); + data.MaxTime = (input.bytes[5]<<8 | input.bytes[6]); + data.TemperatureChange = (input.bytes[7]<<8 | input.bytes[8])/100+"℃"; + + } + else if (input.bytes[0] === getCmdToID("SetShockSensorSensitivityReq")) + { + data.ShockSensorSensitivity = input.bytes[3]; + } + + break; + + default: + return { + errors: ['invalid FPort'], + }; + } + + return { + data: data, + }; +} diff --git a/vendor/netvox/payload/r900a02o1.js b/vendor/netvox/payload/r900a02o1.js new file mode 100755 index 0000000000..6bd7654058 --- /dev/null +++ b/vendor/netvox/payload/r900a02o1.js @@ -0,0 +1,302 @@ +function getCfgCmd(cfgcmd){ + var cfgcmdlist = { + 1: "ConfigReportReq", + 129: "ConfigReportRsp", + 2: "ReadConfigReportReq", + 130: "ReadConfigReportRsp", + 3: "SetShockSensorSensitivityReq", + 131: "SetShockSensorSensitivityRsp", + 4: "GetShockSensorSensitivityReq", + 132: "GetShockSensorSensitivityRsp", + + 5: "ConfigDigitalOutPutReq", + 133: "ConfigDigitalOutPutRsp", + 6: "ReadConfigDigitalOutPutReq", + 134: "ReadConfigDigitalOutPutRsp", + 7: "TriggerDigitalOutPutReq", + 135: "TriggerDigitalOutPutRsp", + }; + return cfgcmdlist[cfgcmd]; +} + +function getCmdToID(cmdtype){ + if (cmdtype == "ConfigReportReq") + return 1; + else if (cmdtype == "ConfigReportRsp") + return 129; + else if (cmdtype == "ReadConfigReportReq") + return 2; + else if (cmdtype == "ReadConfigReportRsp") + return 130; + else if (cmdtype == "SetShockSensorSensitivityReq") + return 3; + else if (cmdtype == "SetShockSensorSensitivityRsp") + return 131; + else if (cmdtype == "GetShockSensorSensitivityReq") + return 4; + else if (cmdtype == "GetShockSensorSensitivityRsp") + return 132; + else if (cmdtype == "ConfigDigitalOutPutReq") + return 5; + else if (cmdtype == "ConfigDigitalOutPutRsp") + return 133; + else if (cmdtype == "ReadConfigDigitalOutPutReq") + return 6; + else if (cmdtype == "ReadConfigDigitalOutPutRsp") + return 134; + else if (cmdtype == "TriggerDigitalOutPutReq") + return 7; + else if (cmdtype == "TriggerDigitalOutPutRsp") + return 135; + + +} + +function getDeviceName(dev){ + var deviceName = { + 274: "R900A02O1", + }; + return deviceName[dev]; +} + +function getDeviceID(devName){ + var deviceName = { + "R900A02O1": 274, + }; + + 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 22: + if (input.bytes[3] === 0x00) + { + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + data.SWver = input.bytes[4]/10; + data.HWver = input.bytes[5]; + data.Datecode = padLeft(input.bytes[6].toString(16), 2) + padLeft(input.bytes[7].toString(16), 2) + padLeft(input.bytes[8].toString(16), 2) + padLeft(input.bytes[9].toString(16), 2); + + return { + data: data, + }; + } + + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + if (input.bytes[4] & 0x80) + { + var tmp_v = input.bytes[4] & 0x7F; + data.Volt = (tmp_v / 10).toString() + '(low battery)'; + } + else + data.Volt = input.bytes[4]/10; + + if (input.bytes[5] & 0x80) + { + var tmpval = (input.bytes[5]<<8 | input.bytes[6]); + data.Temperature = (0x10000 - tmpval)/100 * -1; + } + else + data.Temperature = (input.bytes[5]<<8 | input.bytes[6])/100+'℃'; + + data.LowTemperatureAlarm = input.bytes[7] & 1; + data.HighTemperatureAlarm = input.bytes[7]>>1 & 1; + + if(input.bytes[8] === 0x00){ + data.ShockTamperAlarm = 'NoAlarm'; + }else if(input.bytes[8] === 0x01){ + data.ShockTamperAlarm = 'Alarm'; + } + + break; + + case 23: + data.Cmd = getCfgCmd(input.bytes[0]); + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + if (input.bytes[0] === getCmdToID("ConfigReportRsp") + || input.bytes[0] === getCmdToID("SetShockSensorSensitivityRsp") + || input.bytes[0] === getCmdToID("ConfigDigitalOutPutRsp") + || input.bytes[0] === getCmdToID("TriggerDigitalOutPutRsp")) + { + data.Status = (input.bytes[3] === 0x00) ? 'Success' : 'Failure'; + } + else if (input.bytes[0] === getCmdToID("ReadConfigReportRsp") ) + { + data.MinTime = (input.bytes[3]<<8 | input.bytes[4]); + data.MaxTime = (input.bytes[5]<<8 | input.bytes[6]); + data.TemperatureChange = (input.bytes[7]<<8 | input.bytes[8])/100+"℃"; + } + else if (input.bytes[0] === getCmdToID("GetShockSensorSensitivityRsp") ) + { + data.ShockSensorSensitivity = input.bytes[3]; + } + else if (input.bytes[0] === getCmdToID("ReadConfigDigitalOutPutRsp") ) + { + if(input.bytes[3] === 0x00){ + data.DigitalOutPutType = 'NormallyLowLevel'; + }else if(input.bytes[3] === 0x01){ + data.DigitalOutPutType = 'NormallyHighLevel'; + } + data.OutPulseTime = input.bytes[4]+"s"; + + data.LowTemperatureAlarm = input.bytes[5] & 1; + data.HighTemperatureAlarm = input.bytes[5]>>1 & 1; + if(input.bytes[6] === 0x00){ + data.Channel = 'Channel1'; + }else if(input.bytes[6] === 0x01){ + data.Channel = 'Channel2'; + } + } + + 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; + var temperatureChange = input.data.TemperatureChange*100; + + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF), (mint >> 8), (mint & 0xFF), (maxt >> 8), (maxt & 0xFF), + (temperatureChange >> 8), (temperatureChange & 0xFF)); + } + else if (input.data.Cmd == "ReadConfigReportReq" + || input.data.Cmd == "GetShockSensorSensitivityReq" ) + { + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF)); + } + else if (input.data.Cmd == "SetShockSensorSensitivityReq") + { + var sSensor = input.data.ShockSensorSensitivity; + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF),sSensor); + } + else if (input.data.Cmd == "ConfigDigitalOutPutReq") + { + var digital = input.data.DigitalOutPutType; + var outPulseTime = input.data.OutPulseTime; + var lowTemperature = input.data.LowTemperatureAlarm; + var highTemperature = input.data.HighTemperatureAlarm; + var bindAlarm = lowTemperature | highTemperature<<1 ; + var channel; + if(input.data.Channel === 'Channel1'){ + channel = 0x00; + }else if(input.data.Channel === 'Channel2'){ + channel = 0x01; + } + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF),digital,outPulseTime,bindAlarm,channel); + } + else if (input.data.Cmd == "ReadConfigDigitalOutPutReq") + { + var channel; + if(input.data.Channel === 'Channel1'){ + channel = 0x00; + }else if(input.data.Channel === 'Channel2'){ + channel = 0x01; + } + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF),channel); + } + else if (input.data.Cmd == "TriggerDigitalOutPutReq") + { + var outPulseTime = input.data.OutPulseTime; + var channel; + if(input.data.Channel === 'Channel1'){ + channel = 0x00; + }else if(input.data.Channel === 'Channel2'){ + channel = 0x01; + } + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF),outPulseTime,channel); + } + + return { + fPort: 23, + bytes: ret + }; +} + +function decodeDownlink(input) { + var data = {}; + switch (input.fPort) { + case 23: + data.Cmd = getCfgCmd(input.bytes[0]); + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + if (input.bytes[0] === getCmdToID("ConfigReportReq")) + { + data.MinTime = (input.bytes[3]<<8 | input.bytes[4]); + data.MaxTime = (input.bytes[5]<<8 | input.bytes[6]); + data.TemperatureChange = (input.bytes[7]<<8 | input.bytes[8])/100+"℃"; + + } + else if (input.bytes[0] === getCmdToID("SetShockSensorSensitivityReq")) + { + data.ShockSensorSensitivity = input.bytes[3]; + } + else if (input.bytes[0] === getCmdToID("ConfigDigitalOutPutReq")) + { + data.DigitalOutPutType = input.bytes[3]; + data.OutPulseTime = input.bytes[4] +"s"; + data.LowTemperatureAlarm = input.bytes[5] & 1; + data.HighTemperatureAlarm = input.bytes[5]>>1 & 1; + if(input.bytes[6] === 0x00){ + data.Channel = 'Channel1'; + }else if(input.bytes[6] === 0x01){ + data.Channel = 'Channel2'; + } + } + else if (input.bytes[0] === getCmdToID("ReadConfigDigitalOutPutReq")) + { + if(input.bytes[3] === 0x00){ + data.Channel = 'Channel1'; + }else if(input.bytes[3] === 0x01){ + data.Channel = 'Channel2'; + } + } + else if (input.bytes[0] === getCmdToID("TriggerDigitalOutPutReq")) + { + data.OutPulseTime = input.bytes[3]; + if(input.bytes[4] === 0x00){ + data.Channel = 'Channel1'; + }else if(input.bytes[4] === 0x01){ + data.Channel = 'Channel2'; + } + } + break; + + default: + return { + errors: ['invalid FPort'], + }; + } + + return { + data: data, + }; +} diff --git a/vendor/netvox/payload/r900a03.js b/vendor/netvox/payload/r900a03.js new file mode 100755 index 0000000000..bc5369e0c6 --- /dev/null +++ b/vendor/netvox/payload/r900a03.js @@ -0,0 +1,179 @@ +function getCfgCmd(cfgcmd){ + var cfgcmdlist = { + 1: "ConfigReportReq", + 129: "ConfigReportRsp", + 2: "ReadConfigReportReq", + 130: "ReadConfigReportRsp", + 3: "SetShockSensorSensitivityReq", + 131: "SetShockSensorSensitivityRsp", + 4: "GetShockSensorSensitivityReq", + 132: "GetShockSensorSensitivityRsp", + }; + return cfgcmdlist[cfgcmd]; +} + +function getCmdToID(cmdtype){ + if (cmdtype == "ConfigReportReq") + return 1; + else if (cmdtype == "ConfigReportRsp") + return 129; + else if (cmdtype == "ReadConfigReportReq") + return 2; + else if (cmdtype == "ReadConfigReportRsp") + return 130; + else if (cmdtype == "SetShockSensorSensitivityReq") + return 3; + else if (cmdtype == "SetShockSensorSensitivityRsp") + return 131; + else if (cmdtype == "GetShockSensorSensitivityReq") + return 4; + else if (cmdtype == "GetShockSensorSensitivityRsp") + return 132; +} + +function getDeviceName(dev){ + var deviceName = { + 267: "R900A03", + }; + return deviceName[dev]; +} + +function getDeviceID(devName){ + var deviceName = { + "R900A03": 267, + }; + + 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 22: + if (input.bytes[3] === 0x00) + { + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + data.SWver = input.bytes[4]/10; + data.HWver = input.bytes[5]; + data.Datecode = padLeft(input.bytes[6].toString(16), 2) + padLeft(input.bytes[7].toString(16), 2) + padLeft(input.bytes[8].toString(16), 2) + padLeft(input.bytes[9].toString(16), 2); + + return { + data: data, + }; + } + + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + if (input.bytes[4] & 0x80) + { + var tmp_v = input.bytes[4] & 0x7F; + data.Volt = (tmp_v / 10).toString() + '(low battery)'; + } + else + data.Volt = input.bytes[4]/10; + + data.WaterLeak = (input.bytes[5] === 0x00) ? 'noLeak' : 'Leak'; + data.ShockTamperAlarm = (input.bytes[6] === 0x00) ? 'NoAlarm' : 'Alarm'; + + break; + + case 23: + data.Cmd = getCfgCmd(input.bytes[0]); + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + if (input.bytes[0] === getCmdToID("ConfigReportRsp") + || input.bytes[0] === getCmdToID("SetShockSensorSensitivityRsp")) + { + data.Status = (input.bytes[3] === 0x00) ? 'Success' : 'Failure'; + } + else if (input.bytes[0] === getCmdToID("ReadConfigReportRsp") ) + { + data.MinTime = (input.bytes[3]<<8 | input.bytes[4]); + data.MaxTime = (input.bytes[5]<<8 | input.bytes[6]); + } + else if (input.bytes[0] === getCmdToID("GetShockSensorSensitivityRsp") ) + { + data.ShockSensorSensitivity = input.bytes[3]; + } + + 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>>8), (devid & 0xFF), (mint >> 8), (mint & 0xFF), (maxt >> 8), (maxt & 0xFF)); + } + else if (input.data.Cmd == "ReadConfigReportReq" + || input.data.Cmd == "GetShockSensorSensitivityReq" ) + { + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF)); + } + else if (input.data.Cmd == "SetShockSensorSensitivityReq") + { + var sSensor = input.data.ShockSensorSensitivity; + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF),sSensor); + } + + return { + fPort: 23, + bytes: ret + }; +} + +function decodeDownlink(input) { + var data = {}; + switch (input.fPort) { + case 23: + data.Cmd = getCfgCmd(input.bytes[0]); + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + if (input.bytes[0] === getCmdToID("ConfigReportReq")) + { + data.MinTime = (input.bytes[3]<<8 | input.bytes[4]); + data.MaxTime = (input.bytes[5]<<8 | input.bytes[6]); + } + else if (input.bytes[0] === getCmdToID("SetShockSensorSensitivityReq")) + { + data.ShockSensorSensitivity = input.bytes[3]; + } + + break; + + default: + return { + errors: ['invalid FPort'], + }; + } + + return { + data: data, + }; +} diff --git a/vendor/netvox/payload/r900a03o1.js b/vendor/netvox/payload/r900a03o1.js new file mode 100755 index 0000000000..cf3989cd7e --- /dev/null +++ b/vendor/netvox/payload/r900a03o1.js @@ -0,0 +1,286 @@ +function getCfgCmd(cfgcmd){ + var cfgcmdlist = { + 1: "ConfigReportReq", + 129: "ConfigReportRsp", + 2: "ReadConfigReportReq", + 130: "ReadConfigReportRsp", + 3: "SetShockSensorSensitivityReq", + 131: "SetShockSensorSensitivityRsp", + 4: "GetShockSensorSensitivityReq", + 132: "GetShockSensorSensitivityRsp", + + 5: "ConfigDigitalOutPutReq", + 133: "ConfigDigitalOutPutRsp", + 6: "ReadConfigDigitalOutPutReq", + 134: "ReadConfigDigitalOutPutRsp", + 7: "TriggerDigitalOutPutReq", + 135: "TriggerDigitalOutPutRsp", + }; + return cfgcmdlist[cfgcmd]; +} + +function getCmdToID(cmdtype){ + if (cmdtype == "ConfigReportReq") + return 1; + else if (cmdtype == "ConfigReportRsp") + return 129; + else if (cmdtype == "ReadConfigReportReq") + return 2; + else if (cmdtype == "ReadConfigReportRsp") + return 130; + else if (cmdtype == "SetShockSensorSensitivityReq") + return 3; + else if (cmdtype == "SetShockSensorSensitivityRsp") + return 131; + else if (cmdtype == "GetShockSensorSensitivityReq") + return 4; + else if (cmdtype == "GetShockSensorSensitivityRsp") + return 132; + else if (cmdtype == "ConfigDigitalOutPutReq") + return 5; + else if (cmdtype == "ConfigDigitalOutPutRsp") + return 133; + else if (cmdtype == "ReadConfigDigitalOutPutReq") + return 6; + else if (cmdtype == "ReadConfigDigitalOutPutRsp") + return 134; + else if (cmdtype == "TriggerDigitalOutPutReq") + return 7; + else if (cmdtype == "TriggerDigitalOutPutRsp") + return 135; +} + +function getDeviceName(dev){ + var deviceName = { + 275: "R900A03O1", + }; + return deviceName[dev]; +} + +function getDeviceID(devName){ + var deviceName = { + "R900A03O1": 275, + }; + + 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 22: + if (input.bytes[3] === 0x00) + { + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + data.SWver = input.bytes[4]/10; + data.HWver = input.bytes[5]; + data.Datecode = padLeft(input.bytes[6].toString(16), 2) + padLeft(input.bytes[7].toString(16), 2) + padLeft(input.bytes[8].toString(16), 2) + padLeft(input.bytes[9].toString(16), 2); + + return { + data: data, + }; + } + + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + if (input.bytes[4] & 0x80) + { + var tmp_v = input.bytes[4] & 0x7F; + data.Volt = (tmp_v / 10).toString() + '(low battery)'; + } + else + data.Volt = input.bytes[4]/10; + + data.WaterLeak = (input.bytes[5] === 0x00) ? 'noLeak' : 'Leak'; + data.ShockTamperAlarm = (input.bytes[6] === 0x00) ? 'NoAlarm' : 'Alarm'; + + break; + + case 23: + data.Cmd = getCfgCmd(input.bytes[0]); + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + if (input.bytes[0] === getCmdToID("ConfigReportRsp") + || input.bytes[0] === getCmdToID("SetShockSensorSensitivityRsp") + || input.bytes[0] === getCmdToID("ConfigDigitalOutPutRsp") + || input.bytes[0] === getCmdToID("TriggerDigitalOutPutRsp")) + { + data.Status = (input.bytes[3] === 0x00) ? 'Success' : 'Failure'; + } + else if (input.bytes[0] === getCmdToID("ReadConfigReportRsp") ) + { + data.MinTime = (input.bytes[3]<<8 | input.bytes[4]); + data.MaxTime = (input.bytes[5]<<8 | input.bytes[6]); + } + else if (input.bytes[0] === getCmdToID("GetShockSensorSensitivityRsp") ) + { + data.ShockSensorSensitivity = input.bytes[3]; + } + else if (input.bytes[0] === getCmdToID("ReadConfigDigitalOutPutRsp") ) + { + if(input.bytes[3] === 0x00){ + data.DigitalOutPutType ='NormallyLowLevel' + }else if(input.bytes[3] === 0x01){ + data.DigitalOutPutType ='NormallyHighLevel' + } + data.OutPulseTime = input.bytes[4]; + data.WaterLeak = input.bytes[5] & 1; + if(input.bytes[6] === 0x00){ + data.Channel = 'Channel1'; + }else if(input.bytes[6] === 0x01){ + data.Channel = 'Channel2'; + } + } + + 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>>8), (devid & 0xFF), (mint >> 8), (mint & 0xFF), (maxt >> 8), (maxt & 0xFF)); + } + else if (input.data.Cmd == "ReadConfigReportReq" + || input.data.Cmd == "GetShockSensorSensitivityReq" ) + { + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF)); + } + else if (input.data.Cmd == "SetShockSensorSensitivityReq") + { + var sSensor = input.data.ShockSensorSensitivity; + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF),sSensor); + } + else if (input.data.Cmd == "ConfigDigitalOutPutReq") + { + var digital; + if(input.data.DigitalOutPutType === 'NormallyLowLevel'){ + digital = 0x00; + }else if(input.data.DigitalOutPutType === 'NormallyHighLevel' ){ + digital = 0x01; + } + var outPutType = input.data.OutPulseTime; + var bindAlarm = input.data.WaterLeak; + var channel; + if(input.data.Channel === 'Channel1'){ + channel = 0x00; + }else if(input.data.Channel === 'Channel2'){ + channel = 0x01; + } + + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF),digital,outPutType,bindAlarm,channel); + } + else if (input.data.Cmd == "ReadConfigDigitalOutPutReq") + { + var channel; + if(input.data.Channel === 'Channel1'){ + channel = 0x00; + }else if(input.data.Channel === 'Channel2'){ + channel = 0x01; + } + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF),channel); + } + else if (input.data.Cmd == "TriggerDigitalOutPutReq") + { + var outPulseTime = input.data.OutPulseTime; + var channel; + if(input.data.Channel === 'Channel1'){ + channel = 0x00; + }else if(input.data.Channel === 'Channel2'){ + channel = 0x01; + } + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF),outPulseTime,channel); + } + + return { + fPort: 23, + bytes: ret + }; +} + +function decodeDownlink(input) { + var data = {}; + switch (input.fPort) { + case 23: + data.Cmd = getCfgCmd(input.bytes[0]); + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + if (input.bytes[0] === getCmdToID("ConfigReportReq")) + { + data.MinTime = (input.bytes[3]<<8 | input.bytes[4]); + data.MaxTime = (input.bytes[5]<<8 | input.bytes[6]); + } + else if (input.bytes[0] === getCmdToID("SetShockSensorSensitivityReq")) + { + data.ShockSensorSensitivity = input.bytes[3]; + } + else if (input.bytes[0] === getCmdToID("ConfigDigitalOutPutReq") ) + { + if(input.bytes[3] === 0x00){ + data.DigitalOutPutType ='NormallyLowLevel' + }else if(input.bytes[3] === 0x01){ + data.DigitalOutPutType ='NormallyHighLevel' + } + data.OutPulseTime = input.bytes[4]; + data.WaterLeak = input.bytes[5] & 1; + if(input.bytes[6] === 0x00){ + data.Channel = 'Channel1'; + }else if(input.bytes[6] === 0x01){ + data.Channel = 'Channel2'; + } + } + else if (input.bytes[0] === getCmdToID("ReadConfigDigitalOutPutReq")) + { + if(input.bytes[3] === 0x00){ + data.Channel = 'Channel1'; + }else if(input.bytes[3] === 0x01){ + data.Channel = 'Channel2'; + } + } + else if (input.bytes[0] === getCmdToID("TriggerDigitalOutPutReq")) + { + data.OutPulseTime = input.bytes[3]; + if(input.bytes[4] === 0x00){ + data.Channel = 'Channel1'; + }else if(input.bytes[4] === 0x01){ + data.Channel = 'Channel2'; + } + } + break; + + default: + return { + errors: ['invalid FPort'], + }; + } + + return { + data: data, + }; +} diff --git a/vendor/netvox/payload/r900nac1.js b/vendor/netvox/payload/r900nac1.js new file mode 100755 index 0000000000..41e91ac611 --- /dev/null +++ b/vendor/netvox/payload/r900nac1.js @@ -0,0 +1,191 @@ +function getCfgCmd(cfgcmd){ + var cfgcmdlist = { + 1: "ConfigReportReq", + 129: "ConfigReportRsp", + 2: "ReadConfigReportReq", + 130: "ReadConfigReportRsp", + 3: "SetShockSensorSensitivityReq", + 131: "SetShockSensorSensitivityRsp", + 4: "GetShockSensorSensitivityReq", + 132: "GetShockSensorSensitivityRsp", + }; + return cfgcmdlist[cfgcmd]; +} + +function getCmdToID(cmdtype){ + if (cmdtype == "ConfigReportReq") + return 1; + else if (cmdtype == "ConfigReportRsp") + return 129; + else if (cmdtype == "ReadConfigReportReq") + return 2; + else if (cmdtype == "ReadConfigReportRsp") + return 130; + else if (cmdtype == "SetShockSensorSensitivityReq") + return 3; + else if (cmdtype == "SetShockSensorSensitivityRsp") + return 131; + else if (cmdtype == "GetShockSensorSensitivityReq") + return 4; + else if (cmdtype == "GetShockSensorSensitivityRsp") + return 132; +} + +function getDeviceName(dev){ + var deviceName = { + 256: "R900NAC1", + }; + return deviceName[dev]; +} + +function getDeviceID(devName){ + var deviceName = { + "R900NAC1": 256, + }; + + 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 22: + if (input.bytes[3] === 0x00) + { + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + data.SWver = input.bytes[4]/10; + data.HWver = input.bytes[5]; + data.Datecode = padLeft(input.bytes[6].toString(16), 2) + padLeft(input.bytes[7].toString(16), 2) + padLeft(input.bytes[8].toString(16), 2) + padLeft(input.bytes[9].toString(16), 2); + + return { + data: data, + }; + } + + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + if (input.bytes[4] & 0x80) + { + var tmp_v = input.bytes[4] & 0x7F; + data.Volt = (tmp_v / 10).toString() + '(low battery)'; + } + else + data.Volt = input.bytes[4]/10; + + data.Current1 = (input.bytes[5]<<16 | input.bytes[6]<<8 | input.bytes[7])+"mA"; + + data.LowCurrent1Alarm = input.bytes[8] & 1; + data.HighCurrent1Alarm = input.bytes[8]>>1 & 1; + if(input.bytes[9] === 0x00){ + data.ShockTamperAlarm = 'NoAlarm'; + }else if(input.bytes[9] === 0x01){ + data.ShockTamperAlarm = 'Alarm'; + } + + break; + + case 23: + data.Cmd = getCfgCmd(input.bytes[0]); + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + if (input.bytes[0] === getCmdToID("ConfigReportRsp") + || input.bytes[0] === getCmdToID("SetShockSensorSensitivityRsp")) + { + data.Status = (input.bytes[3] === 0x00) ? 'Success' : 'Failure'; + } + else if (input.bytes[0] === getCmdToID("ReadConfigReportRsp") ) + { + data.MinTime = (input.bytes[3]<<8 | input.bytes[4]); + data.MaxTime = (input.bytes[5]<<8 | input.bytes[6]); + data.CurrentChange = (input.bytes[7]<<8 | input.bytes[8])+"mA"; + } + else if (input.bytes[0] === getCmdToID("GetShockSensorSensitivityRsp") ) + { + data.ShockSensorSensitivity = input.bytes[3]; + } + + 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; + var currentChange = input.data.CurrentChange; + + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF), (mint >> 8), (mint & 0xFF), (maxt >> 8), (maxt & 0xFF), + (currentChange >> 8), (currentChange & 0xFF)); + } + else if (input.data.Cmd == "ReadConfigReportReq" + || input.data.Cmd == "GetShockSensorSensitivityReq" ) + { + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF)); + } + else if (input.data.Cmd == "SetShockSensorSensitivityReq") + { + var sSensor = input.data.ShockSensorSensitivity; + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF),sSensor); + } + + return { + fPort: 23, + bytes: ret + }; +} + +function decodeDownlink(input) { + var data = {}; + switch (input.fPort) { + case 23: + data.Cmd = getCfgCmd(input.bytes[0]); + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + if (input.bytes[0] === getCmdToID("ConfigReportReq")) + { + data.MinTime = (input.bytes[3]<<8 | input.bytes[4]); + data.MaxTime = (input.bytes[5]<<8 | input.bytes[6]); + data.CurrentChange = (input.bytes[7]<<8 | input.bytes[8])+"mA"; + + } + else if (input.bytes[0] === getCmdToID("SetShockSensorSensitivityReq")) + { + data.ShockSensorSensitivity = input.bytes[3]; + } + + break; + + default: + return { + errors: ['invalid FPort'], + }; + } + + return { + data: data, + }; +} diff --git a/vendor/netvox/payload/r900nac3.js b/vendor/netvox/payload/r900nac3.js new file mode 100755 index 0000000000..ccaba9c85e --- /dev/null +++ b/vendor/netvox/payload/r900nac3.js @@ -0,0 +1,198 @@ +function getCfgCmd(cfgcmd){ + var cfgcmdlist = { + 1: "ConfigReportReq", + 129: "ConfigReportRsp", + 2: "ReadConfigReportReq", + 130: "ReadConfigReportRsp", + 3: "SetShockSensorSensitivityReq", + 131: "SetShockSensorSensitivityRsp", + 4: "GetShockSensorSensitivityReq", + 132: "GetShockSensorSensitivityRsp", + }; + return cfgcmdlist[cfgcmd]; +} + +function getCmdToID(cmdtype){ + if (cmdtype == "ConfigReportReq") + return 1; + else if (cmdtype == "ConfigReportRsp") + return 129; + else if (cmdtype == "ReadConfigReportReq") + return 2; + else if (cmdtype == "ReadConfigReportRsp") + return 130; + else if (cmdtype == "SetShockSensorSensitivityReq") + return 3; + else if (cmdtype == "SetShockSensorSensitivityRsp") + return 131; + else if (cmdtype == "GetShockSensorSensitivityReq") + return 4; + else if (cmdtype == "GetShockSensorSensitivityRsp") + return 132; +} + +function getDeviceName(dev){ + var deviceName = { + 257: "R900NAC3", + }; + return deviceName[dev]; +} + +function getDeviceID(devName){ + var deviceName = { + "R900NAC3": 257, + }; + + 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 22: + if (input.bytes[3] === 0x00) + { + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + data.SWver = input.bytes[4]/10; + data.HWver = input.bytes[5]; + data.Datecode = padLeft(input.bytes[6].toString(16), 2) + padLeft(input.bytes[7].toString(16), 2) + padLeft(input.bytes[8].toString(16), 2) + padLeft(input.bytes[9].toString(16), 2); + + return { + data: data, + }; + } + + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + if (input.bytes[4] & 0x80) + { + var tmp_v = input.bytes[4] & 0x7F; + data.Volt = (tmp_v / 10).toString() + '(low battery)'; + } + else + data.Volt = input.bytes[4]/10; + + data.Current1 = (input.bytes[5]<<16 | input.bytes[6]<<8 | input.bytes[7])+'mA'; + data.Current2 = (input.bytes[8]<<16 | input.bytes[9]<<8 | input.bytes[10])+'mA'; + data.Current3 = (input.bytes[11]<<16 | input.bytes[12]<<8 | input.bytes[13])+'mA'; + + data.LowCurrent1Alarm = input.bytes[14] & 1; + data.HighCurrent1Alarm = input.bytes[14]>>1 & 1; + data.LowCurrent2Alarm = input.bytes[14]>>2 & 1; + data.HighCurrent2Alarm = input.bytes[14]>>3 & 1; + data.LowCurrent3Alarm = input.bytes[14]>>4 & 1; + data.HighCurrent3Alarm = input.bytes[14]>>5 & 1; + + if(input.bytes[15] === 0x00){ + data.ShockTamperAlarm = 'NoAlarm'; + }else if(input.bytes[15] === 0x01){ + data.ShockTamperAlarm = 'Alarm'; + } + + break; + + case 23: + data.Cmd = getCfgCmd(input.bytes[0]); + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + if (input.bytes[0] === getCmdToID("ConfigReportRsp") + || input.bytes[0] === getCmdToID("SetShockSensorSensitivityRsp")) + { + data.Status = (input.bytes[3] === 0x00) ? 'Success' : 'Failure'; + } + else if (input.bytes[0] === getCmdToID("ReadConfigReportRsp") ) + { + data.MinTime = (input.bytes[3]<<8 | input.bytes[4]); + data.MaxTime = (input.bytes[5]<<8 | input.bytes[6]); + data.CurrentChange = (input.bytes[7]<<8 | input.bytes[8])+"mA"; + } + else if (input.bytes[0] === getCmdToID("GetShockSensorSensitivityRsp") ) + { + data.ShockSensorSensitivity = input.bytes[3]; + } + + 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; + var currentChange = input.data.CurrentChange; + + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF), (mint >> 8), (mint & 0xFF), (maxt >> 8), (maxt & 0xFF), + (currentChange >> 8), (currentChange & 0xFF)); + } + else if (input.data.Cmd == "ReadConfigReportReq" + || input.data.Cmd == "GetShockSensorSensitivityReq" ) + { + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF)); + } + else if (input.data.Cmd == "SetShockSensorSensitivityReq") + { + var sSensor = input.data.ShockSensorSensitivity; + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF),sSensor); + } + + return { + fPort: 23, + bytes: ret + }; +} + +function decodeDownlink(input) { + var data = {}; + switch (input.fPort) { + case 23: + data.Cmd = getCfgCmd(input.bytes[0]); + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + if (input.bytes[0] === getCmdToID("ConfigReportReq")) + { + data.MinTime = (input.bytes[3]<<8 | input.bytes[4]); + data.MaxTime = (input.bytes[5]<<8 | input.bytes[6]); + data.CurrentChange = (input.bytes[7]<<8 | input.bytes[8])+"mA"; + + } + else if (input.bytes[0] === getCmdToID("SetShockSensorSensitivityReq")) + { + data.ShockSensorSensitivity = input.bytes[3]; + } + + break; + + default: + return { + errors: ['invalid FPort'], + }; + } + + return { + data: data, + }; +} diff --git a/vendor/netvox/payload/r900nac6.js b/vendor/netvox/payload/r900nac6.js new file mode 100755 index 0000000000..f0089f9651 --- /dev/null +++ b/vendor/netvox/payload/r900nac6.js @@ -0,0 +1,208 @@ +function getCfgCmd(cfgcmd){ + var cfgcmdlist = { + 1: "ConfigReportReq", + 129: "ConfigReportRsp", + 2: "ReadConfigReportReq", + 130: "ReadConfigReportRsp", + 3: "SetShockSensorSensitivityReq", + 131: "SetShockSensorSensitivityRsp", + 4: "GetShockSensorSensitivityReq", + 132: "GetShockSensorSensitivityRsp", + }; + return cfgcmdlist[cfgcmd]; +} + +function getCmdToID(cmdtype){ + if (cmdtype == "ConfigReportReq") + return 1; + else if (cmdtype == "ConfigReportRsp") + return 129; + else if (cmdtype == "ReadConfigReportReq") + return 2; + else if (cmdtype == "ReadConfigReportRsp") + return 130; + else if (cmdtype == "SetShockSensorSensitivityReq") + return 3; + else if (cmdtype == "SetShockSensorSensitivityRsp") + return 131; + else if (cmdtype == "GetShockSensorSensitivityReq") + return 4; + else if (cmdtype == "GetShockSensorSensitivityRsp") + return 132; +} + +function getDeviceName(dev){ + var deviceName = { + 258: "R900NAC6", + }; + return deviceName[dev]; +} + +function getDeviceID(devName){ + var deviceName = { + "R900NAC6": 258, + }; + + 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 22: + if (input.bytes[3] === 0x00) + { + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + data.SWver = input.bytes[4]/10; + data.HWver = input.bytes[5]; + data.Datecode = padLeft(input.bytes[6].toString(16), 2) + padLeft(input.bytes[7].toString(16), 2) + padLeft(input.bytes[8].toString(16), 2) + padLeft(input.bytes[9].toString(16), 2); + + return { + data: data, + }; + } + + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + if (input.bytes[4] & 0x80) + { + var tmp_v = input.bytes[4] & 0x7F; + data.Volt = (tmp_v / 10).toString() + '(low battery)'; + } + else + data.Volt = input.bytes[4]/10; + + data.Current1 = (input.bytes[5]<<16 | input.bytes[6]<<8 | input.bytes[7])+'mA'; + data.Current2 = (input.bytes[8]<<16 | input.bytes[9]<<8 | input.bytes[10])+'mA'; + data.Current3 = (input.bytes[11]<<16 | input.bytes[12]<<8 | input.bytes[13])+'mA'; + + data.Current4 = (input.bytes[14]<<16 | input.bytes[15]<<8 | input.bytes[16])+'mA'; + data.Current5 = (input.bytes[17]<<16 | input.bytes[18]<<8 | input.bytes[19])+'mA'; + data.Current6 = (input.bytes[20]<<16 | input.bytes[21]<<8 | input.bytes[22])+'mA'; + + data.LowCurrent1Alarm = (input.bytes[23]<<8 | input.bytes[24]) & 1; + data.HighCurrent1Alarm = (input.bytes[23]<<8 | input.bytes[24])>>1 & 1; + data.LowCurrent2Alarm = (input.bytes[23]<<8 | input.bytes[24])>>2 & 1; + data.HighCurrent2Alarm = (input.bytes[23]<<8 | input.bytes[24])>>3 & 1; + data.LowCurrent3Alarm = (input.bytes[23]<<8 | input.bytes[24])>>4 & 1; + data.HighCurrent3Alarm = (input.bytes[23]<<8 | input.bytes[24])>>5 & 1; + data.LowCurrent4Alarm = (input.bytes[23]<<8 | input.bytes[24])>>6 & 1; + data.HighCurrent4Alarm = (input.bytes[23]<<8 | input.bytes[24])>>7 & 1; + data.LowCurrent5Alarm = (input.bytes[23]<<8 | input.bytes[24])>>8 & 1; + data.HighCurrent5Alarm = (input.bytes[23]<<8 | input.bytes[24])>>9 & 1; + data.LowCurrent6Alarm = (input.bytes[23]<<8 | input.bytes[24])>>10 & 1; + data.HighCurrent6Alarm = (input.bytes[23]<<8 | input.bytes[24])>>11 & 1; + + if(input.bytes[25] === 0x00){ + data.ShockTamperAlarm = 'NoAlarm'; + }else if(input.bytes[25] === 0x01){ + data.ShockTamperAlarm = 'Alarm'; + } + + break; + + case 23: + data.Cmd = getCfgCmd(input.bytes[0]); + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + if (input.bytes[0] === getCmdToID("ConfigReportRsp") + || input.bytes[0] === getCmdToID("SetShockSensorSensitivityRsp")) + { + data.Status = (input.bytes[3] === 0x00) ? 'Success' : 'Failure'; + } + else if (input.bytes[0] === getCmdToID("ReadConfigReportRsp") ) + { + data.MinTime = (input.bytes[3]<<8 | input.bytes[4]); + data.MaxTime = (input.bytes[5]<<8 | input.bytes[6]); + data.CurrentChange = (input.bytes[7]<<8 | input.bytes[8])+"mA"; + } + else if (input.bytes[0] === getCmdToID("GetShockSensorSensitivityRsp") ) + { + data.ShockSensorSensitivity = input.bytes[3]; + } + + 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; + var currentChange = input.data.CurrentChange; + + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF), (mint >> 8), (mint & 0xFF), (maxt >> 8), (maxt & 0xFF), + (currentChange >> 8), (currentChange & 0xFF)); + } + else if (input.data.Cmd == "ReadConfigReportReq" + || input.data.Cmd == "GetShockSensorSensitivityReq" ) + { + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF)); + } + else if (input.data.Cmd == "SetShockSensorSensitivityReq") + { + var sSensor = input.data.ShockSensorSensitivity; + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF),sSensor); + } + + return { + fPort: 23, + bytes: ret + }; +} + +function decodeDownlink(input) { + var data = {}; + switch (input.fPort) { + case 23: + data.Cmd = getCfgCmd(input.bytes[0]); + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + if (input.bytes[0] === getCmdToID("ConfigReportReq")) + { + data.MinTime = (input.bytes[3]<<8 | input.bytes[4]); + data.MaxTime = (input.bytes[5]<<8 | input.bytes[6]); + data.CurrentChange = (input.bytes[7]<<8 | input.bytes[8])+"mA"; + + } + else if (input.bytes[0] === getCmdToID("SetShockSensorSensitivityReq")) + { + data.ShockSensorSensitivity = input.bytes[3]; + } + + break; + + default: + return { + errors: ['invalid FPort'], + }; + } + + return { + data: data, + }; +} diff --git a/vendor/netvox/payload/r900ndc.js b/vendor/netvox/payload/r900ndc.js new file mode 100755 index 0000000000..b3018a3749 --- /dev/null +++ b/vendor/netvox/payload/r900ndc.js @@ -0,0 +1,195 @@ +function getCfgCmd(cfgcmd){ + var cfgcmdlist = { + 1: "ConfigReportReq", + 129: "ConfigReportRsp", + 2: "ReadConfigReportReq", + 130: "ReadConfigReportRsp", + 3: "SetShockSensorSensitivityReq", + 131: "SetShockSensorSensitivityRsp", + 4: "GetShockSensorSensitivityReq", + 132: "GetShockSensorSensitivityRsp", + }; + return cfgcmdlist[cfgcmd]; +} + +function getCmdToID(cmdtype){ + if (cmdtype == "ConfigReportReq") + return 1; + else if (cmdtype == "ConfigReportRsp") + return 129; + else if (cmdtype == "ReadConfigReportReq") + return 2; + else if (cmdtype == "ReadConfigReportRsp") + return 130; + else if (cmdtype == "SetShockSensorSensitivityReq") + return 3; + else if (cmdtype == "SetShockSensorSensitivityRsp") + return 131; + else if (cmdtype == "GetShockSensorSensitivityReq") + return 4; + else if (cmdtype == "GetShockSensorSensitivityRsp") + return 132; +} + +function getDeviceName(dev){ + var deviceName = { + 259: "R900NDC", + }; + return deviceName[dev]; +} + +function getDeviceID(devName){ + var deviceName = { + "R900NDC": 259, + }; + + 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 22: + if (input.bytes[3] === 0x00) + { + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + data.SWver = input.bytes[4]/10; + data.HWver = input.bytes[5]; + data.Datecode = padLeft(input.bytes[6].toString(16), 2) + padLeft(input.bytes[7].toString(16), 2) + padLeft(input.bytes[8].toString(16), 2) + padLeft(input.bytes[9].toString(16), 2); + + return { + data: data, + }; + } + + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + if (input.bytes[4] & 0x80) + { + var tmp_v = input.bytes[4] & 0x7F; + data.Volt = (tmp_v / 10).toString() + '(low battery)'; + } + else + data.Volt = input.bytes[4]/10; + + data.Current1 = (input.bytes[5]<<16 | input.bytes[6]<<8 | input.bytes[7])+'mA'; + data.Current2 = (input.bytes[8]<<16 | input.bytes[9]<<8 | input.bytes[10])+'mA'; + + data.LowCurrent1Alarm = input.bytes[11] & 1; + data.HighCurrent1Alarm = input.bytes[11]>>1 & 1; + data.LowCurrent2Alarm = input.bytes[11]>>2 & 1; + data.HighCurrent2Alarm = input.bytes[11]>>3 & 1; + + if(input.bytes[12] === 0x00){ + data.ShockTamperAlarm = 'NoAlarm'; + }else if(input.bytes[12] === 0x01){ + data.ShockTamperAlarm = 'Alarm'; + } + + break; + + case 23: + data.Cmd = getCfgCmd(input.bytes[0]); + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + if (input.bytes[0] === getCmdToID("ConfigReportRsp") + || input.bytes[0] === getCmdToID("SetShockSensorSensitivityRsp")) + { + data.Status = (input.bytes[3] === 0x00) ? 'Success' : 'Failure'; + } + else if (input.bytes[0] === getCmdToID("ReadConfigReportRsp") ) + { + data.MinTime = (input.bytes[3]<<8 | input.bytes[4]); + data.MaxTime = (input.bytes[5]<<8 | input.bytes[6]); + data.CurrentChange = (input.bytes[7]<<8 | input.bytes[8])+"mA"; + } + else if (input.bytes[0] === getCmdToID("GetShockSensorSensitivityRsp") ) + { + data.ShockSensorSensitivity = input.bytes[3]; + } + + 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; + var currentChange = input.data.CurrentChange; + + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF), (mint >> 8), (mint & 0xFF), (maxt >> 8), (maxt & 0xFF), + (currentChange >> 8), (currentChange & 0xFF)); + } + else if (input.data.Cmd == "ReadConfigReportReq" + || input.data.Cmd == "GetShockSensorSensitivityReq" ) + { + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF)); + } + else if (input.data.Cmd == "SetShockSensorSensitivityReq") + { + var sSensor = input.data.ShockSensorSensitivity; + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF),sSensor); + } + + return { + fPort: 23, + bytes: ret + }; +} + +function decodeDownlink(input) { + var data = {}; + switch (input.fPort) { + case 23: + data.Cmd = getCfgCmd(input.bytes[0]); + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + if (input.bytes[0] === getCmdToID("ConfigReportReq")) + { + data.MinTime = (input.bytes[3]<<8 | input.bytes[4]); + data.MaxTime = (input.bytes[5]<<8 | input.bytes[6]); + data.CurrentChange = (input.bytes[7]<<8 | input.bytes[8])+"mA"; + + } + else if (input.bytes[0] === getCmdToID("SetShockSensorSensitivityReq")) + { + data.ShockSensorSensitivity = input.bytes[3]; + } + + break; + + default: + return { + errors: ['invalid FPort'], + }; + } + + return { + data: data, + }; +} diff --git a/vendor/netvox/payload/r900pb02.js b/vendor/netvox/payload/r900pb02.js new file mode 100755 index 0000000000..a8e000796c --- /dev/null +++ b/vendor/netvox/payload/r900pb02.js @@ -0,0 +1,391 @@ +function getCfgCmd(cfgcmd){ + var cfgcmdlist = { + 1: "ConfigReportReq", + 129: "ConfigReportRsp", + 2: "ReadConfigReportReq", + 130: "ReadConfigReportRsp", + 3: "SetShockSensorSensitivityReq", + 131: "SetShockSensorSensitivityRsp", + 4: "GetShockSensorSensitivityReq", + 132: "GetShockSensorSensitivityRsp", + 5: "SetSoilTypeReq", + 133: "SetSoilTypeRsp", + 6: "GetSoilTypeReq", + 134: "GetSoilTypeRsp", + + 7: "ConfigDryContactPointOutReq", + 135: "ConfigDryContactPointOutRsp", + 8: "ReadConfigDryContactPointOutReq", + 136: "ReadConfigDryContactPointOutRsp", + 9: "TriggerDryContactPointOutReq", + 137: "TriggerDryContactPointOutRsp", + + }; + return cfgcmdlist[cfgcmd]; +} + +function getCmdToID(cmdtype){ + if (cmdtype == "ConfigReportReq") + return 1; + else if (cmdtype == "ConfigReportRsp") + return 129; + else if (cmdtype == "ReadConfigReportReq") + return 2; + else if (cmdtype == "ReadConfigReportRsp") + return 130; + else if (cmdtype == "SetShockSensorSensitivityReq") + return 3; + else if (cmdtype == "SetShockSensorSensitivityRsp") + return 131; + else if (cmdtype == "GetShockSensorSensitivityReq") + return 4; + else if (cmdtype == "GetShockSensorSensitivityRsp") + return 132; + else if (cmdtype == "SetSoilTypeReq") + return 5; + else if (cmdtype == "SetSoilTypeRsp") + return 133; + else if (cmdtype == "GetSoilTypeReq") + return 6; + else if (cmdtype == "GetSoilTypeRsp") + return 134; + else if (cmdtype == "ConfigDryContactPointOutReq") + return 7; + else if (cmdtype == "ConfigDryContactPointOutRsp") + return 135; + else if (cmdtype == "ReadConfigDryContactPointOutReq") + return 8; + else if (cmdtype == "ReadConfigDryContactPointOutRsp") + return 136; + else if (cmdtype == "TriggerDryContactPointOutReq") + return 9; + else if (cmdtype == "TriggerDryContactPointOutRsp") + return 137; +} + +function getDeviceName(dev){ + var deviceName = { + 263: "R900PB02", + 271: "R900PB02O1", + }; + return deviceName[dev]; +} + +function getDeviceID(devName){ + var deviceName = { + "R900PB02": 263, + "R900PB02O1": 271, + }; + + 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 22: + if (input.bytes[3] === 0x00) + { + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + data.SWver = input.bytes[4]/10; + data.HWver = input.bytes[5]; + data.Datecode = padLeft(input.bytes[6].toString(16), 2) + padLeft(input.bytes[7].toString(16), 2) + padLeft(input.bytes[8].toString(16), 2) + padLeft(input.bytes[9].toString(16), 2); + + return { + data: data, + }; + } + + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + if (input.bytes[4] & 0x80) + { + var tmp_v = input.bytes[4] & 0x7F; + data.Volt = (tmp_v / 10).toString() + '(low battery)'; + } + else + data.Volt = input.bytes[4]/10; + + data.Soil_VWC = (input.bytes[5]<<8 | input.bytes[6])/100+"%"; + + if (input.bytes[7] & 0x80) + { + var tmpval = (input.bytes[7]<<8 | input.bytes[8]); + data.Soil_Temperature = (0x10000 - tmpval)/100 * -1+"℃"; + } + else + data.Soil_Temperature = (input.bytes[7]<<8 | input.bytes[8])/100+"℃"; + + data.Soil_EC = (input.bytes[9]<<8 | input.bytes[10])/1000+"ds/m"; + + data.LowSoil_VWCAlarm = input.bytes[11] & 1; + data.HighSoil_VWCAlarm = input.bytes[11]>>1 & 1; + data.LowSoil_TemperatureAlarm = input.bytes[11]>>2 & 1; + data.HighSoil_TemperatureAlarm = input.bytes[11]>>3 & 1; + data.LowSoil_ECAlarm = input.bytes[11]>>4 & 1; + data.HighSoil_ECAlarm = input.bytes[11]>>5 & 1; + if(input.bytes[12] === 0x00){ + data.ShockTamperAlarm = 'NoAlarm'; + }else if(input.bytes[12] === 0x01){ + data.ShockTamperAlarm = 'Alarm'; + } + + break; + + case 23: + data.Cmd = getCfgCmd(input.bytes[0]); + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + if (input.bytes[0] === getCmdToID("ConfigReportRsp") + || input.bytes[0] === getCmdToID("SetShockSensorSensitivityRsp") + || input.bytes[0] === getCmdToID("SetSoilTypeRsp")) + { + data.Status = (input.bytes[3] === 0x00) ? 'Success' : 'Failure'; + } + else if (input.bytes[0] === getCmdToID("ReadConfigReportRsp") ) + { + data.MinTime = (input.bytes[3]<<8 | input.bytes[4]); + data.MaxTime = (input.bytes[5]<<8 | input.bytes[6]); + data.Soil_VWCChange = (input.bytes[7]<<8 | input.bytes[8])/100+"%"; + data.Soil_TemperatureChange = (input.bytes[9]<<8 | input.bytes[10])/100+"℃"; + data.Soil_ECChange = (input.bytes[11]<<8 | input.bytes[12])/1000+"ds/m"; + } + else if (input.bytes[0] === getCmdToID("GetShockSensorSensitivityRsp") ) + { + data.ShockSensorSensitivity = input.bytes[3]; + } + else if (input.bytes[0] === getCmdToID("GetSoilTypeRsp") ) + { + if(input.bytes[3]===0x00){ + data.SoilType = "Mineral Soil"; + }else if(input.bytes[3]===0x01){ + data.SoilType = "SandySoil"; + }else if(input.bytes[3]===0x02){ + data.SoilType = "Clay"; + }else if(input.bytes[3]===0x03){ + data.SoilType = "Organic soil"; + } + } + if(data.Device === "R900PB02O1" && ( + (input.bytes[0] === getCmdToID("ConfigDryContactPointOutRsp")) + || (input.bytes[0] === getCmdToID("TriggerDryContactPointOutRsp")) + )){ + data.Status = (input.bytes[3] === 0x00) ? 'Success' : 'Failure'; + } + else if(data.Device === "R900PB02O1" && + (input.bytes[0] === getCmdToID("ReadConfigDryContactPointOutRsp"))){ + if(input.bytes[3] === 0x00){ + data.DryContactPointOutType = 'NormallyLowLevel'; + }else if(input.bytes[3] === 0x01){ + data.DryContactPointOutType = 'NormallyHighLevel'; + } + data.OutPluseTime = input.bytes[4]+ 's'; + + data.LowSoil_VWCAlarm = input.bytes[5] & 1; + data.HighSoil_VWCAlarm = input.bytes[5]>>1 & 1; + data.LowSoil_TemperatureAlarm = input.bytes[5]>>2 & 1; + data.HighSoil_TemperatureAlarm = input.bytes[5]>>3 & 1; + data.LowSoil_ECAlarm = input.bytes[5]>>4 & 1; + data.HighSoil_ECAlarm = input.bytes[5]>>5 & 1; + if(input.bytes[6] === 0x00){ + data.Channel = 'Channel1'; + }else if(input.bytes[6] === 0x01){ + data.Channel = 'Channel2'; + } + } + 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; + var sVWC = input.data.Soil_VWCChange*100; + var sTemp = input.data.Soil_TemperatureChange*100; + var sEC = input.data.Soil_ECChange*1000; + + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF), (mint >> 8), (mint & 0xFF), (maxt >> 8), (maxt & 0xFF), + (sVWC >> 8), (sVWC & 0xFF), (sTemp >> 8), (sTemp & 0xFF), (sEC >> 8), (sEC & 0xFF)); + } + else if (input.data.Cmd == "ReadConfigReportReq" + || input.data.Cmd == "GetShockSensorSensitivityReq" + || input.data.Cmd == "GetSoilTypeReq") + { + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF)); + } + else if (input.data.Cmd == "SetShockSensorSensitivityReq") + { + var sSensor = input.data.ShockSensorSensitivity; + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF),sSensor); + } + else if (input.data.Cmd == "SetSoilTypeReq") + { + var sSensor = input.data.SoilType; + var value; + if(sSensor==="Mineral Soil"){ + value = 0x00; + }else if(sSensor==="SandySoil"){ + value = 0x01; + }else if(sSensor==="Clay"){ + value = 0x02; + }else if(sSensor==="Organic soil"){ + value = 0x03; + } + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF),value); + } + if(devid===271 && input.data.Cmd == "ConfigDryContactPointOutReq"){ + var dryCont = input.data.DryContactPointOutType; + var dryContValue; + if(dryCont==="NormallyLowLevel"){ + dryContValue = 0x00; + }else if(dryCont==="NormallyHighLevel"){ + dryContValue = 0x01; + } + var outpluse = input.data.OutPluseTime; + var lowSVWC = input.data.LowSoil_VWCAlarm; + var highSVWC = input.data.HighSoil_VWCAlarm; + var lowSTemp = input.data.LowSoil_TemperatureAlarm; + var highSTemp = input.data.HighSoil_TemperatureAlarm; + var lowSEC = input.data.LowSoil_ECAlarm; + var highSEC = input.data.HighSoil_ECAlarm; + var bindAS = lowSVWC | highSVWC<<1 | lowSTemp<<2 | highSTemp<<3 | lowSEC<<4 | highSEC<<5 + var channel = input.data.Channel; + var channelValue; + if(channel==="Channel1"){ + channelValue = 0x00; + }else if(channel==="Channel2"){ + channelValue = 0x01; + } + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF),dryContValue,outpluse,bindAS,channelValue); + } + if(devid===271 && input.data.Cmd == "ReadConfigDryContactPointOutReq"){ + var channel = input.data.Channel; + var channelValue; + if(channel==="Channel1"){ + channelValue = 0x00; + }else if(channel==="Channel2"){ + channelValue = 0x01; + } + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF),channelValue); + } + if(devid===271 && input.data.Cmd == "TriggerDryContactPointOutReq"){ + var outpluse = input.data.OutPluseTime; + var channel = input.data.Channel; + var channelValue; + if(channel==="Channel1"){ + channelValue = 0x00; + }else if(channel==="Channel2"){ + channelValue = 0x01; + } + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF),outpluse,channelValue); +} + return { + fPort: 23, + bytes: ret + }; +} + +function decodeDownlink(input) { + var data = {}; + switch (input.fPort) { + case 23: + data.Cmd = getCfgCmd(input.bytes[0]); + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + if (input.bytes[0] === getCmdToID("ConfigReportReq")) + { + data.MinTime = (input.bytes[3]<<8 | input.bytes[4]); + data.MaxTime = (input.bytes[5]<<8 | input.bytes[6]); + data.Soil_VWCChange = (input.bytes[7]<<8 | input.bytes[8])/100+"%"; + data.Soil_TemperatureChange = (input.bytes[9]<<8 | input.bytes[10])/100+"℃"; + data.Soil_ECChange = (input.bytes[11]<<8 | input.bytes[12])/1000+"ds/m"; + } + else if (input.bytes[0] === getCmdToID("SetShockSensorSensitivityReq")) + { + data.ShockSensorSensitivity = input.bytes[3]; + }else if(input.bytes[0] === getCmdToID("SetSoilTypeReq")){ + if(input.bytes[3]===0x00){ + data.SoilType = "Mineral Soil"; + }else if(input.bytes[3]===0x01){ + data.SoilType = "SandySoil"; + }else if(input.bytes[3]===0x02){ + data.SoilType = "Clay"; + }else if(input.bytes[3]===0x03){ + data.SoilType = "Organic soil"; + } + } + + if (data.Device=="R900PB02O1" && input.bytes[0] === getCmdToID("ConfigDryContactPointOutReq")) + { + if(input.bytes[3] === 0x00){ + data.DryContactPointOutType = 'NormallyLowLevel'; + }else if(input.bytes[3] === 0x01){ + data.DryContactPointOutType = 'NormallyHighLevel'; + } + data.OutPluseTime = input.bytes[4]+ 's'; + + data.LowSoil_VWCAlarm = input.bytes[5] & 1; + data.HighSoil_VWCAlarm = input.bytes[5]>>1 & 1; + data.LowSoil_TemperatureAlarm = input.bytes[5]>>2 & 1; + data.HighSoil_TemperatureAlarm = input.bytes[5]>>3 & 1; + data.LowSoil_ECAlarm = input.bytes[5]>>4 & 1; + data.HighSoil_ECAlarm = input.bytes[5]>>5 & 1; + if(input.bytes[6] === 0x00){ + data.Channel = 'Channel1'; + }else if(input.bytes[6] === 0x01){ + data.Channel = 'Channel2'; + } + } + else if(data.Device=="R900PB02O1" && input.bytes[0] === getCmdToID("ReadConfigDryContactPointOutReq")){ + if(input.bytes[3] === 0x00){ + data.Channel = 'Channel1'; + }else if(input.bytes[3] === 0x01){ + data.Channel = 'Channel2'; + } + } + else if(data.Device=="R900PB02O1" && input.bytes[0] === getCmdToID("TriggerDryContactPointOutReq")){ + data.OutPluseTime = input.bytes[3] + if(input.bytes[4] === 0x00){ + data.Channel = 'Channel1'; + }else if(input.bytes[4] === 0x01){ + data.Channel = 'Channel2'; + } + } + + break; + + default: + return { + errors: ['invalid FPort'], + }; + } + + return { + data: data, + }; +} diff --git a/vendor/netvox/payload/r900pb03.js b/vendor/netvox/payload/r900pb03.js new file mode 100755 index 0000000000..451b32b988 --- /dev/null +++ b/vendor/netvox/payload/r900pb03.js @@ -0,0 +1,403 @@ +function getCfgCmd(cfgcmd){ + var cfgcmdlist = { + 1: "ConfigReportReq", + 129: "ConfigReportRsp", + 2: "ReadConfigReportReq", + 130: "ReadConfigReportRsp", + 3: "SetShockSensorSensitivityReq", + 131: "SetShockSensorSensitivityRsp", + 4: "GetShockSensorSensitivityReq", + 132: "GetShockSensorSensitivityRsp", + 5: "SetOnDistanceThresholdRreq", + 133: "SetOnDistanceThresholdRrsp", + 6: "GetOnDistanceThresholdRreq", + 134: "GetOnDistanceThresholdRrsp", + 7: "SetFillMaxDistanceReq", + 135: "SetFillMaxDistanceRsp", + 8: "GetFillMaxDistanceReq", + 136: "GetFillMaxDistanceRsp", + 9: "SetDeadZoneDistanceReq", + 137: "SetDeadZoneDistanceRsp", + 10: "GetDeadZoneDistanceReq", + 138: "GetDeadZoneDistanceRsp", + + 11: "ConfigDryContactPointOutReq", + 139: "ConfigDryContactPointOutRsp", + 12: "ReadConfigDryContactPointOutReq", + 140: "ReadConfigDryContactPointOutRsp", + 13: "TriggerDryContactPointOutReq", + 141: "TriggerDryContactPointOutRsp", + }; + return cfgcmdlist[cfgcmd]; +} + +function getCmdToID(cmdtype){ + if (cmdtype == "ConfigReportReq") + return 1; + else if (cmdtype == "ConfigReportRsp") + return 129; + else if (cmdtype == "ReadConfigReportReq") + return 2; + else if (cmdtype == "ReadConfigReportRsp") + return 130; + else if (cmdtype == "SetShockSensorSensitivityReq") + return 3; + else if (cmdtype == "SetShockSensorSensitivityRsp") + return 131; + else if (cmdtype == "GetShockSensorSensitivityReq") + return 4; + else if (cmdtype == "GetShockSensorSensitivityRsp") + return 132; + else if (cmdtype == "SetOnDistanceThresholdRreq") + return 5; + else if (cmdtype == "SetOnDistanceThresholdRrsp") + return 133; + else if (cmdtype == "GetOnDistanceThresholdRreq") + return 6; + else if (cmdtype == "GetOnDistanceThresholdRrsp") + return 134; + else if (cmdtype == "SetFillMaxDistanceReq") + return 7; + else if (cmdtype == "SetFillMaxDistanceRsp") + return 135; + else if (cmdtype == "GetFillMaxDistanceReq") + return 8; + else if (cmdtype == "GetFillMaxDistanceRsp") + return 136; + else if (cmdtype == "SetDeadZoneDistanceReq") + return 9; + else if (cmdtype == "SetDeadZoneDistanceRsp") + return 137; + else if (cmdtype == "GetDeadZoneDistanceReq") + return 10; + else if (cmdtype == "GetDeadZoneDistanceRsp") + return 138; + else if (cmdtype == "ConfigDryContactPointOutReq") + return 11; + else if (cmdtype == "ConfigDryContactPointOutRsp") + return 139; + else if (cmdtype == "ReadConfigDryContactPointOutReq") + return 12; + else if (cmdtype == "ReadConfigDryContactPointOutRsp") + return 140; + else if (cmdtype == "TriggerDryContactPointOutReq") + return 13; + else if (cmdtype == "TriggerDryContactPointOutRsp") + return 141; +} + +function getDeviceName(dev){ + var deviceName = { + 264: "R900PB03", + 272: "R900PB03O1", + }; + return deviceName[dev]; +} + +function getDeviceID(devName){ + var deviceName = { + "R900PB03": 264, + "R900PB03O1": 272, + }; + + 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 22: + if (input.bytes[3] === 0x00) + { + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + data.SWver = input.bytes[4]/10; + data.HWver = input.bytes[5]; + data.Datecode = padLeft(input.bytes[6].toString(16), 2) + padLeft(input.bytes[7].toString(16), 2) + padLeft(input.bytes[8].toString(16), 2) + padLeft(input.bytes[9].toString(16), 2); + + return { + data: data, + }; + } + + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + if (input.bytes[4] & 0x80) + { + var tmp_v = input.bytes[4] & 0x7F; + data.Volt = (tmp_v / 10).toString() + '(low battery)'; + } + else + data.Volt = input.bytes[4]/10; + + if(input.bytes[5] === 0x00){ + data.Status = 'Off'; + }else if(input.bytes[5] === 0x01){ + data.Status = 'On'; + } + data.Distance = (input.bytes[6]<<8 | input.bytes[7])+"mm"; + data.FillLevel = input.bytes[8]+"%"; + + data.LowDistanceAlarm = input.bytes[9] & 1; + data.HighDistanceAlarm = input.bytes[9]>>1 & 1; + data.LowFillLevelAlarm = input.bytes[9]>>2 & 1; + data.HighFillLevelAlarm = input.bytes[9]>>3 & 1; + if(input.bytes[10] === 0x00){ + data.ShockTamperAlarm = 'NoAlarm'; + }else if(input.bytes[10] === 0x01){ + data.ShockTamperAlarm = 'Alarm'; + } + + break; + + case 23: + data.Cmd = getCfgCmd(input.bytes[0]); + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + if (input.bytes[0] === getCmdToID("ConfigReportRsp") + || input.bytes[0] === getCmdToID("SetShockSensorSensitivityRsp") + || input.bytes[0] === getCmdToID("SetOnDistanceThresholdRrsp") + || input.bytes[0] === getCmdToID("SetFillMaxDistanceRsp") + || input.bytes[0] === getCmdToID("SetDeadZoneDistanceRsp")) + { + data.Status = (input.bytes[3] === 0x00) ? 'Success' : 'Failure'; + } + else if (input.bytes[0] === getCmdToID("ReadConfigReportRsp") ) + { + data.MinTime = (input.bytes[3]<<8 | input.bytes[4]); + data.MaxTime = (input.bytes[5]<<8 | input.bytes[6]); + data.DistanceChange = (input.bytes[7]<<8 | input.bytes[8])+"mm"; + + } + else if (input.bytes[0] === getCmdToID("GetShockSensorSensitivityRsp") ) + { + data.ShockSensorSensitivity = input.bytes[3]; + } + else if (input.bytes[0] === getCmdToID("GetOnDistanceThresholdRrsp") ) + { + data.OnDistanceThreshold = (input.bytes[3]<<8 | input.bytes[4])+"mm"; + } + else if (input.bytes[0] === getCmdToID("GetFillMaxDistanceRsp") ) + { + data.FillMaxDistance = (input.bytes[3]<<8 | input.bytes[4])+"mm"; + } + else if (input.bytes[0] === getCmdToID("GetDeadZoneDistanceRsp") ) + { + data.DeadZoneDistance = (input.bytes[3]<<8 | input.bytes[4])+"mm"; + } + + + if(data.Device === "R900PB03O1" && ( + (input.bytes[0] === getCmdToID("ConfigDryContactPointOutRsp")) + || (input.bytes[0] === getCmdToID("TriggerDryContactPointOutRsp")) + )){ + data.Status = (input.bytes[3] === 0x00) ? 'Success' : 'Failure'; + } + else if(data.Device === "R900PB03O1" && + (input.bytes[0] === getCmdToID("ReadConfigDryContactPointOutRsp"))){ + if(input.bytes[3] === 0x00){ + data.DryContactPointOutType = 'NormallyLowLevel'; + }else if(input.bytes[3] === 0x01){ + data.DryContactPointOutType = 'NormallyHighLevel'; + } + data.OutPluseTime = input.bytes[4]+ 's'; + + data.LowDistanceAlarm = input.bytes[5] & 1; + data.HighDistanceAlarm = input.bytes[5]>>1 & 1; + data.LowFillLevelAlarm = input.bytes[5]>>2 & 1; + data.HighFillLevelAlarm = input.bytes[5]>>3 & 1; + if(input.bytes[6] === 0x00){ + data.Channel = 'Channel1'; + }else if(input.bytes[6] === 0x01){ + data.Channel = 'Channel2'; + } + } + 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; + var distance = input.data.DistanceChange; + + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF), (mint >> 8), (mint & 0xFF), (maxt >> 8), (maxt & 0xFF), (distance >> 8), (distance & 0xFF)); + } + else if (input.data.Cmd == "ReadConfigReportReq" + || input.data.Cmd == "GetShockSensorSensitivityReq" + || input.data.Cmd == "GetOnDistanceThresholdRreq" + || input.data.Cmd == "GetFillMaxDistanceReq" + || input.data.Cmd == "GetDeadZoneDistanceReq") + { + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF)); + } + else if (input.data.Cmd == "SetShockSensorSensitivityReq") + { + var sSensor = input.data.ShockSensorSensitivity; + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF),sSensor); + } + else if (input.data.Cmd == "SetOnDistanceThresholdRreq") + { + var distance = input.data.OnDistanceThreshold; + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF),(distance>>8), (distance & 0xFF)); + } + else if (input.data.Cmd == "SetFillMaxDistanceReq") + { + var distance = input.data.FillMaxDistance; + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF),(distance>>8), (distance & 0xFF)); + } + else if (input.data.Cmd == "SetDeadZoneDistanceReq") + { + var distance = input.data.DeadZoneDistance; + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF),(distance>>8), (distance & 0xFF)); + } + + if(devid===272 && input.data.Cmd == "ConfigDryContactPointOutReq"){ + var dryCont = input.data.DryContactPointOutType; + var dryContValue; + if(dryCont==="NormallyLowLevel"){ + dryContValue = 0x00; + }else if(dryCont==="NormallyHighLevel"){ + dryContValue = 0x01; + } + var outpluse = input.data.OutPluseTime; + var lowdistance = input.data.LowDistanceAlarm; + var highdistance = input.data.HighDistanceAlarm; + var lowfill = input.data.LowFillLevelAlarm; + var highfill = input.data.HighFillLevelAlarm; + + var bindAS = lowdistance | highdistance<<1 | lowfill<<2 | highfill<<3 + var channel = input.data.Channel; + var channelValue; + if(channel==="Channel1"){ + channelValue = 0x00; + }else if(channel==="Channel2"){ + channelValue = 0x01; + } + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF),dryContValue,outpluse,bindAS,channelValue); + } + if(devid===272 && input.data.Cmd == "ReadConfigDryContactPointOutReq"){ + var channel = input.data.Channel; + var channelValue; + if(channel==="Channel1"){ + channelValue = 0x00; + }else if(channel==="Channel2"){ + channelValue = 0x01; + } + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF),channelValue); + } + if(devid===272 && input.data.Cmd == "TriggerDryContactPointOutReq"){ + var outpluse = input.data.OutPluseTime; + var channel = input.data.Channel; + var channelValue; + if(channel==="Channel1"){ + channelValue = 0x00; + }else if(channel==="Channel2"){ + channelValue = 0x01; + } + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF),outpluse,channelValue); +} + return { + fPort: 23, + bytes: ret + }; +} + +function decodeDownlink(input) { + var data = {}; + switch (input.fPort) { + case 23: + data.Cmd = getCfgCmd(input.bytes[0]); + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + if (input.bytes[0] === getCmdToID("ConfigReportReq")) + { + data.MinTime = (input.bytes[3]<<8 | input.bytes[4]); + data.MaxTime = (input.bytes[5]<<8 | input.bytes[6]); + data.DistanceChange = (input.bytes[7]<<8 | input.bytes[8])+"mm"; + } + else if (input.bytes[0] === getCmdToID("SetShockSensorSensitivityReq")) + { + data.ShockSensorSensitivity = input.bytes[3]; + } + else if(input.bytes[0] === getCmdToID("SetOnDistanceThresholdRreq")){ + data.OnDistanceThreshold = (input.bytes[3]<<8 | input.bytes[4]) +"mm"; + } + else if(input.bytes[0] === getCmdToID("SetFillMaxDistanceReq")){ + data.FillMaxDistance = (input.bytes[3]<<8 | input.bytes[4]) +"mm"; + } + else if(input.bytes[0] === getCmdToID("SetDeadZoneDistanceReq")){ + data.DeadZoneDistance = (input.bytes[3]<<8 | input.bytes[4]) +"mm"; + } + + + + if (data.Device=="R900PB03O1" && input.bytes[0] === getCmdToID("ConfigDryContactPointOutReq")) + { + if(input.bytes[3] === 0x00){ + data.DryContactPointOutType = 'NormallyLowLevel'; + }else if(input.bytes[3] === 0x01){ + data.DryContactPointOutType = 'NormallyHighLevel'; + } + data.OutPluseTime = input.bytes[4]+ 's'; + data.LowDistanceAlarm = input.bytes[5] & 1; + data.HighDistanceAlarm = input.bytes[5]>>1 & 1; + data.LowFillLevelAlarm = input.bytes[5]>>2 & 1; + data.HighFillLevelAlarm = input.bytes[5]>>3 & 1; + if(input.bytes[6] === 0x00){ + data.Channel = 'Channel1'; + }else if(input.bytes[6] === 0x01){ + data.Channel = 'Channel2'; + } + }else if(data.Device=="R900PB03O1" && input.bytes[0] === getCmdToID("ReadConfigDryContactPointOutReq")){ + if(input.bytes[3] === 0x00){ + data.Channel = 'Channel1'; + }else if(input.bytes[3] === 0x01){ + data.Channel = 'Channel2'; + } + } + else if(data.Device=="R900PB03O1" && input.bytes[0] === getCmdToID("TriggerDryContactPointOutReq")){ + data.OutPluseTime = input.bytes[3] + if(input.bytes[4] === 0x00){ + data.Channel = 'Channel1'; + }else if(input.bytes[4] === 0x01){ + data.Channel = 'Channel2'; + } + } + + break; + + default: + return { + errors: ['invalid FPort'], + }; + } + + return { + data: data, + }; +} diff --git a/vendor/netvox/payload/r900pd01.js b/vendor/netvox/payload/r900pd01.js new file mode 100755 index 0000000000..550a694497 --- /dev/null +++ b/vendor/netvox/payload/r900pd01.js @@ -0,0 +1,368 @@ +function getCfgCmd(cfgcmd){ + var cfgcmdlist = { + 1: "ConfigReportReq", + 129: "ConfigReportRsp", + 2: "ReadConfigReportReq", + 130: "ReadConfigReportRsp", + 3: "SetShockSensorSensitivityReq", + 131: "SetShockSensorSensitivityRsp", + 4: "GetShockSensorSensitivityReq", + 132: "GetShockSensorSensitivityRsp", + + 5: "ConfigDryContactPointOutReq", + 133: "ConfigDryContactPointOutRsp", + 6: "ReadConfigDryContactPointOutReq", + 134: "ReadConfigDryContactPointOutRsp", + 7: "TriggerDryContactPointOutReq", + 135: "TriggerDryContactPointOutRsp", + + }; + return cfgcmdlist[cfgcmd]; +} + +function getCmdToID(cmdtype){ + if (cmdtype == "ConfigReportReq") + return 1; + else if (cmdtype == "ConfigReportRsp") + return 129; + else if (cmdtype == "ReadConfigReportReq") + return 2; + else if (cmdtype == "ReadConfigReportRsp") + return 130; + else if (cmdtype == "SetShockSensorSensitivityReq") + return 3; + else if (cmdtype == "SetShockSensorSensitivityRsp") + return 131; + else if (cmdtype == "GetShockSensorSensitivityReq") + return 4; + else if (cmdtype == "GetShockSensorSensitivityRsp") + return 132; + else if (cmdtype == "ConfigDryContactPointOutReq") + return 5; + else if (cmdtype == "ConfigDryContactPointOutRsp") + return 133; + else if (cmdtype == "ReadConfigDryContactPointOutReq") + return 6; + else if (cmdtype == "ReadConfigDryContactPointOutRsp") + return 134; + else if (cmdtype == "TriggerDryContactPointOutReq") + return 7; + else if (cmdtype == "TriggerDryContactPointOutRsp") + return 135; +} + +function getDeviceName(dev){ + var deviceName = { + 262: "R900PD01", + 270: "R900PD01O1", + }; + return deviceName[dev]; +} + +function getDeviceID(devName){ + var deviceName = { + "R900PD01": 262, + "R900PD01O1": 270, + }; + + 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 22: + if (input.bytes[3] === 0x00) + { + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + data.SWver = input.bytes[4]/10; + data.HWver = input.bytes[5]; + data.Datecode = padLeft(input.bytes[6].toString(16), 2) + padLeft(input.bytes[7].toString(16), 2) + padLeft(input.bytes[8].toString(16), 2) + padLeft(input.bytes[9].toString(16), 2); + + return { + data: data, + }; + } + + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + data.PH = (input.bytes[4]<<8 | input.bytes[5])/100+"pH"; + + if (input.bytes[6] & 0x80) + { + var tmpval = (input.bytes[6]<<8 | input.bytes[7]); + data.TemperaturewithPH = (0x10000 - tmpval)/100 * -1+"℃"; + } + else + data.TemperaturewithPH = (input.bytes[6]<<8 | input.bytes[7])/100+"℃"; + + data.NTU = (input.bytes[8]<<8 | input.bytes[9])/10+"ntu"; + if (input.bytes[10] & 0x80) + { + var tmpval = (input.bytes[10]<<8 | input.bytes[11]); + data.TemperaturewithNTU = (0x10000 - tmpval)/100 * -1+"℃"; + } + else + data.TemperaturewithNTU = (input.bytes[10]<<8 | input.bytes[11])/100+"℃"; + data.Residual = (input.bytes[12]<<8 | input.bytes[13])/100+"mg/L"; + + data.LowPHAlarm = (input.bytes[14] | input.bytes[15])& 1; + data.HighPHAlarm = (input.bytes[14]| input.bytes[15])>>1 & 1; + data.LowNTUAlarm = (input.bytes[14]| input.bytes[15])>>2 & 1; + data.HighNTUAlarm = (input.bytes[14]| input.bytes[15])>>3 & 1; + data.LowResidualChlorineAlarm = (input.bytes[14]| input.bytes[15])>>4 & 1; + data.HighResidualChlorineAlarm = (input.bytes[14]| input.bytes[15])>>5 & 1; + data.LowTempWithPHAlarm = (input.bytes[14]| input.bytes[15])>>6 & 1; + data.HighTempWithPHAlarm = (input.bytes[14]| input.bytes[15])>>7 & 1; + data.LowTempWithNTUAlarm = (input.bytes[14]| input.bytes[15])>>8 & 1; + data.HighTempWithNTUAlarm = (input.bytes[14]| input.bytes[15])>>9 & 1; + if(input.bytes[16] === 0x00){ + data.ShockTamperAlarm = 'NoAlarm'; + }else if(input.bytes[16] === 0x01){ + data.ShockTamperAlarm = 'Alarm'; + } + + break; + + case 23: + data.Cmd = getCfgCmd(input.bytes[0]); + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + if (input.bytes[0] === getCmdToID("ConfigReportRsp") + || input.bytes[0] === getCmdToID("SetShockSensorSensitivityRsp")) + { + data.Status = (input.bytes[3] === 0x00) ? 'Success' : 'Failure'; + } + else if (input.bytes[0] === getCmdToID("ReadConfigReportRsp") ) + { + data.MinTime = (input.bytes[3]<<8 | input.bytes[4]); + data.MaxTime = (input.bytes[5]<<8 | input.bytes[6]); + data.PHChange = (input.bytes[7]<<8 | input.bytes[8])/100+"pH"; + data.NTUChange = (input.bytes[9]<<8 | input.bytes[10])/10+"ntu"; + data.ResidualChlorineChange = (input.bytes[11]<<8 | input.bytes[12])/100+"mg/L"; + data.TemperatureChange = (input.bytes[13]<<8 | input.bytes[14])/100+"℃"; + } + else if (input.bytes[0] === getCmdToID("GetShockSensorSensitivityRsp") ) + { + data.ShockSensorSensitivity = input.bytes[3]; + } + + if(data.Device === "R900PD01O1" && ( + (input.bytes[0] === getCmdToID("ConfigDryContactPointOutRsp")) + || (input.bytes[0] === getCmdToID("TriggerDryContactPointOutRsp")) + )){ + data.Status = (input.bytes[3] === 0x00) ? 'Success' : 'Failure'; + } + else if(data.Device === "R900PD01O1" && + (input.bytes[0] === getCmdToID("ReadConfigDryContactPointOutRsp"))){ + if(input.bytes[3] === 0x00){ + data.DryContactPointOutType = 'NormallyLowLevel'; + }else if(input.bytes[3] === 0x01){ + data.DryContactPointOutType = 'NormallyHighLevel'; + } + data.OutPluseTime = input.bytes[4]+ 's'; + + data.LowPHAlarm = (input.bytes[5]| input.bytes[6]) & 1; + data.HighPHAlarm = (input.bytes[5]| input.bytes[6])>>1 & 1; + data.LowNTUAlarm = (input.bytes[5]| input.bytes[6])>>2 & 1; + data.HighNTUAlarm = (input.bytes[5]| input.bytes[6])>>3 & 1; + data.LowResidualChlorineAlarm = (input.bytes[5]| input.bytes[6])>>4 & 1; + data.HighResidualChlorineAlarm = (input.bytes[5]| input.bytes[6])>>5 & 1; + data.LowTempWithPHAlarm = (input.bytes[5]| input.bytes[6])>>6 & 1; + data.HighTempWithPHAlarm = (input.bytes[5]| input.bytes[6])>>7 & 1; + data.LowTempWithNTUAlarm = (input.bytes[5]| input.bytes[6])>>8 & 1; + data.HighTempWithNTUAlarm = (input.bytes[5]| input.bytes[6])>>9 & 1; + + if(input.bytes[7] === 0x00){ + data.Channel = 'Channel1'; + }else if(input.bytes[8] === 0x01){ + data.Channel = 'Channel2'; + } + } + 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; + var ph = input.data.PHChange*100; + var ntu = input.data.NTUChange*10; + var residual = input.data.ResidualChlorineChange*100; + var temperature = input.data.TemperatureChange*100; + + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF), (mint >> 8), (mint & 0xFF), (maxt >> 8), (maxt & 0xFF), + (ph >> 8), (ph & 0xFF), (ntu >> 8), (ntu & 0xFF), + (residual >> 8), (residual & 0xFF), (temperature >> 8), (temperature & 0xFF)); + } + else if (input.data.Cmd == "ReadConfigReportReq" + || input.data.Cmd == "GetShockSensorSensitivityReq" ) + { + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF)); + } + else if (input.data.Cmd == "SetShockSensorSensitivityReq") + { + var sSensor = input.data.ShockSensorSensitivity; + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF),sSensor); + } + if(devid===270 && input.data.Cmd == "ConfigDryContactPointOutReq"){ + var dryCont = input.data.DryContactPointOutType; + var dryContValue; + if(dryCont==="NormallyLowLevel"){ + dryContValue = 0x00; + }else if(dryCont==="NormallyHighLevel"){ + dryContValue = 0x01; + } + var outpluse = input.data.OutPluseTime; + + var lowph = input.data.LowPHAlarm; + var highph = input.data.HighPHAlarm; + var lowntu = input.data.LowNTUAlarm; + var highntu = input.data.HighNTUAlarm; + var lowres = input.data.LowResidualChlorineAlarm; + var highres = input.data.HighResidualChlorineAlarm; + var lowtempph = input.data.LowTempWithPHAlarm; + var hightempph = input.data.HighTempWithPHAlarm; + var lowtempntu = input.data.LowTempWithNTUAlarm; + var hightempntu = input.data.HighTempWithNTUAlarm; + var bindAS = lowph | highph<<1 | lowntu<<2 | highntu<<3 | lowres<<4 | highres<<5 + | lowtempph<<6 | hightempph<<7 | lowtempntu<<8 | hightempntu<<9 + + var channel = input.data.Channel; + var channelValue; + if(channel==="Channel1"){ + channelValue = 0x00; + }else if(channel==="Channel2"){ + channelValue = 0x01; + } + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF),dryContValue,outpluse,(bindAS>>8), (bindAS & 0xFF),channelValue); + } + if(devid===270 && input.data.Cmd == "ReadConfigDryContactPointOutReq"){ + var channel = input.data.Channel; + var channelValue; + if(channel==="Channel1"){ + channelValue = 0x00; + }else if(channel==="Channel2"){ + channelValue = 0x01; + } + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF),channelValue); + } + if(devid===270 && input.data.Cmd == "TriggerDryContactPointOutReq"){ + var outpluse = input.data.OutPluseTime; + var channel = input.data.Channel; + var channelValue; + if(channel==="Channel1"){ + channelValue = 0x00; + }else if(channel==="Channel2"){ + channelValue = 0x01; + } + ret = ret.concat(getCmdID, (devid>>8), (devid & 0xFF),outpluse,channelValue); +} + + return { + fPort: 23, + bytes: ret + }; +} + +function decodeDownlink(input) { + var data = {}; + switch (input.fPort) { + case 23: + data.Cmd = getCfgCmd(input.bytes[0]); + data.Device = getDeviceName((input.bytes[1]<<8 | input.bytes[2])); + if (input.bytes[0] === getCmdToID("ConfigReportReq")) + { + data.MinTime = (input.bytes[3]<<8 | input.bytes[4]); + data.MaxTime = (input.bytes[5]<<8 | input.bytes[6]); + data.PHChange = (input.bytes[7]<<8 | input.bytes[8])/100+"pH"; + data.NTUChange = (input.bytes[9]<<8 | input.bytes[10])/10+"ntu"; + data.ResidualChlorineChange = (input.bytes[11]<<8 | input.bytes[12])/100+"mg/L"; + data.TemperatureChange = (input.bytes[13]<<8 | input.bytes[14])/100+"℃"; + } + else if (input.bytes[0] === getCmdToID("SetShockSensorSensitivityReq")) + { + data.ShockSensorSensitivity = input.bytes[3]; + } + + if (data.Device=="R900PD01O1" && input.bytes[0] === getCmdToID("ConfigDryContactPointOutReq")) + { + if(input.bytes[3] === 0x00){ + data.DryContactPointOutType = 'NormallyLowLevel'; + }else if(input.bytes[3] === 0x01){ + data.DryContactPointOutType = 'NormallyHighLevel'; + } + data.OutPluseTime = input.bytes[4]+ 's'; + + data.LowPHAlarm = (input.bytes[5]| input.bytes[6]) & 1; + data.HighPHAlarm = (input.bytes[5]| input.bytes[6])>>1 & 1; + data.LowNTUAlarm = (input.bytes[5]| input.bytes[6])>>2 & 1; + data.HighNTUAlarm = (input.bytes[5]| input.bytes[6])>>3 & 1; + data.LowResidualChlorineAlarm = (input.bytes[5]| input.bytes[6])>>4 & 1; + data.HighResidualChlorineAlarm = (input.bytes[5]| input.bytes[6])>>5 & 1; + data.LowTempWithPHAlarm = (input.bytes[5]| input.bytes[6])>>6 & 1; + data.HighTempWithPHAlarm = (input.bytes[5]| input.bytes[6])>>7 & 1; + data.LowTempWithNTUAlarm = (input.bytes[5]| input.bytes[6])>>8 & 1; + data.HighTempWithNTUAlarm = (input.bytes[5]| input.bytes[6])>>9 & 1; + + + if(input.bytes[7] === 0x00){ + data.Channel = 'Channel1'; + }else if(input.bytes[7] === 0x01){ + data.Channel = 'Channel2'; + } + } + else if(data.Device=="R900PD01O1" && input.bytes[0] === getCmdToID("ReadConfigDryContactPointOutReq")){ + if(input.bytes[3] === 0x00){ + data.Channel = 'Channel1'; + }else if(input.bytes[3] === 0x01){ + data.Channel = 'Channel2'; + } + } + else if(data.Device=="R900PD01O1" && input.bytes[0] === getCmdToID("TriggerDryContactPointOutReq")){ + data.OutPluseTime = input.bytes[3] + if(input.bytes[4] === 0x00){ + data.Channel = 'Channel1'; + }else if(input.bytes[4] === 0x01){ + data.Channel = 'Channel2'; + } + } + + break; + + default: + return { + errors: ['invalid FPort'], + }; + } + + return { + data: data, + }; +} diff --git a/vendor/netvox/payload/ra02a.js b/vendor/netvox/payload/ra02a.js index a708077320..725cd19a52 100755 --- a/vendor/netvox/payload/ra02a.js +++ b/vendor/netvox/payload/ra02a.js @@ -3,11 +3,7 @@ function getCfgCmd(cfgcmd){ 1: "ConfigReportReq", 129: "ConfigReportRsp", 2: "ReadConfigReportReq", - 130: "ReadConfigReportRsp", - 3: "SetAlarmThresholdReq", - 131: "SetAlarmThresholdRsp", - 4: "GetAlarmThresholdReq", - 132: "GetAlarmThresholdRsp" + 130: "ReadConfigReportRsp" }; return cfgcmdlist[cfgcmd]; } @@ -21,28 +17,18 @@ function getCmdToID(cmdtype){ return 2; else if (cmdtype == "ReadConfigReportRsp") return 130; - else if (cmdtype == "SetAlarmThresholdReq") - return 3; - else if (cmdtype == "SetAlarmThresholdRsp") - return 131; - else if (cmdtype == "GetAlarmThresholdReq") - return 4; - else if (cmdtype == "GetAlarmThresholdRsp") - return 132; } function getDeviceName(dev){ var deviceName = { - 10: "RA02A", - 17: "RA02C" + 10: "RA02A" }; return deviceName[dev]; } function getDeviceID(devName){ var deviceName = { - "RA02A": 10, - "RA02C": 17 + "RA02A": 10 }; return deviceName[devName]; @@ -94,17 +80,12 @@ function decodeUplink(input) { else data.Temp = (input.bytes[6]<<8 | input.bytes[7])/10; } - else if (input.bytes[1] === 0x11) - { - data.COAlarm = (input.bytes[4] == 0x00) ? 'No Alarm' : 'Alarm'; - data.HighTempAlarm = (input.bytes[5] == 0x00) ? 'No Alarm' : 'Alarm'; - } break; case 7: data.Cmd = getCfgCmd(input.bytes[0]); data.Device = getDeviceName(input.bytes[1]); - if ((input.bytes[0] === getCmdToID("ConfigReportRsp")) || (input.bytes[0] === getCmdToID("SetAlarmThresholdRsp"))) + if (input.bytes[0] === getCmdToID("ConfigReportRsp")) { data.Status = (input.bytes[2] === 0x00) ? 'Success' : 'Failure'; } @@ -114,10 +95,6 @@ function decodeUplink(input) { data.MaxTime = (input.bytes[4]<<8 | input.bytes[5]); data.BatteryChange = input.bytes[6]/10; } - else if (input.bytes[0] === getCmdToID("GetAlarmThresholdRsp")) - { - data.AlarmThreshold = input.bytes[2]; - } break; @@ -149,15 +126,10 @@ function encodeDownlink(input) { ret = ret.concat(getCmdID, devid, (mint >> 8), (mint & 0xFF), (maxt >> 8), (maxt & 0xFF), batteryChg, 0x00, 0x00, 0x00, 0x00); } - else if ((input.data.Cmd == "ReadConfigReportReq") || (input.data.Cmd == "GetAlarmThresholdReq")) + else if (input.data.Cmd == "ReadConfigReportReq") { ret = ret.concat(getCmdID, devid, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); } - else if (input.data.Cmd == "SetAlarmThresholdReq") - { - var threshold = input.data.AlarmThreshold; - ret = ret.concat(getCmdID, devid, threshold, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); - } return { fPort: 7, @@ -177,10 +149,6 @@ function decodeDownlink(input) { data.MaxTime = (input.bytes[4]<<8 | input.bytes[5]); data.BatteryChange = input.bytes[6]/10; } - else if (input.bytes[0] === getCmdToID("SetAlarmThresholdReq")) - { - data.AlarmThreshold = input.bytes[2]; - } break; diff --git a/vendor/netvox/payload/ra02c.js b/vendor/netvox/payload/ra02c.js new file mode 100755 index 0000000000..94124b7b69 --- /dev/null +++ b/vendor/netvox/payload/ra02c.js @@ -0,0 +1,181 @@ +function getCfgCmd(cfgcmd){ + var cfgcmdlist = { + 1: "ConfigReportReq", + 129: "ConfigReportRsp", + 2: "ReadConfigReportReq", + 130: "ReadConfigReportRsp", + 3: "SetAlarmThresholdReq", + 131: "SetAlarmThresholdRsp", + 4: "GetAlarmThresholdReq", + 132: "GetAlarmThresholdRsp" + }; + return cfgcmdlist[cfgcmd]; +} + +function getCmdToID(cmdtype){ + if (cmdtype == "ConfigReportReq") + return 1; + else if (cmdtype == "ConfigReportRsp") + return 129; + else if (cmdtype == "ReadConfigReportReq") + return 2; + else if (cmdtype == "ReadConfigReportRsp") + return 130; + else if (cmdtype == "SetAlarmThresholdReq") + return 3; + else if (cmdtype == "SetAlarmThresholdRsp") + return 131; + else if (cmdtype == "GetAlarmThresholdReq") + return 4; + else if (cmdtype == "GetAlarmThresholdRsp") + return 132; +} + +function getDeviceName(dev){ + var deviceName = { + 17: "RA02C" + }; + return deviceName[dev]; +} + +function getDeviceID(devName){ + var deviceName = { + "RA02C": 17 + }; + + 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[1] === 0x11) + { + data.COAlarm = (input.bytes[4] == 0x00) ? 'No Alarm' : 'Alarm'; + data.HighTempAlarm = (input.bytes[5] == 0x00) ? 'No Alarm' : 'Alarm'; + } + break; + + case 7: + data.Cmd = getCfgCmd(input.bytes[0]); + data.Device = getDeviceName(input.bytes[1]); + if ((input.bytes[0] === getCmdToID("ConfigReportRsp")) || (input.bytes[0] === getCmdToID("SetAlarmThresholdRsp"))) + { + 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]); + data.BatteryChange = input.bytes[6]/10; + } + else if (input.bytes[0] === getCmdToID("GetAlarmThresholdRsp")) + { + data.AlarmThreshold = 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; + var batteryChg = input.data.BatteryChange * 10; + + ret = ret.concat(getCmdID, devid, (mint >> 8), (mint & 0xFF), (maxt >> 8), (maxt & 0xFF), batteryChg, 0x00, 0x00, 0x00, 0x00); + } + else if ((input.data.Cmd == "ReadConfigReportReq") || (input.data.Cmd == "GetAlarmThresholdReq")) + { + ret = ret.concat(getCmdID, devid, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + } + else if (input.data.Cmd == "SetAlarmThresholdReq") + { + var threshold = input.data.AlarmThreshold; + ret = ret.concat(getCmdID, devid, threshold, 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]); + data.BatteryChange = input.bytes[6]/10; + } + else if (input.bytes[0] === getCmdToID("SetAlarmThresholdReq")) + { + data.AlarmThreshold = input.bytes[2]; + } + + break; + + default: + return { + errors: ['invalid FPort'], + }; + } + + return { + data: data, + }; +} diff --git a/vendor/netvox/payload/ra02d1.js b/vendor/netvox/payload/ra02d1.js new file mode 100755 index 0000000000..532d0d3d2b --- /dev/null +++ b/vendor/netvox/payload/ra02d1.js @@ -0,0 +1,160 @@ +function getCfgCmd(cfgcmd){ + var cfgcmdlist = { + 1: "ConfigReportReq", + 129: "ConfigReportRsp", + 2: "ReadConfigReportReq", + 130: "ReadConfigReportRsp" + }; + return cfgcmdlist[cfgcmd]; +} + +function getCmdToID(cmdtype){ + if (cmdtype == "ConfigReportReq") + return 1; + else if (cmdtype == "ConfigReportRsp") + return 129; + else if (cmdtype == "ReadConfigReportReq") + return 2; + else if (cmdtype == "ReadConfigReportRsp") + return 130; +} + +function getDeviceName(dev){ + var deviceName = { + 214: "RA02D1", + }; + return deviceName[dev]; +} + +function getDeviceID(devName){ + var deviceName = { + "RA02D1": 214, + }; + + 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; + + data.LPGAlarm = (input.bytes[4] === 0x00)?"noalarm":"alarm"; + data.HighTempAlarm = (input.bytes[5] === 0x00)?"noalarm":"alarm"; + if (input.bytes[6] & 0x80) + { + var tmpval = (input.bytes[6]<<8 | input.bytes[7]); + data.Temp = (0x10000 - tmpval)/10 * -1; + } + else + data.Temp = (input.bytes[6]<<8 | input.bytes[7])/10; + + 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]); + } + + break; + + default: + return { + errors: ['invalid FPort'], + }; + } + + return { + data: data, + }; +} diff --git a/vendor/netvox/payload/ra02g.js b/vendor/netvox/payload/ra02g.js new file mode 100755 index 0000000000..79993bacbe --- /dev/null +++ b/vendor/netvox/payload/ra02g.js @@ -0,0 +1,321 @@ +function getCfgCmd(cfgcmd){ + var cfgcmdlist = { + 1: "ConfigReportReq", + 129: "ConfigReportRsp", + 2: "ReadConfigReportReq", + 130: "ReadConfigReportRsp", + 3: "SetSmokeSensitivityReq", + 131: "SetSmokeSensitivityRsp", + 4: "GetSmokeSensitivityReq", + 132: "GetSmokeSensitivityRsp", + 5: "SetShockSensorSensitivityReq", + 133: "SetShockSensorSensitivityRsp", + 6: "GetShockSensorSensitivityReq", + 134: "GetShockSensorSensitivityRsp", + 7: "SetHighSoundAlarmTriggerThresholdTimeReq", + 135: "SetHighSoundAlarmTriggerThresholdTimeRsp", + 8: "GetHighSoundAlarmTriggerThresholdTimeReq", + 136: "GetHighSoundAlarmTriggerThresholdTimeRsp", + 9: "SetBeeperDurationReq", + 137: "SetBeeperDurationRsp", + 10: "GetBeeperDurationReq", + 138: "GetBeeperDurationRsp", + 11: "StopCurrentBeeperAlarmReq", + 139: "StopCurrentBeeperAlarmRsp", + 12: "SetSmokeDebounceandResumeCheckTimeReq", + 140: "SetSmokeDebounceandResumeCheckTimeRsp", + 13: "GetSmokeDebounceandResumeCheckTimeReq", + 141: "GetSmokeDebounceandResumeCheckTimeRsp" + + }; + return cfgcmdlist[cfgcmd]; +} + +function getCmdToID(cmdtype){ + if (cmdtype == "ConfigReportReq") + return 1; + else if (cmdtype == "ConfigReportRsp") + return 129; + else if (cmdtype == "ReadConfigReportReq") + return 2; + else if (cmdtype == "ReadConfigReportRsp") + return 130; + else if (cmdtype == "SetSmokeSensitivityReq") + return 3; + else if (cmdtype == "SetSmokeSensitivityRsp") + return 131; + else if (cmdtype == "GetSmokeSensitivityReq") + return 4; + else if (cmdtype == "GetSmokeSensitivityRsp") + return 132; + else if (cmdtype == "SetShockSensorSensitivityReq") + return 5; + else if (cmdtype == "SetShockSensorSensitivityRsp") + return 133; + else if (cmdtype == "GetShockSensorSensitivityReq") + return 6; + else if (cmdtype == "GetShockSensorSensitivityRsp") + return 134; + else if (cmdtype == "SetHighSoundAlarmTriggerThresholdTimeReq") + return 7; + else if (cmdtype == "SetHighSoundAlarmTriggerThresholdTimeRsp") + return 135; + else if (cmdtype == "GetHighSoundAlarmTriggerThresholdTimeReq") + return 8; + else if (cmdtype == "GetHighSoundAlarmTriggerThresholdTimeRsp") + return 136; + else if (cmdtype == "SetBeeperDurationReq") + return 9; + else if (cmdtype == "SetBeeperDurationRsp") + return 137; + else if (cmdtype == "GetBeeperDurationReq") + return 10; + else if (cmdtype == "GetBeeperDurationRsp") + return 138; + else if (cmdtype == "StopCurrentBeeperAlarmReq") + return 11; + else if (cmdtype == "StopCurrentBeeperAlarmRsp") + return 139; + else if (cmdtype == "SetSmokeDebounceandResumeCheckTimeReq") + return 12; + else if (cmdtype == "SetSmokeDebounceandResumeCheckTimeRsp") + return 140; + else if (cmdtype == "GetSmokeDebounceandResumeCheckTimeReq") + return 13; + else if (cmdtype == "GetSmokeDebounceandResumeCheckTimeRsp") + return 141; +} + +function getDeviceName(dev){ + var deviceName = { + 215: "RA02G" + }; + return deviceName[dev]; +} + +function getDeviceID(devName){ + var deviceName = { + "RA02G": 215 + }; + return deviceName[devName]; +} + +function getSmokesensorSensitivityType(id){ + var type = { + 0X00:"accroding the hardware sensitivity knob", + 0X01:"Level1", + 0X02:"Level2", + 0X03:"Level3", + 0X04:"Level4", + }; + return type[id]; +} +function getTypeByName(name){ + var typeList = { + "accroding the hardware sensitivity knob":"0X00", + "Level1":0X01, + "Level2":0X02, + "Level3":0X03, + "Level4":0X04 + }; + return typeList[name]; +} +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; + + data.IncenseSmokeAlarm = (input.bytes[4] == 0x00) ? 'No Alarm' : 'Alarm'; + data.HighSoundAlarm = (input.bytes[5] == 0x00) ? 'No Alarm' : 'Alarm'; + data.TemShockTamperAlarmp = (input.bytes[6] == 0x00) ? 'No Alarm' : 'Alarm'; + data.PowerOffAlarm = (input.bytes[7] == 0x00) ? 'No Alarm' : 'Alarm'; + break; + + case 7: + data.Cmd = getCfgCmd(input.bytes[0]); + data.Device = getDeviceName(input.bytes[1]); + + if ((input.bytes[0] === getCmdToID("ConfigReportRsp")) + || (input.bytes[0] === getCmdToID("SetSmokeSensitivityRsp")) + || (input.bytes[0] === getCmdToID("SetShockSensorSensitivityRsp")) + || (input.bytes[0] === getCmdToID("SetHighSoundAlarmTriggerThresholdTimeRsp")) + || (input.bytes[0] === getCmdToID("SetBeeperDurationRsp")) + || (input.bytes[0] === getCmdToID("StopCurrentBeeperAlarmRsp")) + || (input.bytes[0] === getCmdToID("SetSmokeDebounceandResumeCheckTimeRsp"))) + { + 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]); + } + else if (input.bytes[0] === getCmdToID("GetSmokeSensitivityRsp")) + { + data.SmokesensorSensitivity = getSmokesensorSensitivityType(input.bytes[2]); + }else if (input.bytes[0] === getCmdToID("GetShockSensorSensitivityRsp")) + { + data.ShockSensorSensitivity = input.bytes[2]; + }else if (input.bytes[0] === getCmdToID("GetHighSoundAlarmTriggerThresholdTimeRsp")) + { + data.HighSoundAlarmTriggerThreshold = (input.bytes[2]<<8 | input.bytes[3]); + data.HighSoundAlarmTriggerDuration = (input.bytes[4]<<8 | input.bytes[5]); + }else if (input.bytes[0] === getCmdToID("GetBeeperDurationRsp")) + { + data.BeeperDuration = (input.bytes[2]<<8 | input.bytes[3]) ==0?"DisableBeeper":(input.bytes[2]<<8 | input.bytes[3]); + data.AlarmSoundLevel = input.bytes[4]; + }else if (input.bytes[0] === getCmdToID("GetSmokeDebounceandResumeCheckTimeRsp")) + { + data.SmokeDebounceTIme = (input.bytes[2]<<8 | input.bytes[3]); + data.SmokeResumeTime = input.bytes[4]; + } + + 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 == "GetSmokeSensitivityReq") + ||(input.data.Cmd == "GetShockSensorSensitivityReq") + ||(input.data.Cmd == "GetHighSoundAlarmTriggerThresholdTimeReq") + ||(input.data.Cmd == "GetBeeperDurationReq") + ||(input.data.Cmd == "StopCurrentBeeperAlarmReq") + ||(input.data.Cmd == "GetSmokeDebounceandResumeCheckTimeReq")) + { + ret = ret.concat(getCmdID, devid, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + } + else if (input.data.Cmd == "SetSmokeSensitivityReq") + { + var smokesensor = getTypeByName(input.data.SmokesensorSensitivity); + ret = ret.concat(getCmdID, devid, smokesensor, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + } + else if (input.data.Cmd == "SetShockSensorSensitivityReq") + { + var shockSensor = input.data.ShockSensorSensitivity; + ret = ret.concat(getCmdID, devid, shockSensor, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + } + else if (input.data.Cmd == "SetHighSoundAlarmTriggerThresholdTimeReq") + { + var highSoundAlarmThreshold = input.data.HighSoundAlarmTriggerThreshold; + var highSoundAlarmDuration = input.data.HighSoundAlarmTriggerDuration; + ret = ret.concat(getCmdID, devid, (highSoundAlarmThreshold >> 8), (highSoundAlarmThreshold & 0xFF),(highSoundAlarmDuration >> 8), (highSoundAlarmDuration & 0xFF), 0x00, 0x00, 0x00, 0x00, 0x00); + } + else if (input.data.Cmd == "SetBeeperDurationReq") + { + var beeper = input.data.BeeperDuration=="DisableBeeper"? 0x0000:input.data.BeeperDuration; + var alarm = input.data.AlarmSoundLevel; + ret = ret.concat(getCmdID, devid, (beeper >> 8), (beeper & 0xFF), alarm, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + } + else if (input.data.Cmd == "SetSmokeDebounceandResumeCheckTimeReq") + { + var debounce = input.data.SmokeDebounceTIme; + var smokeResume = input.data.SmokeResumeTime; + ret = ret.concat(getCmdID, devid, (debounce >> 8), (debounce & 0xFF), smokeResume, 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("SetSmokeSensitivityReq")) + { + data.SmokesensorSensitivity= getSmokesensorSensitivityType(input.bytes[2]); + } + else if (input.bytes[0] === getCmdToID("SetShockSensorSensitivityReq")) + { + data.ShockSensorSensitivity= input.bytes[2]; + } + else if (input.bytes[0] === getCmdToID("SetHighSoundAlarmTriggerThresholdTimeReq")) + { + data.HighSoundAlarmTriggerThreshold= (input.bytes[2]<<8 | input.bytes[3]); + data.HighSoundAlarmTriggerDuration= (input.bytes[4]<<8 | input.bytes[5]); + } + else if (input.bytes[0] === getCmdToID("SetBeeperDurationReq")) + { + data.BeeperDuration = (input.bytes[2]<<8 | input.bytes[3]) ==0?"DisableBeeper":(input.bytes[2]<<8 | input.bytes[3]); + data.AlarmSoundLevel = input.bytes[4]; + } + else if (input.bytes[0] === getCmdToID("SetSmokeDebounceandResumeCheckTimeReq")) + { + data.SmokeDebounceTIme = (input.bytes[2]<<8 | input.bytes[3]); + data.SmokeResumeTime = input.bytes[4]; + } + + break; + + default: + return { + errors: ['invalid FPort'], + }; + } + + return { + data: data, + }; +} diff --git a/vendor/netvox/photos/r315la.jpg b/vendor/netvox/photos/r315la.jpg new file mode 100644 index 0000000000..29b4be6635 Binary files /dev/null and b/vendor/netvox/photos/r315la.jpg differ diff --git a/vendor/netvox/photos/r602b.png b/vendor/netvox/photos/r602b.png new file mode 100644 index 0000000000..255d78964f Binary files /dev/null and b/vendor/netvox/photos/r602b.png differ diff --git a/vendor/netvox/photos/r603.png b/vendor/netvox/photos/r603.png new file mode 100644 index 0000000000..ec919ad859 Binary files /dev/null and b/vendor/netvox/photos/r603.png differ diff --git a/vendor/netvox/photos/r718ce.jpg b/vendor/netvox/photos/r718ce.jpg new file mode 100644 index 0000000000..d8a407abe5 Binary files /dev/null and b/vendor/netvox/photos/r718ce.jpg differ diff --git a/vendor/netvox/photos/r718ce2.jpg b/vendor/netvox/photos/r718ce2.jpg new file mode 100644 index 0000000000..d8a407abe5 Binary files /dev/null and b/vendor/netvox/photos/r718ce2.jpg differ diff --git a/vendor/netvox/photos/r718ce4.jpg b/vendor/netvox/photos/r718ce4.jpg new file mode 100644 index 0000000000..d8a407abe5 Binary files /dev/null and b/vendor/netvox/photos/r718ce4.jpg differ diff --git a/vendor/netvox/photos/r718cj.jpg b/vendor/netvox/photos/r718cj.jpg new file mode 100644 index 0000000000..d8a407abe5 Binary files /dev/null and b/vendor/netvox/photos/r718cj.jpg differ diff --git a/vendor/netvox/photos/r718cj2.jpg b/vendor/netvox/photos/r718cj2.jpg new file mode 100644 index 0000000000..d8a407abe5 Binary files /dev/null and b/vendor/netvox/photos/r718cj2.jpg differ diff --git a/vendor/netvox/photos/r718cj4.jpg b/vendor/netvox/photos/r718cj4.jpg new file mode 100644 index 0000000000..d8a407abe5 Binary files /dev/null and b/vendor/netvox/photos/r718cj4.jpg differ diff --git a/vendor/netvox/photos/r718ec.jpg b/vendor/netvox/photos/r718ec.jpg new file mode 100644 index 0000000000..e6392f877b Binary files /dev/null and b/vendor/netvox/photos/r718ec.jpg differ diff --git a/vendor/netvox/photos/r718kb.jpg b/vendor/netvox/photos/r718kb.jpg new file mode 100644 index 0000000000..d8a407abe5 Binary files /dev/null and b/vendor/netvox/photos/r718kb.jpg differ diff --git a/vendor/netvox/photos/r718pc.jpg b/vendor/netvox/photos/r718pc.jpg new file mode 100644 index 0000000000..ec76241b63 Binary files /dev/null and b/vendor/netvox/photos/r718pc.jpg differ diff --git a/vendor/netvox/photos/r900a01.png b/vendor/netvox/photos/r900a01.png new file mode 100755 index 0000000000..f0c6255011 Binary files /dev/null and b/vendor/netvox/photos/r900a01.png differ diff --git a/vendor/netvox/photos/r900a01o1.png b/vendor/netvox/photos/r900a01o1.png new file mode 100755 index 0000000000..4b427a2677 Binary files /dev/null and b/vendor/netvox/photos/r900a01o1.png differ diff --git a/vendor/netvox/photos/r900a02.png b/vendor/netvox/photos/r900a02.png new file mode 100755 index 0000000000..dafe1fd63f Binary files /dev/null and b/vendor/netvox/photos/r900a02.png differ diff --git a/vendor/netvox/photos/r900a02o1.png b/vendor/netvox/photos/r900a02o1.png new file mode 100755 index 0000000000..e49ead571f Binary files /dev/null and b/vendor/netvox/photos/r900a02o1.png differ diff --git a/vendor/netvox/photos/r900a03.png b/vendor/netvox/photos/r900a03.png new file mode 100755 index 0000000000..bb1ce5c797 Binary files /dev/null and b/vendor/netvox/photos/r900a03.png differ diff --git a/vendor/netvox/photos/r900a03o1.png b/vendor/netvox/photos/r900a03o1.png new file mode 100755 index 0000000000..d6c58ac017 Binary files /dev/null and b/vendor/netvox/photos/r900a03o1.png differ diff --git a/vendor/netvox/photos/r900pb02.png b/vendor/netvox/photos/r900pb02.png new file mode 100644 index 0000000000..d0688862d5 Binary files /dev/null and b/vendor/netvox/photos/r900pb02.png differ diff --git a/vendor/netvox/photos/r900pb02o1.png b/vendor/netvox/photos/r900pb02o1.png new file mode 100644 index 0000000000..d2d6907cab Binary files /dev/null and b/vendor/netvox/photos/r900pb02o1.png differ diff --git a/vendor/netvox/photos/r900pb03.png b/vendor/netvox/photos/r900pb03.png new file mode 100644 index 0000000000..7761e9e829 Binary files /dev/null and b/vendor/netvox/photos/r900pb03.png differ diff --git a/vendor/netvox/photos/r900pb03o1.png b/vendor/netvox/photos/r900pb03o1.png new file mode 100644 index 0000000000..54c34ebf56 Binary files /dev/null and b/vendor/netvox/photos/r900pb03o1.png differ diff --git a/vendor/netvox/photos/r900pd01.png b/vendor/netvox/photos/r900pd01.png new file mode 100755 index 0000000000..9cb570635d Binary files /dev/null and b/vendor/netvox/photos/r900pd01.png differ diff --git a/vendor/netvox/photos/r900pd01o1.png b/vendor/netvox/photos/r900pd01o1.png new file mode 100755 index 0000000000..7e1f97da2e Binary files /dev/null and b/vendor/netvox/photos/r900pd01o1.png differ diff --git a/vendor/netvox/photos/ra02d1.png b/vendor/netvox/photos/ra02d1.png new file mode 100644 index 0000000000..8491347584 Binary files /dev/null and b/vendor/netvox/photos/ra02d1.png differ diff --git a/vendor/netvox/photos/ra02g.png b/vendor/netvox/photos/ra02g.png new file mode 100644 index 0000000000..deb169c093 Binary files /dev/null and b/vendor/netvox/photos/ra02g.png differ diff --git a/vendor/netvox/r211-codec.yaml b/vendor/netvox/r211-codec.yaml index 0ab8669d9f..98abd0dd9f 100755 --- a/vendor/netvox/r211-codec.yaml +++ b/vendor/netvox/r211-codec.yaml @@ -12,6 +12,17 @@ uplinkDecoder: HWver: 11 Datecode: '20200424' + - description: Startup version report + input: + fPort: 6 + bytes: [0x01, 0x0F, 0x80, 0x0A, 0x05, 0x20, 0x21, 0x08, 0x13, 0x00, 0x00] + output: + data: + Device: 'R211' + SWver: 1 + HWver: 05 + Datecode: '20210813' + - description: Air IR apply response input: fPort: 33 diff --git a/vendor/netvox/r315-codec.yaml b/vendor/netvox/r315-codec.yaml index 3ec0283833..4ba9466b04 100755 --- a/vendor/netvox/r315-codec.yaml +++ b/vendor/netvox/r315-codec.yaml @@ -25,6 +25,80 @@ uplinkDecoder: Temp: 27.80 Humi: 53 + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0xD2, 0x02, 0x1C, 0x08, 0x03, 0x39, 0x12, 0x00, 0x00, 0x00] + output: + data: + Device: 'R315' + Volt: 2.8 + Illuminance: '2051Lux' + LowTemperatureAlarm: 1 + HighTemperatureAlarm: 0 + LowHumidityAlarm: 0 + HighHumidityAlarm: 1 + LowIlluminanceAlarm: 1 + HighIlluminanceAlarm: 1 + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0xD2, 0x011, 0x1C, 0x01, 0x03, 0x39, 0x12, 0x80, 0x00, 0x00] + output: + data: + Device: 'R315' + Volt: 2.8 + THSensor: 1 + LightSensor: 0 + PIRSensor: 0 + EmergenceButton: 1 + TiltSensor: 1 + InternalContactSwitch: 1 + ExternalContactSwitch1: 0 + ExternalContactSwitch2: 0 + InternalShockSensor: 1 + ExternalShockSensor: 1 + ExternalDryContactPointIN: 0 + DryContactPointOut: 0 + ExternalWaterLeakSenor1: 0 + ExternalWaterLeakSenor2: 0 + ExternalSeatSensor: 0 + ExternalGlassSensor1: 0 + ExternalGlassSensor2: 1 + PIRSensorState: 0 + EmergenceButtonaLAlarmState: 0 + TiltSensorState: 0 + InternalContactSwitchSensorState: 0 + ExternalContactSwitch1SensorState: 0 + ExternalContactSwitch2SensorState: 0 + InternalShockSensorState: 0 + ExternalShockSensorState: 1 + ExternalDryContactPointINState: 0 + ExternalWaterLeak1SenorState: 1 + ExternalWaterLeak2SenorState: 0 + ExternalSeatSenorState: 0 + ExternalGlassSenor1State: 1 + ExternalGlassSenor2State: 0 + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0xD2, 0x12, 0x1C, 0x03, 0x03, 0x39, 0x12, 0x39, 0x03, 0x39] + output: + data: + Device: 'R315' + Volt: 2.8 + Temp: 7.71 + Humidity: '146.1%' + Illuminance: '14595Lux' + LowTemperatureAlarm: 1 + HighTemperatureAlarm: 0 + LowHumidityAlarm: 0 + HighHumidityAlarm: 1 + LowIlluminanceAlarm: 1 + HighIlluminanceAlarm: 1 + - description: Configure report response input: fPort: 7 diff --git a/vendor/netvox/r315la-codec.yaml b/vendor/netvox/r315la-codec.yaml new file mode 100755 index 0000000000..56d1e23258 --- /dev/null +++ b/vendor/netvox/r315la-codec.yaml @@ -0,0 +1,140 @@ +uplinkDecoder: + fileName: payload/r315la.js + examples: + - description: Startup version report + input: + fPort: 6 + bytes: [0x01, 0xDD, 0x00, 0x64, 0x15, 0x20, 0x20, 0x08, 0x11, 0x00, 0x00] + output: + data: + Device: 'R315LA' + SWver: 10 + HWver: 21 + Datecode: '20200811' + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0xDD, 0x01, 0x30, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00] + output: + data: + Device: 'R315LA' + Volt: 4.8 + VModbusID: 0 + Status: 'On' + Distance: '257mm' + LowDistanceAlarm: 0 + HightDistanceAlarm: 0 + + - description: Configure report response + input: + fPort: 7 + bytes: [0x81, 0xDD, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportRsp' + Device: 'R315LA' + Status: 'Success' + + - description: Read configure report response + input: + fPort: 7 + bytes: [0x82, 0xDD, 0x03, 0x84, 0x07, 0x08, 0x01, 0x01, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigReportRsp' + Device: 'R315LA' + MinTime: 900 + MaxTime: 1800 + BatteryChange: 0.1 + DistanceChange: '256mm' + + - description: Read configure report response + input: + fPort: 7 + bytes: [0x83, 0xDD, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetOnDistanceThresholdRrsq' + Device: 'R315LA' + Status: 'Failure' + + - description: Read configure report response + input: + fPort: 7 + bytes: [0x84, 0xDD, 0x01, 0x84, 0x07, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetOnDistanceThresholdRrsp' + Device: 'R315LA' + OnDistanceThreshold: '388mm' + +downlinkDecoder: + fileName: payload/r315la.js + examples: + - description: Configure report request + input: + fPort: 7 + bytes: [0x01, 0xDD, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x11, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportReq' + Device: 'R315LA' + MinTime: 900 + MaxTime: 1800 + BatteryChange: 0.1 + DistanceChange: '17mm' + + - description: Read configure report request + input: + fPort: 7 + bytes: [0x03, 0xDD, 0x00, 0x84, 0x02, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetOnDistanceThresholdRreq' + Device: 'R315LA' + OnDistanceThreshold: '132mm' + +downlinkEncoder: + fileName: payload/r315la.js + examples: + - description: Configure report request + input: + data: + Cmd: 'ConfigReportReq' + Device: 'R315LA' + MinTime: 900 + MaxTime: 1800 + BatteryChange: 10 + DistanceChange: 22 + output: + fPort: 7 + bytes: [0x01, 0xDD, 0x03, 0x84, 0x07, 0x08, 0x64, 0x00, 0x16, 0x00, 0x00] + + - description: Read configure report request + input: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R315LA' + output: + fPort: 7 + bytes: [0x02, 0xDD, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: Read configure report request + input: + data: + Cmd: 'SetOnDistanceThresholdRreq' + Device: 'R315LA' + OnDistanceThreshold: 221 + output: + fPort: 7 + bytes: [0x03, 0xDD, 0x00, 0xDD, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: Read configure report request + input: + data: + Cmd: 'GetOnDistanceThresholdRreq' + Device: 'R315LA' + output: + fPort: 7 + bytes: [0x04, 0xDD, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] diff --git a/vendor/netvox/r315la.yaml b/vendor/netvox/r315la.yaml new file mode 100755 index 0000000000..7bb05d1dd3 --- /dev/null +++ b/vendor/netvox/r315la.yaml @@ -0,0 +1,63 @@ +name: R315LA - Wireless toilet paper detection sensor +description: R315LA is a Wireless toilet paper detection sensor. + +hardwareVersions: + - version: '21' + numeric: 21 + +firmwareVersions: + - version: '10' + numeric: 10 + hardwareVersions: + - '21' + + profiles: + EU863-870: + id: profile-eu868 + codec: r315la-codec + AS923: + id: profile-as923 + codec: r315la-codec + US902-928: + id: profile-us915 + codec: r315la-codec + AU915-928: + id: profile-au915 + codec: r315la-codec + KR920-923: + id: profile-kr920 + codec: r315la-codec + IN865-867: + id: profile-in865 + codec: r315la-codec + CN470-510: + id: profile-cn470 + codec: r315la-codec + +dimensions: + diameter: 106 + height: 40.6 + +battery: + replaceable: true + type: 2 x1.5V AAA alkaline batteries + +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=r315la +dataSheetURL: http://www.netvox.com.tw/um/r315la/r315laGdatasheet.pdf + +photos: + main: photos/r315la.jpg diff --git a/vendor/netvox/r602b-codec.yaml b/vendor/netvox/r602b-codec.yaml new file mode 100755 index 0000000000..30146f709a --- /dev/null +++ b/vendor/netvox/r602b-codec.yaml @@ -0,0 +1,149 @@ +uplinkDecoder: + fileName: payload/r602b.js + examples: + - description: Startup version report + input: + fPort: 6 + bytes: [0x01, 0x69, 0x00, 0x6E, 0x03, 0x20, 0x21, 0x01, 0x28, 0x00, 0x00] + output: + data: + Device: 'R602B' + SWver: 11 + HWver: 3 + Datecode: '20210128' + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x69, 0x01, 0x03, 0x84, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00] + output: + data: + Device: 'R602B' + HeartBeatTime: 900 + WarningStatus: 'No warning' + Battery: 0.1 + + - description: Configure report response + input: + fPort: 7 + bytes: [0x81, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportRsp' + Device: 'R602B' + Status: 'Success' + + - description: Read configure report response + input: + fPort: 7 + bytes: [0x82, 0x69, 0x03, 0x84, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigReportRsp' + Device: 'R602B' + MinTime: 900 + MaxTime: 1800 + + - description: Start warning with ack response + input: + fPort: 7 + bytes: [0x83, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'StartWarningWithAckRsp' + Device: 'R602B' + Status: 'Success' + +downlinkDecoder: + fileName: payload/r602b.js + examples: + - description: Configure report request + input: + fPort: 7 + bytes: [0x01, 0x69, 0x03, 0x84, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportReq' + Device: 'R602B' + MinTime: 900 + MaxTime: 1800 + + - description: Read configure report request + input: + fPort: 7 + bytes: [0x02, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R602B' + + - description: Start warning with ack request + input: + fPort: 7 + bytes: [0x03, 0x69, 0x01, 0x01, 0x00, 0xB4, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'StartWarningWithAckReq' + Device: 'R602B' + WarningMode: 1 + StrobeMode: 1 + WarningDuration: 180 + + - description: Start warning + input: + fPort: 7 + bytes: [0x90, 0x69, 0x01, 0x01, 0x00, 0xB4, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'StartWarning' + Device: 'R602B' + WarningMode: 1 + StrobeMode: 1 + WarningDuration: 180 + +downlinkEncoder: + fileName: payload/r602b.js + examples: + - description: Configure report request + input: + data: + Cmd: 'ConfigReportReq' + Device: 'R602B' + MinTime: 900 + MaxTime: 1800 + output: + fPort: 7 + bytes: [0x01, 0x69, 0x03, 0x84, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: Read configure report request + input: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R602B' + output: + fPort: 7 + bytes: [0x02, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: Start warning with ack request + input: + data: + Cmd: 'StartWarningWithAckReq' + Device: 'R602B' + WarningMode: 1 + StrobeMode: 1 + WarningDuration: 180 + output: + fPort: 7 + bytes: [0x03, 0x69, 0x01, 0x01, 0x00, 0xB4, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: Start warning + input: + data: + Cmd: 'StartWarning' + Device: 'R602B' + WarningMode: 1 + StrobeMode: 1 + WarningDuration: 180 + output: + fPort: 7 + bytes: [0x90, 0x69, 0x01, 0x01, 0x00, 0xB4, 0x00, 0x00, 0x00, 0x00, 0x00] diff --git a/vendor/netvox/r602b.yaml b/vendor/netvox/r602b.yaml new file mode 100755 index 0000000000..ff58086ebd --- /dev/null +++ b/vendor/netvox/r602b.yaml @@ -0,0 +1,59 @@ +name: R602B - LoRa-Siren +description: R602B is a smart wireless alarm that can communicate with other devices through a wireless network. It has a high-decibel speaker and high-brightness LED which can realize sound and light alarms. It adopts SX1276 wireless communication module. + +hardwareVersions: + - version: '3' + numeric: 3 + +firmwareVersions: + - version: '11' + numeric: 11 + hardwareVersions: + - '3' + + profiles: + EU863-870: + id: profile-eu868 + codec: r602b-codec + AS923: + id: profile-as923 + codec: r602b-codec + US902-928: + id: profile-us915 + codec: r602b-codec + AU915-928: + id: profile-au915 + codec: r602b-codec + KR920-923: + id: profile-kr920 + codec: r602b-codec + IN865-867: + id: profile-in865 + codec: r602b-codec + CN470-510: + id: profile-cn470 + codec: r602b-codec + +dimensions: + diameter: 85 + height: 52 + +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=R602B +dataSheetURL: http://www.netvox.com.tw/um/R602B/R602Bdatasheet.pdf + +photos: + main: photos/r602b.png diff --git a/vendor/netvox/r603-codec.yaml b/vendor/netvox/r603-codec.yaml new file mode 100755 index 0000000000..427d7593fd --- /dev/null +++ b/vendor/netvox/r603-codec.yaml @@ -0,0 +1,226 @@ +uplinkDecoder: + fileName: payload/r603.js + examples: + - description: Startup version report + input: + fPort: 6 + bytes: [0x01, 0xDE, 0x00, 0x64, 0x15, 0x20, 0x20, 0x08, 0x11, 0x00, 0x00] + output: + data: + Device: 'R603' + SWver: 10 + HWver: 21 + Datecode: '20200811' + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0xDE, 0x01, 0x30, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00] + output: + data: + Device: 'R603' + Volt: 4.8 + WarningStatus: 'NoWarnring' + DCPowerFailureAlarm: 'Warning' + + - description: Configure report response + input: + fPort: 7 + bytes: [0x81, 0xDE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportRsp' + Device: 'R603' + Status: 'Success' + + - description: Read configure report response + input: + fPort: 7 + bytes: [0x82, 0xDE, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigReportRsp' + Device: 'R603' + MinTime: 900 + MaxTime: 1800 + + - description: Read configure report response + input: + fPort: 7 + bytes: [0x85, 0xDE, 0x01, 0x03, 0x02, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetPeriodSirenRsp' + Device: 'R603' + SirenNo: 'Doorbel' + SirenLevel: 3 + StrobeMode: 'LedBlinkMode2 in Parallel to Warning' + Duration: 2049 + PeriodTime: 0 + + - description: Read configure report response + input: + fPort: 7 + bytes: [0x86, 0xDE, 0x01, 0x84, 0x07, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'StopPeriodSirenRsp' + Device: 'R603' + Status: 'Failure' + + - description: Read configure report response + input: + fPort: 7 + bytes: [0x88, 0xDE, 0x03, 0x04, 0x07, 0x08, 0x01, 0x05, 0x03, 0x00, 0x00] + output: + data: + Cmd: 'GetLEDColorRsp' + Device: 'R603' + Red: 3 + Green: 4 + Blue: 7 + + - description: Read configure report response + input: + fPort: 7 + bytes: [0x8A, 0xDE, 0x03, 0x08, 0x01, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetContactSwitchTriggerAlarmRsp' + Device: 'R603' + SirenNo: 'FireMode' + SirenLevel: 8 + StrobeMode: 'LedBlinkMode1 in Parallel to Warning' + Duration: 2049 + +downlinkDecoder: + fileName: payload/r603.js + examples: + - description: Configure report request + input: + fPort: 7 + bytes: [0x01, 0xDE, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportReq' + Device: 'R603' + MinTime: 900 + MaxTime: 1800 + + - description: Read configure report request + input: + fPort: 7 + bytes: [0x03, 0xDE, 0x00, 0x84, 0x02, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'StartSirenReq' + Device: 'R603' + SirenNo: 'EmergencyMode' + SirenLevel: 132 + StrobeMode: 'LedBlinkMode2 in Parallel to Warning' + Duration: 2049 + + - description: Read configure report response + input: + fPort: 7 + bytes: [0x04, 0xDE, 0x00, 0x84, 0x01, 0x08, 0x01, 0x01, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetPeriodSirenReq' + Device: 'R603' + SirenNo: 'EmergencyMode' + SirenLevel: 132 + StrobeMode: 'LedBlinkMode1 in Parallel to Warning' + Duration: 2049 + PeriodTime: 256 + + - description: Read configure report response + input: + fPort: 7 + bytes: [0x07, 0xDE, 0x03, 0x18, 0x07, 0x18, 0x01, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetLEDColorReq' + Device: 'R603' + Red: 3 + Green: 24 + Blue: 7 + + - description: Read configure report response + input: + fPort: 7 + bytes: [0x09, 0xDE, 0x03, 0x12, 0x00, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetContactSwitchTriggerAlarmReq' + Device: 'R603' + SirenNo: 'FireMode' + SirenLevel: 18 + StrobeMode: 'NoLedIndication' + Duration: 2049 + +downlinkEncoder: + fileName: payload/r603.js + examples: + - description: Configure report request + input: + data: + Cmd: 'ConfigReportReq' + Device: 'R603' + MinTime: 900 + MaxTime: 1800 + output: + fPort: 7 + bytes: [0x01, 0xDE, 0x03, 0x84, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: Read configure report request + input: + data: + Cmd: 'StartSirenReq' + Device: 'R603' + SirenNo: 'EmergencyMode' + SirenLevel: 132 + StrobeMode: 'LedBlinkMode2 in Parallel to Warning' + Duration: 2049 + output: + fPort: 7 + bytes: [0x03, 0xDE, 0x00, 0x84, 0x02, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00] + + - description: Read configure report request + input: + data: + Cmd: 'SetPeriodSirenReq' + Device: 'R603' + SirenNo: 'EmergencyMode' + SirenLevel: 132 + StrobeMode: 'LedBlinkMode1 in Parallel to Warning' + Duration: 2049 + PeriodTime: 256 + output: + fPort: 7 + bytes: [0x04, 0xDE, 0x00, 0x84, 0x01, 0x08, 0x01, 0x01, 0x00, 0x00, 0x00] + + - description: Read configure report request + input: + data: + Cmd: 'SetLEDColorReq' + Device: 'R603' + Red: 3 + Green: 24 + Blue: 7 + output: + fPort: 7 + bytes: [0x07, 0xDE, 0x03, 0x18, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: Read configure report request + input: + data: + Cmd: 'SetContactSwitchTriggerAlarmReq' + Device: 'R603' + SirenNo: 'FireMode' + SirenLevel: 18 + StrobeMode: 'NoLedIndication' + Duration: 2049 + output: + fPort: 7 + bytes: [0x09, 0xDE, 0x03, 0x12, 0x00, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00] diff --git a/vendor/netvox/r603.yaml b/vendor/netvox/r603.yaml new file mode 100755 index 0000000000..757440d0e9 --- /dev/null +++ b/vendor/netvox/r603.yaml @@ -0,0 +1,63 @@ +name: R603 - Wireless Customized Voice Announcer +description: R603 is a Wireless Customized Voice Announcer. + +hardwareVersions: + - version: '21' + numeric: 21 + +firmwareVersions: + - version: '10' + numeric: 10 + hardwareVersions: + - '21' + + profiles: + EU863-870: + id: profile-eu868 + codec: r603-codec + AS923: + id: profile-as923 + codec: r603-codec + US902-928: + id: profile-us915 + codec: r603-codec + AU915-928: + id: profile-au915 + codec: r603-codec + KR920-923: + id: profile-kr920 + codec: r603-codec + IN865-867: + id: profile-in865 + codec: r603-codec + CN470-510: + id: profile-cn470 + codec: r603-codec + +dimensions: + diameter: 106 + height: 40.6 + +battery: + replaceable: true + type: 2 x1.5V AAA alkaline batteries + +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=R603 +dataSheetURL: http://www.netvox.com.tw/um/R603/R603Gdatasheet.pdf + +photos: + main: photos/r603.png diff --git a/vendor/netvox/r718ce-codec.yaml b/vendor/netvox/r718ce-codec.yaml new file mode 100644 index 0000000000..16ced55560 --- /dev/null +++ b/vendor/netvox/r718ce-codec.yaml @@ -0,0 +1,154 @@ +uplinkDecoder: + fileName: payload/r718ce.js + examples: + - description: Startup version report + input: + fPort: 6 + bytes: [0x01, 0x94, 0x00, 0x64, 0x01, 0x20, 0x20, 0x07, 0x29, 0x00, 0x00] + output: + data: + Device: 'R718CE' + SWver: 10 + HWver: 1 + Datecode: '20200729' + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x94, 0x01, 0x32, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Device: 'R718CE' + Volt: 3.2 + Temp: 30 + + - description: Configure report response + input: + fPort: 7 + bytes: [0x81, 0x94, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportRsp' + Device: 'R718CE' + Status: 'Success' + + - description: Read configure report response + input: + fPort: 7 + bytes: [0x82, 0x94, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x05, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigReportRsp' + Device: 'R718CE' + MinTime: 900 + MaxTime: 1800 + BatteryChange: 0.1 + TempChange: 0.5 + + - description: Set thermocouple type response + input: + fPort: 7 + bytes: [0x83, 0x94, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetThermocoupleTypeRsp' + Device: 'R718CE' + Status: 'Success' + + - description: Get thermocouple type response + input: + fPort: 7 + bytes: [0x84, 0x94, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetThermocoupleTypeRsp' + Device: 'R718CE' + ThermocoupleType: 1 + +downlinkDecoder: + fileName: payload/r718ce.js + examples: + - description: Configure report request + input: + fPort: 7 + bytes: [0x01, 0x94, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x05, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportReq' + Device: 'R718CE' + MinTime: 900 + MaxTime: 1800 + BatteryChange: 0.1 + TempChange: 0.5 + + - description: Read configure report request + input: + fPort: 7 + bytes: [0x02, 0x94, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R718CE' + + - description: Set thermocouple type request + input: + fPort: 7 + bytes: [0x03, 0x94, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetThermocoupleTypeReq' + Device: 'R718CE' + ThermocoupleType: 1 + + - description: Get thermocouple type request + input: + fPort: 7 + bytes: [0x04, 0x94, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetThermocoupleTypeReq' + Device: 'R718CE' + +downlinkEncoder: + fileName: payload/r718ce.js + examples: + - description: Configure report request + input: + data: + Cmd: 'ConfigReportReq' + Device: 'R718CE' + MinTime: 900 + MaxTime: 1800 + BatteryChange: 0.1 + TempChange: 0.5 + output: + fPort: 7 + bytes: [0x01, 0x94, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x05, 0x00, 0x00] + + - description: Read configure report request + input: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R718CE' + output: + fPort: 7 + bytes: [0x02, 0x94, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: Set thermocouple type request + input: + data: + Cmd: 'SetThermocoupleTypeReq' + Device: 'R718CE' + ThermocoupleType: 1 + output: + fPort: 7 + bytes: [0x03, 0x94, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: Get thermocouple type request + input: + data: + Cmd: 'GetThermocoupleTypeReq' + Device: 'R718CE' + output: + fPort: 7 + bytes: [0x04, 0x94, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] diff --git a/vendor/netvox/r718ce.yaml b/vendor/netvox/r718ce.yaml new file mode 100644 index 0000000000..933a96b436 --- /dev/null +++ b/vendor/netvox/r718ce.yaml @@ -0,0 +1,69 @@ +name: R718CE - Wireless Thermocouple Sensor +description: The Netvox R718CE consists of a thermocouple sensor for detecting the temperature of objects and mediums in which the thermocouple is contacted. It uses the SX1276 wireless communication module for LoRaWAN® communication. + +hardwareVersions: + - version: '2' + numeric: 2 + +firmwareVersions: + - version: '10' + numeric: 10 + hardwareVersions: + - '2' + + profiles: + EU863-870: + id: profile-eu868 + codec: r718ce-codec + AS923: + id: profile-as923 + codec: r718ce-codec + US902-928: + id: profile-us915 + codec: r718ce-codec + AU915-928: + id: profile-au915 + codec: r718ce-codec + KR920-923: + id: profile-kr920 + codec: r718ce-codec + IN865-867: + id: profile-in865 + codec: r718ce-codec + CN470-510: + id: profile-cn470 + codec: r718ce-codec + +sensors: + - temperature + +dimensions: + width: 88.19 + length: 112 + height: 32 + +battery: + replaceable: true + type: 2 x 3.6V ER14505 AA lithium battery + +operatingConditions: + temperature: + min: -20 + max: 55 + relativeHumidity: + min: 0 + max: 0.9 + +ipCode: IP65 + +keyProvisioning: + - custom + - join server + +keySecurity: none + +productURL: http://www.netvox.com.tw/product.asp?pro=R718CE +dataSheetURL: http://www.netvox.com.tw/um/R718CE/R718CEdatasheet.pdf + +photos: + main: photos/r718ce.jpg diff --git a/vendor/netvox/r718ce2-codec.yaml b/vendor/netvox/r718ce2-codec.yaml new file mode 100644 index 0000000000..0f9b9c0e3c --- /dev/null +++ b/vendor/netvox/r718ce2-codec.yaml @@ -0,0 +1,168 @@ +uplinkDecoder: + fileName: payload/r718ce2.js + examples: + - description: Startup version report + input: + fPort: 6 + bytes: [0x01, 0x19, 0x00, 0x64, 0x02, 0x20, 0x20, 0x07, 0x29, 0x00, 0x00] + output: + data: + Device: 'R718CE2' + SWver: 10 + HWver: 2 + Datecode: '20200729' + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x19, 0x01, 0x24, 0x00, 0xFD, 0x01, 0x6D, 0x00, 0x00, 0x00] + output: + data: + Device: 'R718CE2' + Volt: 3.6 + Temp1: 25.3 + Temp2: 36.5 + ThresholdAlarm: 0 + + - description: Status report with low battery + input: + fPort: 6 + bytes: [0x01, 0x19, 0x01, 0xA4, 0x00, 0x64, 0x00, 0xC8, 0x01, 0x00, 0x00] + output: + data: + Device: 'R718CE2' + Volt: '3.6(low battery)' + Temp1: 10.0 + Temp2: 20.0 + ThresholdAlarm: 1 + + - description: Configure report response + input: + fPort: 7 + bytes: [0x81, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportRsp' + Device: 'R718CE2' + Status: 'Success' + + - description: Read configure report response + input: + fPort: 7 + bytes: [0x82, 0x19, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x05, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigReportRsp' + Device: 'R718CE2' + MinTime: 900 + MaxTime: 1800 + BatteryChange: 0.1 + TempChange: 0.5 + + - description: Set thermocouple type response + input: + fPort: 7 + bytes: [0x83, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetThermocoupleTypeRsp' + Device: 'R718CE2' + Status: 'Success' + + - description: Get thermocouple type response + input: + fPort: 7 + bytes: [0x84, 0x19, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetThermocoupleTypeRsp' + Device: 'R718CE2' + ThermocoupleType: 1 + +downlinkDecoder: + fileName: payload/r718ce2.js + examples: + - description: Configure report request + input: + fPort: 7 + bytes: [0x01, 0x19, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x05, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportReq' + Device: 'R718CE2' + MinTime: 900 + MaxTime: 1800 + BatteryChange: 0.1 + TempChange: 0.5 + + - description: Read configure report request + input: + fPort: 7 + bytes: [0x02, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R718CE2' + + - description: Set thermocouple type request + input: + fPort: 7 + bytes: [0x03, 0x19, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetThermocoupleTypeReq' + Device: 'R718CE2' + ThermocoupleType: 1 + + - description: Get thermocouple type request + input: + fPort: 7 + bytes: [0x04, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetThermocoupleTypeReq' + Device: 'R718CE2' + +downlinkEncoder: + fileName: payload/r718ce2.js + examples: + - description: Configure report request + input: + data: + Cmd: 'ConfigReportReq' + Device: 'R718CE2' + MinTime: 900 + MaxTime: 1800 + BatteryChange: 0.1 + TempChange: 0.5 + output: + fPort: 7 + bytes: [0x01, 0x19, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x05, 0x00, 0x00] + + - description: Read configure report request + input: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R718CE2' + output: + fPort: 7 + bytes: [0x02, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: Set thermocouple type request + input: + data: + Cmd: 'SetThermocoupleTypeReq' + Device: 'R718CE2' + ThermocoupleType: 1 + output: + fPort: 7 + bytes: [0x03, 0x19, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: Get thermocouple type request + input: + data: + Cmd: 'GetThermocoupleTypeReq' + Device: 'R718CE2' + output: + fPort: 7 + bytes: [0x04, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] diff --git a/vendor/netvox/r718ce2.yaml b/vendor/netvox/r718ce2.yaml new file mode 100644 index 0000000000..71e2748745 --- /dev/null +++ b/vendor/netvox/r718ce2.yaml @@ -0,0 +1,69 @@ +name: R718CE2 - Wireless 2-Gang Thermocouple Sensor +description: This equipment is used to detect temperature of the object and medium which thermocouple is contacted. It can be connected to two thermocouples for testing. It uses SX1276 wireless communication module. + +hardwareVersions: + - version: '2' + numeric: 2 + +firmwareVersions: + - version: '10' + numeric: 10 + hardwareVersions: + - '2' + + profiles: + EU863-870: + id: profile-eu868 + codec: r718ce2-codec + AS923: + id: profile-as923 + codec: r718ce2-codec + US902-928: + id: profile-us915 + codec: r718ce2-codec + AU915-928: + id: profile-au915 + codec: r718ce2-codec + KR920-923: + id: profile-kr920 + codec: r718ce2-codec + IN865-867: + id: profile-in865 + codec: r718ce2-codec + CN470-510: + id: profile-cn470 + codec: r718ce2-codec + +sensors: + - temperature + +dimensions: + width: 88.19 + length: 112 + height: 32 + +battery: + replaceable: true + type: 2 x 3.6V ER14505 AA lithium battery + +operatingConditions: + temperature: + min: -20 + max: 55 + relativeHumidity: + min: 0 + max: 0.9 + +ipCode: IP65 + +keyProvisioning: + - custom + - join server + +keySecurity: none + +productURL: http://www.netvox.com.tw/product.asp?pro=R718CE2 +dataSheetURL: http://www.netvox.com.tw/um/R718CE2/R718CE2datasheet.pdf + +photos: + main: photos/r718ce2.jpg diff --git a/vendor/netvox/r718ce4-codec.yaml b/vendor/netvox/r718ce4-codec.yaml new file mode 100644 index 0000000000..348b7b7799 --- /dev/null +++ b/vendor/netvox/r718ce4-codec.yaml @@ -0,0 +1,166 @@ +uplinkDecoder: + fileName: payload/r718ce4.js + examples: + - description: Startup version report + input: + fPort: 6 + bytes: [0x01, 0x3C, 0x00, 0x64, 0x01, 0x20, 0x20, 0x07, 0x29, 0x00, 0x00] + output: + data: + Device: 'R718CE4' + SWver: 10 + HWver: 1 + Datecode: '20200729' + + - description: Status report (Temp1 and Temp2) + input: + fPort: 6 + bytes: [0x01, 0x3C, 0x01, 0x24, 0x00, 0xFC, 0x00, 0x0A, 0x00, 0x00, 0x00] + output: + data: + Device: 'R718CE4' + Volt: 3.6 + Temp1: 25.2 + Temp2: 1.0 + + - description: Status report (Temp3 and Temp4) + input: + fPort: 6 + bytes: [0x01, 0x3C, 0x02, 0x24, 0x00, 0x1E, 0x00, 0x28, 0x00, 0x00, 0x00] + output: + data: + Device: 'R718CE4' + Volt: 3.6 + Temp3: 3.0 + Temp4: 4.0 + + - description: Configure report response + input: + fPort: 7 + bytes: [0x81, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportRsp' + Device: 'R718CE4' + Status: 'Success' + + - description: Read configure report response + input: + fPort: 7 + bytes: [0x82, 0x3C, 0x03, 0x84, 0x07, 0x08, 0x0A, 0x00, 0x05, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigReportRsp' + Device: 'R718CE4' + MinTime: 900 + MaxTime: 1800 + BatteryChange: 1.0 + TempChange: 0.5 + + - description: Set thermocouple type response (deprecated) + input: + fPort: 7 + bytes: [0x83, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetThermocoupleTypeRsp' + Device: 'R718CE4' + Status: 'Success' + + - description: Get thermocouple type response (deprecated) + input: + fPort: 7 + bytes: [0x84, 0x3C, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetThermocoupleTypeRsp' + Device: 'R718CE4' + ThermocoupleType: 1 + +downlinkDecoder: + fileName: payload/r718ce4.js + examples: + - description: Configure report request + input: + fPort: 7 + bytes: [0x01, 0x3C, 0x03, 0x84, 0x07, 0x08, 0x0A, 0x00, 0x05, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportReq' + Device: 'R718CE4' + MinTime: 900 + MaxTime: 1800 + BatteryChange: 1.0 + TempChange: 0.5 + + - description: Read configure report request + input: + fPort: 7 + bytes: [0x02, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R718CE4' + + - description: Set thermocouple type request (deprecated) + input: + fPort: 7 + bytes: [0x03, 0x3C, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetThermocoupleTypeReq' + Device: 'R718CE4' + ThermocoupleType: 1 + + - description: Get thermocouple type request (deprecated) + input: + fPort: 7 + bytes: [0x04, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetThermocoupleTypeReq' + Device: 'R718CE4' + +downlinkEncoder: + fileName: payload/r718ce4.js + examples: + - description: Configure report request + input: + data: + Cmd: 'ConfigReportReq' + Device: 'R718CE4' + MinTime: 900 + MaxTime: 1800 + BatteryChange: 1.0 + TempChange: 0.5 + output: + fPort: 7 + bytes: [0x01, 0x3C, 0x03, 0x84, 0x07, 0x08, 0x0A, 0x00, 0x05, 0x00, 0x00] + + - description: Read configure report request + input: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R718CE4' + output: + fPort: 7 + bytes: [0x02, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: Set thermocouple type request (deprecated) + input: + data: + Cmd: 'SetThermocoupleTypeReq' + Device: 'R718CE4' + ThermocoupleType: 1 + output: + fPort: 7 + bytes: [0x03, 0x3C, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: Get thermocouple type request (deprecated) + input: + data: + Cmd: 'GetThermocoupleTypeReq' + Device: 'R718CE4' + output: + fPort: 7 + bytes: [0x04, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] diff --git a/vendor/netvox/r718ce4.yaml b/vendor/netvox/r718ce4.yaml new file mode 100644 index 0000000000..a491f4ba3f --- /dev/null +++ b/vendor/netvox/r718ce4.yaml @@ -0,0 +1,69 @@ +name: R718CE4 - Wireless Thermocouple Sensor +description: The Netvox R718CE4 consists of four thermocouple sensors for detecting the temperature of objects and mediums in which the thermocouples are contacted. It uses the SX1276 wireless communication module for LoRaWAN® communication. + +hardwareVersions: + - version: '2' + numeric: 2 + +firmwareVersions: + - version: '10' + numeric: 10 + hardwareVersions: + - '2' + + profiles: + EU863-870: + id: profile-eu868 + codec: r718ce4-codec + AS923: + id: profile-as923 + codec: r718ce4-codec + US902-928: + id: profile-us915 + codec: r718ce4-codec + AU915-928: + id: profile-au915 + codec: r718ce4-codec + KR920-923: + id: profile-kr920 + codec: r718ce4-codec + IN865-867: + id: profile-in865 + codec: r718ce4-codec + CN470-510: + id: profile-cn470 + codec: r718ce4-codec + +sensors: + - temperature + +dimensions: + width: 88.19 + length: 112 + height: 32 + +battery: + replaceable: true + type: 2 x 3.6V ER14505 AA lithium battery + +operatingConditions: + temperature: + min: -20 + max: 55 + relativeHumidity: + min: 0 + max: 0.9 + +ipCode: IP65 + +keyProvisioning: + - custom + - join server + +keySecurity: none + +productURL: http://www.netvox.com.tw/product.asp?pro=R718CE4 +dataSheetURL: http://www.netvox.com.tw/um/R718CE4/R718CE4datasheet.pdf + +photos: + main: photos/r718ce4.jpg diff --git a/vendor/netvox/r718cj-codec.yaml b/vendor/netvox/r718cj-codec.yaml new file mode 100644 index 0000000000..74df8b07dc --- /dev/null +++ b/vendor/netvox/r718cj-codec.yaml @@ -0,0 +1,155 @@ +uplinkDecoder: + fileName: payload/r718cj.js + examples: + - description: Startup version report + input: + fPort: 6 + bytes: [0x01, 0x90, 0x00, 0x64, 0x01, 0x20, 0x20, 0x07, 0x29, 0x00, 0x00] + output: + data: + Device: 'R718CJ' + SWver: 10 + HWver: 1 + Datecode: '20200729' + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x90, 0x01, 0x24, 0x00, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Device: 'R718CJ' + Volt: 3.6 + Temp: 25.2 + ThresholdAlarm: 0 + + - description: Configure report response + input: + fPort: 7 + bytes: [0x81, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportRsp' + Device: 'R718CJ' + Status: 'Success' + + - description: Read configure report response + input: + fPort: 7 + bytes: [0x82, 0x90, 0x03, 0x84, 0x07, 0x08, 0x0A, 0x00, 0x05, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigReportRsp' + Device: 'R718CJ' + MinTime: 900 + MaxTime: 1800 + BatteryChange: 1.0 + TempChange: 0.5 + + - description: Set thermocouple type response (deprecated) + input: + fPort: 7 + bytes: [0x83, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetThermocoupleTypeRsp' + Device: 'R718CJ' + Status: 'Success' + + - description: Get thermocouple type response (deprecated) + input: + fPort: 7 + bytes: [0x84, 0x90, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetThermocoupleTypeRsp' + Device: 'R718CJ' + ThermocoupleType: 1 + +downlinkDecoder: + fileName: payload/r718cj.js + examples: + - description: Configure report request + input: + fPort: 7 + bytes: [0x01, 0x90, 0x03, 0x84, 0x07, 0x08, 0x0A, 0x00, 0x05, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportReq' + Device: 'R718CJ' + MinTime: 900 + MaxTime: 1800 + BatteryChange: 1.0 + TempChange: 0.5 + + - description: Read configure report request + input: + fPort: 7 + bytes: [0x02, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R718CJ' + + - description: Set thermocouple type request (deprecated) + input: + fPort: 7 + bytes: [0x03, 0x90, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetThermocoupleTypeReq' + Device: 'R718CJ' + ThermocoupleType: 1 + + - description: Get thermocouple type request (deprecated) + input: + fPort: 7 + bytes: [0x04, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetThermocoupleTypeReq' + Device: 'R718CJ' + +downlinkEncoder: + fileName: payload/r718cj.js + examples: + - description: Configure report request + input: + data: + Cmd: 'ConfigReportReq' + Device: 'R718CJ' + MinTime: 900 + MaxTime: 1800 + BatteryChange: 1.0 + TempChange: 0.5 + output: + fPort: 7 + bytes: [0x01, 0x90, 0x03, 0x84, 0x07, 0x08, 0x0A, 0x00, 0x05, 0x00, 0x00] + + - description: Read configure report request + input: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R718CJ' + output: + fPort: 7 + bytes: [0x02, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: Set thermocouple type request (deprecated) + input: + data: + Cmd: 'SetThermocoupleTypeReq' + Device: 'R718CJ' + ThermocoupleType: 1 + output: + fPort: 7 + bytes: [0x03, 0x90, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: Get thermocouple type request (deprecated) + input: + data: + Cmd: 'GetThermocoupleTypeReq' + Device: 'R718CJ' + output: + fPort: 7 + bytes: [0x04, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] diff --git a/vendor/netvox/r718cj.yaml b/vendor/netvox/r718cj.yaml new file mode 100644 index 0000000000..7a8dcd2968 --- /dev/null +++ b/vendor/netvox/r718cj.yaml @@ -0,0 +1,69 @@ +name: R718CJ - Wireless Thermocouple Sensor +description: The Netvox R718CJ consists of a thermocouple sensor for detecting the temperature of objects and mediums in which the thermocouple is contacted. It uses the SX1276 wireless communication module for LoRaWAN® communication. + +hardwareVersions: + - version: '2' + numeric: 2 + +firmwareVersions: + - version: '10' + numeric: 10 + hardwareVersions: + - '2' + + profiles: + EU863-870: + id: profile-eu868 + codec: r718cj-codec + AS923: + id: profile-as923 + codec: r718cj-codec + US902-928: + id: profile-us915 + codec: r718cj-codec + AU915-928: + id: profile-au915 + codec: r718cj-codec + KR920-923: + id: profile-kr920 + codec: r718cj-codec + IN865-867: + id: profile-in865 + codec: r718cj-codec + CN470-510: + id: profile-cn470 + codec: r718cj-codec + +sensors: + - temperature + +dimensions: + width: 88.19 + length: 112 + height: 32 + +battery: + replaceable: true + type: 2 x 3.6V ER14505 AA lithium battery + +operatingConditions: + temperature: + min: -20 + max: 55 + relativeHumidity: + min: 0 + max: 0.9 + +ipCode: IP65 + +keyProvisioning: + - custom + - join server + +keySecurity: none + +productURL: http://www.netvox.com.tw/product.asp?pro=R718CJ +dataSheetURL: http://www.netvox.com.tw/um/R718CJ/R718CJdatasheet.pdf + +photos: + main: photos/r718cj.jpg diff --git a/vendor/netvox/r718cj2-codec.yaml b/vendor/netvox/r718cj2-codec.yaml new file mode 100644 index 0000000000..7035a7ae5e --- /dev/null +++ b/vendor/netvox/r718cj2-codec.yaml @@ -0,0 +1,156 @@ +uplinkDecoder: + fileName: payload/r718cj2.js + examples: + - description: Startup version report + input: + fPort: 6 + bytes: [0x01, 0x15, 0x00, 0x64, 0x02, 0x20, 0x20, 0x07, 0x29, 0x00, 0x00] + output: + data: + Device: 'R718CJ2' + SWver: 10 + HWver: 2 + Datecode: '20200729' + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x15, 0x01, 0x24, 0x00, 0xFD, 0x01, 0x6D, 0x00, 0x00, 0x00] + output: + data: + Device: 'R718CJ2' + Volt: 3.6 + Temperature1: 25.3 + Temperature2: 36.5 + ThresholdAlarm_R718CX2: 0 + + - description: Configure report response + input: + fPort: 7 + bytes: [0x81, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportRsp' + Device: 'R718CJ2' + Status: 'Success' + + - description: Read configure report response + input: + fPort: 7 + bytes: [0x82, 0x15, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x05, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigReportRsp' + Device: 'R718CJ2' + MinTime: 900 + MaxTime: 1800 + BatteryChange: 0.1 + TemperatureChange: 0.5 + + - description: Set thermocouple type response + input: + fPort: 7 + bytes: [0x83, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetThermocoupleTypeRsp' + Device: 'R718CJ2' + Status: 'Success' + + - description: Get thermocouple type response + input: + fPort: 7 + bytes: [0x84, 0x15, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetThermocoupleTypeRsp' + Device: 'R718CJ2' + ThermocoupleType: 1 + +downlinkDecoder: + fileName: payload/r718cj2.js + examples: + - description: Configure report request + input: + fPort: 7 + bytes: [0x01, 0x15, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x05, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportReq' + Device: 'R718CJ2' + MinTime: 900 + MaxTime: 1800 + BatteryChange: 0.1 + TemperatureChange: 0.5 + + - description: Read configure report request + input: + fPort: 7 + bytes: [0x02, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R718CJ2' + + - description: Set thermocouple type request + input: + fPort: 7 + bytes: [0x03, 0x15, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetThermocoupleTypeReq' + Device: 'R718CJ2' + ThermocoupleType: 1 + + - description: Get thermocouple type request + input: + fPort: 7 + bytes: [0x04, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetThermocoupleTypeReq' + Device: 'R718CJ2' + +downlinkEncoder: + fileName: payload/r718cj2.js + examples: + - description: Configure report request + input: + data: + Cmd: 'ConfigReportReq' + Device: 'R718CJ2' + MinTime: 900 + MaxTime: 1800 + BatteryChange: 0.1 + TemperatureChange: 0.5 + output: + fPort: 7 + bytes: [0x01, 0x15, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x05, 0x00, 0x00] + + - description: Read configure report request + input: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R718CJ2' + output: + fPort: 7 + bytes: [0x02, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: Set thermocouple type request + input: + data: + Cmd: 'SetThermocoupleTypeReq' + Device: 'R718CJ2' + ThermocoupleType: 1 + output: + fPort: 7 + bytes: [0x03, 0x15, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: Get thermocouple type request + input: + data: + Cmd: 'GetThermocoupleTypeReq' + Device: 'R718CJ2' + output: + fPort: 7 + bytes: [0x04, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] diff --git a/vendor/netvox/r718cj2.yaml b/vendor/netvox/r718cj2.yaml new file mode 100644 index 0000000000..5333c5e9c6 --- /dev/null +++ b/vendor/netvox/r718cj2.yaml @@ -0,0 +1,69 @@ +name: R718CJ2 - Wireless 2-Gang Thermocouple Sensor +description: This equipment is used to detect temperature of the object and medium which thermocouple is contacted. It can be connected to two thermocouples for testing. It uses SX1276 wireless communication module. R718CX2 can be connected according to requirements [type J (R718CJ2), type K (R718CK2), type T thermocouple (R718CT2), type R thermocouple (R718CR2), type N thermocouple (R718CN2). The collected data is displayed in the gateway.] + +hardwareVersions: + - version: '2' + numeric: 2 + +firmwareVersions: + - version: '10' + numeric: 10 + hardwareVersions: + - '2' + + profiles: + EU863-870: + id: profile-eu868 + codec: r718cj2-codec + AS923: + id: profile-as923 + codec: r718cj2-codec + US902-928: + id: profile-us915 + codec: r718cj2-codec + AU915-928: + id: profile-au915 + codec: r718cj2-codec + KR920-923: + id: profile-kr920 + codec: r718cj2-codec + IN865-867: + id: profile-in865 + codec: r718cj2-codec + CN470-510: + id: profile-cn470 + codec: r718cj2-codec + +sensors: + - temperature + +dimensions: + width: 88.19 + length: 112 + height: 32 + +battery: + replaceable: true + type: 2 x 3.6V ER14505 AA lithium battery + +operatingConditions: + temperature: + min: -20 + max: 55 + relativeHumidity: + min: 0 + max: 0.9 + +ipCode: IP65 + +keyProvisioning: + - custom + - join server + +keySecurity: none + +productURL: http://www.netvox.com.tw/product.asp?pro=R718CJ2 +dataSheetURL: http://www.netvox.com.tw/um/R718CJ2/R718CJ2datasheet.pdf + +photos: + main: photos/r718cj2.jpg diff --git a/vendor/netvox/r718cj4-codec.yaml b/vendor/netvox/r718cj4-codec.yaml new file mode 100644 index 0000000000..c3cf6581b9 --- /dev/null +++ b/vendor/netvox/r718cj4-codec.yaml @@ -0,0 +1,166 @@ +uplinkDecoder: + fileName: payload/r718cj4.js + examples: + - description: Startup version report + input: + fPort: 6 + bytes: [0x01, 0x38, 0x00, 0x64, 0x04, 0x20, 0x20, 0x07, 0x29, 0x00, 0x00] + output: + data: + Device: 'R718CJ4' + SWver: 10 + HWver: 4 + Datecode: '20200729' + + - description: Status report (Temperature1 and Temperature2) + input: + fPort: 6 + bytes: [0x01, 0x38, 0x01, 0x24, 0x00, 0xFD, 0x01, 0x6D, 0x00, 0x00, 0x00] + output: + data: + Device: 'R718CJ4' + Volt: 3.6 + Temperature1: 25.3 + Temperature2: 36.5 + + - description: Status report (Temperature3 and Temperature4) + input: + fPort: 6 + bytes: [0x01, 0x38, 0x02, 0x24, 0x02, 0x32, 0x02, 0x71, 0x00, 0x00, 0x00] + output: + data: + Device: 'R718CJ4' + Volt: 3.6 + Temperature3: 56.2 + Temperature4: 62.5 + + - description: Configure report response + input: + fPort: 7 + bytes: [0x81, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportRsp' + Device: 'R718CJ4' + Status: 'Success' + + - description: Read configure report response + input: + fPort: 7 + bytes: [0x82, 0x90, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x05, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigReportRsp' + Device: 'R718CJ4' + MinTime: 900 + MaxTime: 1800 + BatteryChange: 0.1 + TemperatureChange: 0.5 + + - description: Set thermocouple type response + input: + fPort: 7 + bytes: [0x83, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetThermocoupleTypeRsp' + Device: 'R718CJ4' + Status: 'Success' + + - description: Get thermocouple type response + input: + fPort: 7 + bytes: [0x84, 0x91, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetThermocoupleTypeRsp' + Device: 'R718CJ4' + ThermocoupleType: 1 + +downlinkDecoder: + fileName: payload/r718cj4.js + examples: + - description: Configure report request + input: + fPort: 7 + bytes: [0x01, 0x90, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x05, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportReq' + Device: 'R718CJ4' + MinTime: 900 + MaxTime: 1800 + BatteryChange: 0.1 + TemperatureChange: 0.5 + + - description: Read configure report request + input: + fPort: 7 + bytes: [0x02, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R718CJ4' + + - description: Set thermocouple type request + input: + fPort: 7 + bytes: [0x03, 0x90, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetThermocoupleTypeReq' + Device: 'R718CJ4' + ThermocoupleType: 1 + + - description: Get thermocouple type request + input: + fPort: 7 + bytes: [0x04, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetThermocoupleTypeReq' + Device: 'R718CJ4' + +downlinkEncoder: + fileName: payload/r718cj4.js + examples: + - description: Configure report request + input: + data: + Cmd: 'ConfigReportReq' + Device: 'R718CJ4' + MinTime: 900 + MaxTime: 1800 + BatteryChange: 0.1 + TemperatureChange: 0.5 + output: + fPort: 7 + bytes: [0x01, 0x90, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x05, 0x00, 0x00] + + - description: Read configure report request + input: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R718CJ4' + output: + fPort: 7 + bytes: [0x02, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: Set thermocouple type request + input: + data: + Cmd: 'SetThermocoupleTypeReq' + Device: 'R718CJ4' + ThermocoupleType: 1 + output: + fPort: 7 + bytes: [0x03, 0x90, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: Get thermocouple type request + input: + data: + Cmd: 'GetThermocoupleTypeReq' + Device: 'R718CJ4' + output: + fPort: 7 + bytes: [0x04, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] diff --git a/vendor/netvox/r718cj4.yaml b/vendor/netvox/r718cj4.yaml new file mode 100644 index 0000000000..2d9430afa0 --- /dev/null +++ b/vendor/netvox/r718cj4.yaml @@ -0,0 +1,69 @@ +name: R718CJ4 - Wireless 4-Gang Thermocouple Sensor +description: This equipment is used to detect temperature of the object and medium which thermocouple is contacted. It can be connected to four thermocouples for testing. It uses SX1276 wireless communication module. R718CX4 can be connected according to requirements [type J (R718CJ4), type K (R718CK4), type T thermocouple (R718CT4), type R thermocouple (R718CR4), type N thermocouple (R718CN4). The collected data is displayed in the gateway.] + +hardwareVersions: + - version: '4' + numeric: 4 + +firmwareVersions: + - version: '10' + numeric: 10 + hardwareVersions: + - '4' + + profiles: + EU863-870: + id: profile-eu868 + codec: r718cj4-codec + AS923: + id: profile-as923 + codec: r718cj4-codec + US902-928: + id: profile-us915 + codec: r718cj4-codec + AU915-928: + id: profile-au915 + codec: r718cj4-codec + KR920-923: + id: profile-kr920 + codec: r718cj4-codec + IN865-867: + id: profile-in865 + codec: r718cj4-codec + CN470-510: + id: profile-cn470 + codec: r718cj4-codec + +sensors: + - temperature + +dimensions: + width: 88.19 + length: 112 + height: 32 + +battery: + replaceable: true + type: 2 x 3.6V ER14505 AA lithium battery + +operatingConditions: + temperature: + min: -20 + max: 55 + relativeHumidity: + min: 0 + max: 0.9 + +ipCode: IP65 + +keyProvisioning: + - custom + - join server + +keySecurity: none + +productURL: http://www.netvox.com.tw/product.asp?pro=R718CJ4 +dataSheetURL: http://www.netvox.com.tw/um/R718CJ4/R718CJ4datasheet.pdf + +photos: + main: photos/r718cj4.jpg diff --git a/vendor/netvox/r718ec-codec.yaml b/vendor/netvox/r718ec-codec.yaml new file mode 100755 index 0000000000..da6b7aa51b --- /dev/null +++ b/vendor/netvox/r718ec-codec.yaml @@ -0,0 +1,271 @@ +uplinkDecoder: + fileName: payload/r718ec.js + examples: + - description: Startup version report + input: + fPort: 6 + bytes: [0x01, 0x1C, 0x00, 0x64, 0x02, 0x20, 0x20, 0x12, 0x08, 0x00, 0x00] + output: + data: + Device: 'R718EC' + SWver: 10 + HWver: 2 + Datecode: '20201208' + + - description: Status report - 1 + input: + fPort: 6 + bytes: [0x01, 0x1C, 0x01, 0x24, 0xB3, 0x40, 0xB2, 0xC0, 0x6A, 0x3E, 0x01] + output: + data: + Device: 'R718EC' + Volt: 3.6 + AccelerationX: 5.59375 + AccelerationY: -5.5625 + AccelerationZ: 0.228516 + ActiveStatus: 1 + + - description: Status report - 2 + input: + fPort: 6 + bytes: [0x01, 0x1C, 0x02, 0x33, 0x3D, 0x00, 0x3C, 0xB3, 0x40, 0xFF, 0x97] + output: + data: + Device: 'R718EC' + VelocityX: 0.043701 + VelocityY: 0.007813 + VelocityZ: 5.59375 + TemperaturewithNTC: -10.5 + + - description: Status report - 3 + input: + fPort: 6 + bytes: [0x01, 0x1C, 0x03, 0x24, 0x07, 0xD0, 0x0F, 0xA0, 0x01, 0xF4, 0x15] + output: + data: + Device: 'R718EC' + Volt: 3.6 + AngleX: 10 + AngleY: 20 + AngleZ: 2.5 + LowAngleXAlarm: 1 + HighAngleXAlarm: 0 + LowAngleYAlarm: 1 + HighAngleYAlarm: 0 + LowAngleZAlarm: 1 + HighAngleZAlarm: 0 + + - description: Status report - 4 + input: + fPort: 6 + bytes: [0x01, 0x1C, 0x04, 0x24, 0x15, 0x2A, 0x01] + output: + data: + Device: 'R718EC' + Volt: 3.6 + LowAccelerationXAlarm: 1 + HighAccelerationXAlarm: 0 + LowAccelerationYAlarm: 1 + HighAccelerationYAlarm: 0 + LowAccelerationZAlarm: 1 + HighAccelerationZAlarm: 0 + LowVelocityXAlarm: 0 + HighVelocityXAlarm: 1 + LowVelocityYAlarm: 0 + HighVelocityYAlarm: 1 + LowVelocityZAlarm: 0 + HighVelocityZAlarm: 1 + LowTemperaturewithAlarm: 1 + HighTemperaturewithAlarm: 0 + + - description: Configure report response + input: + fPort: 7 + bytes: [0x81, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportRsp' + Device: 'R718EC' + Status: 'Success' + + - description: Read configure report response + input: + fPort: 7 + bytes: [0x82, 0x1C, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x03, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigReportRsp' + Device: 'R718EC' + MinTime: 900 + MaxTime: 1800 + BatteryChange: 0.1 + AccelerationChange: 3 + + - description: Set active threshold response + input: + fPort: 7 + bytes: [0x83, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetActiveThresholdRsp' + Device: 'R718EC' + Status: 'Success' + + - description: Get active threshold response + input: + fPort: 7 + bytes: [0x84, 0x1C, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetActiveThresholdRsp' + Device: 'R718EC' + ActiveThreshold: 3 + InActiveThreshold: 2 + + - description: Set restore report response + input: + fPort: 7 + bytes: [0x87, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetRestoreReportRsp' + Device: 'R718EC' + Status: 'Success' + + - description: Get restore report response + input: + fPort: 7 + bytes: [0x88, 0x1C, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetRestoreReportRsp' + Device: 'R718EC' + RestoreReportSet: 1 + +downlinkDecoder: + fileName: payload/r718ec.js + examples: + - description: Configure report request + input: + fPort: 7 + bytes: [0x01, 0x1C, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x01, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportReq' + Device: 'R718EC' + MinTime: 900 + MaxTime: 1800 + BatteryChange: 0.1 + AccelerationChange: 1 + + - description: Read configure report request + input: + fPort: 7 + bytes: [0x02, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R718EC' + + - description: Set active threshold request + input: + fPort: 7 + bytes: [0x03, 0x1C, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetActiveThresholdReq' + Device: 'R718EC' + ActiveThreshold: 3 + InActiveThreshold: 2 + + - description: Get active threshold request + input: + fPort: 7 + bytes: [0x04, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetActiveThresholdReq' + Device: 'R718EC' + + - description: Set restore report request + input: + fPort: 7 + bytes: [0x07, 0x1C, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetRestoreReportReq' + Device: 'R718EC' + RestoreReportSet: 1 + + - description: Get restore report request + input: + fPort: 7 + bytes: [0x08, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetRestoreReportReq' + Device: 'R718EC' + +downlinkEncoder: + fileName: payload/r718ec.js + examples: + - description: Configure report request + input: + data: + Cmd: 'ConfigReportReq' + Device: 'R718EC' + MinTime: 900 + MaxTime: 1800 + BatteryChange: 0.1 + AccelerationChange: 1 + output: + fPort: 7 + bytes: [0x01, 0x1C, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x01, 0x00, 0x00] + + - description: Read configure report request + input: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R718EC' + output: + fPort: 7 + bytes: [0x02, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: Set active threshold request + input: + data: + Cmd: 'SetActiveThresholdReq' + Device: 'R718EC' + ActiveThreshold: 3 + InActiveThreshold: 2 + output: + fPort: 7 + bytes: [0x03, 0x1C, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: Get active threshold request + input: + data: + Cmd: 'GetActiveThresholdReq' + Device: 'R718EC' + output: + fPort: 7 + bytes: [0x04, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: Set restore report request + input: + data: + Cmd: 'SetRestoreReportReq' + Device: 'R718EC' + RestoreReportSet: 1 + output: + fPort: 7 + bytes: [0x07, 0x1C, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: Get restore report request + input: + data: + Cmd: 'GetRestoreReportReq' + Device: 'R718EC' + output: + fPort: 7 + bytes: [0x08, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] diff --git a/vendor/netvox/r718ec.yaml b/vendor/netvox/r718ec.yaml new file mode 100755 index 0000000000..8668277d54 --- /dev/null +++ b/vendor/netvox/r718ec.yaml @@ -0,0 +1,73 @@ +name: R718EC - Wireless Accelerometer and Surface Temperature Sensor +description: The R718EC is identified as a LoRaWAN ClassA device with three-axis acceleration, temperature and is compatible with the LoRaWAN protocol. When the device moves or vibrates over the threshold value, it immediately reports the temperature, acceleration, and velocity of the X, Y, and Z axes + +hardwareVersions: + - version: '2' + numeric: 2 + +firmwareVersions: + - version: '10' + numeric: 10 + hardwareVersions: + - '2' + + profiles: + EU863-870: + id: profile-eu868 + codec: r718ec-codec + AS923: + id: profile-as923 + codec: r718ec-codec + US902-928: + id: profile-us915 + codec: r718ec-codec + AU915-928: + id: profile-au915 + codec: r718ec-codec + KR920-923: + id: profile-kr920 + codec: r718ec-codec + IN865-867: + id: profile-in865 + codec: r718ec-codec + CN470-510: + id: profile-cn470 + codec: r718ec-codec + +sensors: + - accelerometer + - velocity + - temperature + +dimensions: + width: 88.19 + length: 112 + height: 32 + +weight: 141 + +battery: + replaceable: true + type: 2 x 3.6V ER14505 AA lithium batteries + +operatingConditions: + temperature: + min: -20 + max: 55 + relativeHumidity: + min: 0 + max: 0.9 + +ipCode: IP65 + +keyProvisioning: + - custom + - join server + +keySecurity: none + +productURL: http://www.netvox.com.tw/product.asp?pro=R718EC +dataSheetURL: http://www.netvox.com.tw/um/R718E/R718ECdatasheet.pdf + +photos: + main: photos/r718ec.jpg diff --git a/vendor/netvox/r718kb-codec.yaml b/vendor/netvox/r718kb-codec.yaml new file mode 100644 index 0000000000..41a26cb44f --- /dev/null +++ b/vendor/netvox/r718kb-codec.yaml @@ -0,0 +1,96 @@ +uplinkDecoder: + fileName: payload/r718kb.js + examples: + - description: Startup version report + input: + fPort: 6 + bytes: [0x01, 0x23, 0x00, 0x64, 0x01, 0x20, 0x20, 0x07, 0x29, 0x00, 0x00] + output: + data: + Device: 'R718KB' + SWver: 100 + HWver: 1 + Datecode: '20200729' + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0x23, 0x01, 0x24, 0x00, 0x00, 0x00, 0x03, 0xE8, 0x00, 0x00, 0x00] + output: + data: + Device: 'R718KB' + Volt: 3.6 + Resistive: 1000 + + - description: Configure report response + input: + fPort: 7 + bytes: [0x81, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportRsp' + Device: 'R718KB' + Status: 'Success' + + - description: Read configure report response + input: + fPort: 7 + bytes: [0x82, 0x23, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x00, 0x03, 0xE8] + output: + data: + Cmd: 'ReadConfigReportRsp' + Device: 'R718KB' + MinTime: 900 + MaxTime: 1800 + BatteryChange: 0.1 + ResistiveChange: 1000 + +downlinkDecoder: + fileName: payload/r718kb.js + examples: + - description: Configure report request + input: + fPort: 7 + bytes: [0x01, 0x23, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x00, 0x03, 0xE8] + output: + data: + Cmd: 'ConfigReportReq' + Device: 'R718KB' + MinTime: 900 + MaxTime: 1800 + BatteryChange: 0.1 + ResistiveChange: 1000 + + - description: Read configure report request + input: + fPort: 7 + bytes: [0x02, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R718KB' + +downlinkEncoder: + fileName: payload/r718kb.js + examples: + - description: Configure report request + input: + data: + Cmd: 'ConfigReportReq' + Device: 'R718KB' + MinTime: 900 + MaxTime: 1800 + BatteryChange: 0.1 + ResistiveChange: 1000 + output: + fPort: 7 + bytes: [0x01, 0x23, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x00, 0x03, 0xE8] + + - description: Read configure report request + input: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R718KB' + output: + fPort: 7 + bytes: [0x02, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] diff --git a/vendor/netvox/r718kb.yaml b/vendor/netvox/r718kb.yaml new file mode 100644 index 0000000000..ca320b5094 --- /dev/null +++ b/vendor/netvox/r718kb.yaml @@ -0,0 +1,71 @@ +name: R718KB - Wireless Resistive Sensor Interface +description: The Wireless Resistive Sensor Interface is designed for a variety of resistive sensing applications. It can support applications that use resistive sensors and other general resistive signal-conditioning applications. + +hardwareVersions: + - version: '1' + numeric: 1 + +firmwareVersions: + - version: '10' + numeric: 10 + hardwareVersions: + - '1' + + profiles: + EU863-870: + id: profile-eu868 + codec: r718kb-codec + AS923: + id: profile-as923 + codec: r718kb-codec + US902-928: + id: profile-us915 + codec: r718kb-codec + AU915-928: + id: profile-au915 + codec: r718kb-codec + KR920-923: + id: profile-kr920 + codec: r718kb-codec + IN865-867: + id: profile-in865 + codec: r718kb-codec + CN470-510: + id: profile-cn470 + codec: r718kb-codec + +sensors: + - analog input + +dimensions: + width: 65 + length: 112 + height: 32 + +weight: 141 + +battery: + replaceable: true + type: 2 x 3.6V ER14505 AA lithium batteries + +operatingConditions: + temperature: + min: -20 + max: 55 + relativeHumidity: + min: 0 + max: 0.9 + +ipCode: IP67 + +keyProvisioning: + - custom + - join server + +keySecurity: none + +productURL: http://www.netvox.com.tw/product.asp?pro=R718KB +dataSheetURL: http://www.netvox.com.tw/um/R718KB/R718KBdatasheet.pdf + +photos: + main: photos/r718kb.jpg diff --git a/vendor/netvox/r718pa.yaml b/vendor/netvox/r718pa.yaml index 2372c9d355..078518a5d5 100755 --- a/vendor/netvox/r718pa.yaml +++ b/vendor/netvox/r718pa.yaml @@ -33,10 +33,8 @@ firmwareVersions: CN470-510: id: profile-cn470 codec: r718pa-codec - sensors: - level - dimensions: width: 88.19 length: 112 diff --git a/vendor/netvox/r718pa4.yaml b/vendor/netvox/r718pa4.yaml index b34dbdbf03..2ff45825b9 100755 --- a/vendor/netvox/r718pa4.yaml +++ b/vendor/netvox/r718pa4.yaml @@ -33,10 +33,8 @@ firmwareVersions: CN470-510: id: profile-cn470 codec: r718pa4-codec - sensors: - level - dimensions: width: 88.19 length: 112 diff --git a/vendor/netvox/r718pb.yaml b/vendor/netvox/r718pb.yaml index 90af6f6576..26f353e782 100755 --- a/vendor/netvox/r718pb.yaml +++ b/vendor/netvox/r718pb.yaml @@ -33,10 +33,8 @@ firmwareVersions: CN470-510: id: profile-cn470 codec: r718pb-codec - sensors: - level - dimensions: width: 88.19 length: 112 diff --git a/vendor/netvox/r718pb15a-codec.yaml b/vendor/netvox/r718pb15a-codec.yaml new file mode 100755 index 0000000000..3d7d1c0314 --- /dev/null +++ b/vendor/netvox/r718pb15a-codec.yaml @@ -0,0 +1,567 @@ +uplinkDecoder: + fileName: payload/r718pb15a.js + examples: + - description: Startup version report + input: + fPort: 6 + bytes: [0x01, 0x58, 0x00, 0x6E, 0x06, 0x20, 0x23, 0x09, 0x11, 0x00, 0x00] + output: + data: + Device: 'R718PB15A' + 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: 'R718PB15A' + 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: 'R718PB15A' + 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: 'R718PB15A' + 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: 'R718PB15A' + 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: 'R718PB15A' + 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: 'R718PB15A' + 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: 'R718PB15A' + 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: 'R718PB15A' + 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: 'R718PB15A' + 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: 'R718PB15A' + 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: 'R718PB15A' + 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: 'R718PB15A' + 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: 'R718PB15A' + 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: 'R718PB15A' + 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: 'R718PB15A' + 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: 'R718PB15A' + 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: 'R718PB15A' + 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: 'R718PB15A' + 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: 'R718PB15A' + Status: 'Success' + + - description: GetLDOSettingRsp + input: + fPort: 7 + bytes: [0x84, 0x58, 0x03, 0x05, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'GetLDOSettingRsp' + Device: 'R718PB15A' + 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: 'R718PB15A' + Status: 'Failure' + + - description: PHCalibrateRsp + input: + fPort: 7 + bytes: [0x86, 0x58, 0x07, 0x84, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'PHCalibrateRsp' + Device: 'R718PB15A' + Status: 'Failure' + + - description: NTUCalibrateRsp + input: + fPort: 7 + bytes: [0x87, 0x58, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'NTUCalibrateRsp' + Device: 'R718PB15A' + Status: 'Failure' + + - description: SetWireLengthRsp + input: + fPort: 7 + bytes: [0x88, 0x58, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'SetWireLengthRsp' + Device: 'R718PB15A' + Status: 'Failure' + + - description: GetWireLengthRsp + input: + fPort: 7 + bytes: [0x89, 0x58, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'GetWireLengthRsp' + Device: 'R718PB15A' + Length: 900 + + - description: SetSoilTypeRsp + input: + fPort: 7 + bytes: [0x8A, 0x58, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'SetSoilTypeRsp' + Device: 'R718PB15A' + Status: 'Failure' + + - description: GetSoilTypeRsp + input: + fPort: 7 + bytes: [0x8B, 0x58, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'GetSoilTypeRsp' + Device: 'R718PB15A' + SoilType: 3 + + - description: SoilCalibrateRsp + input: + fPort: 7 + bytes: [0x8C, 0x58, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x14, 0x01, 0x00] + output: + data: + Cmd: 'SoilCalibrateRsp' + Device: 'R718PB15A' + Status: 'Failure' + +downlinkDecoder: + fileName: payload/r718pb15a.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: 'R718PB15A' + 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: 'R718PB15A' + + - description: SetLDOSettingReq + input: + fPort: 7 + bytes: [0x03, 0x58, 0x04, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetLDOSettingReq' + Device: 'R718PB15A' + 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: 'R718PB15A' + + - description: ORPCalibrateReq + input: + fPort: 7 + bytes: [0x05, 0x58, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ORPCalibrateReq' + Device: 'R718PB15A' + StandORP: 2048 + + - description: PHCalibrateReq + input: + fPort: 7 + bytes: [0x06, 0x58, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'PHCalibrateReq' + Device: 'R718PB15A' + StandPH: 1792 + + - description: NTUCalibrateReq + input: + fPort: 7 + bytes: [0x07, 0x58, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'NTUCalibrateReq' + Device: 'R718PB15A' + StandNTU: 1024 + + - description: SetWireLengthReq + input: + fPort: 7 + bytes: [0x08, 0x58, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetWireLengthReq' + Device: 'R718PB15A' + Length: 10240 + + - description: GetWireLengthReq + input: + fPort: 7 + bytes: [0x09, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetWireLengthReq' + Device: 'R718PB15A' + + - description: SetSoilTypeReq + input: + fPort: 7 + bytes: [0x0A, 0x58, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetSoilTypeReq' + Device: 'R718PB15A' + SoildType: 6 + + - description: GetSoilTypeReq + input: + fPort: 7 + bytes: [0x0B, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetSoilTypeReq' + Device: 'R718PB15A' + + - description: SoilCalibrateReq + input: + fPort: 7 + bytes: [0x0C, 0x58, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SoilCalibrateReq' + Device: 'R718PB15A' + VWCDelt: 8% + +downlinkEncoder: + fileName: payload/r718pb15a.js + examples: + - description: Configure report request + input: + data: + Cmd: 'ConfigReportReq' + Device: 'R718PB15A' + 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: 'R718PB15A' + output: + fPort: 7 + bytes: [0x02, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: SetLDOSettingReq + input: + data: + Cmd: 'SetLDOSettingReq' + Device: 'R718PB15A' + 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: 'R718PB15A' + output: + fPort: 7 + bytes: [0x04, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: ORPCalibrateReq + input: + data: + Cmd: 'ORPCalibrateReq' + Device: 'R718PB15A' + StandORP: 500 + output: + fPort: 7 + bytes: [0x05, 0x58, 0x01, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: PHCalibrateReq + input: + data: + Cmd: 'PHCalibrateReq' + Device: 'R718PB15A' + StandPH: 1800 + output: + fPort: 7 + bytes: [0x06, 0x58, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: NTUCalibrateReq + input: + data: + Cmd: 'NTUCalibrateReq' + Device: 'R718PB15A' + StandNTU: 500 + output: + fPort: 7 + bytes: [0x07, 0x58, 0x01, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: SetWireLengthReq + input: + data: + Cmd: 'SetWireLengthReq' + Device: 'R718PB15A' + Length: 5000 + output: + fPort: 7 + bytes: [0x08, 0x58, 0x01, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: GetWireLengthReq + input: + data: + Cmd: 'GetWireLengthReq' + Device: 'R718PB15A' + output: + fPort: 7 + bytes: [0x09, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: SetSoilTypeReq + input: + data: + Cmd: 'SetSoilTypeReq' + Device: 'R718PB15A' + SoildType: 8 + output: + fPort: 7 + bytes: [0x0A, 0x58, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: GetSoilTypeReq + input: + data: + Cmd: 'GetSoilTypeReq' + Device: 'R718PB15A' + output: + fPort: 7 + bytes: [0x0B, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: SoilCalibrateReq + input: + data: + Cmd: 'SoilCalibrateReq' + Device: 'R718PB15A' + VWCDelt: 50 + output: + fPort: 7 + bytes: [0x0C, 0x58, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] diff --git a/vendor/netvox/r718pb15a.yaml b/vendor/netvox/r718pb15a.yaml new file mode 100755 index 0000000000..6a06ed9b55 --- /dev/null +++ b/vendor/netvox/r718pb15a.yaml @@ -0,0 +1,63 @@ +name: R718PB15A - 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: r718pb15a-codec + AS923: + id: profile-as923 + codec: r718pb15a-codec + US902-928: + id: profile-us915 + codec: r718pb15a-codec + AU915-928: + id: profile-au915 + codec: r718pb15a-codec + KR920-923: + id: profile-kr920 + codec: r718pb15a-codec + IN865-867: + id: profile-in865 + codec: r718pb15a-codec + CN470-510: + id: profile-cn470 + codec: r718pb15a-codec +sensors: + - level +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 + +photos: + main: photos/r718pb.jpg diff --git a/vendor/netvox/r718pc-codec.yaml b/vendor/netvox/r718pc-codec.yaml new file mode 100644 index 0000000000..c7289856f9 --- /dev/null +++ b/vendor/netvox/r718pc-codec.yaml @@ -0,0 +1,13 @@ +uplinkDecoder: + fileName: payload/r718pc.js + examples: + - description: Startup version report + input: + fPort: 6 + bytes: [0x01, 0x72, 0x00, 0x64, 0x01, 0x20, 0x20, 0x07, 0x29, 0x00, 0x00] + output: + data: + Device: 'R718PC' + SWver: 100 + HWver: 1 + Datecode: '20200729' diff --git a/vendor/netvox/r718pc.yaml b/vendor/netvox/r718pc.yaml new file mode 100644 index 0000000000..2cd2eef17e --- /dev/null +++ b/vendor/netvox/r718pc.yaml @@ -0,0 +1,66 @@ +name: R718PC - Wireless Sensor +description: R718PC is a Class C type device based on the LoRaWAN open protocol of Netvox and is compatible with the LoRaWAN protocol. + +hardwareVersions: + - version: '1' + numeric: 1 + +firmwareVersions: + - version: '10' + numeric: 10 + hardwareVersions: + - '1' + + profiles: + EU863-870: + id: profile-eu868 + codec: r718pc-codec + AS923: + id: profile-as923 + codec: r718pc-codec + US902-928: + id: profile-us915 + codec: r718pc-codec + AU915-928: + id: profile-au915 + codec: r718pc-codec + KR920-923: + id: profile-kr920 + codec: r718pc-codec + IN865-867: + id: profile-in865 + codec: r718pc-codec + CN470-510: + id: profile-cn470 + codec: r718pc-codec + +dimensions: + width: 88.19 + length: 112 + height: 32 + +battery: + replaceable: true + type: 2 x 3.6V ER14505 AA lithium battery + +operatingConditions: + temperature: + min: -20 + max: 55 + relativeHumidity: + min: 0 + max: 0.9 + +ipCode: IP65 + +keyProvisioning: + - custom + - join server + +keySecurity: none + +productURL: http://www.netvox.com.tw/product.asp?pro=R718PC +dataSheetURL: http://www.netvox.com.tw/um/R718PC/R718PCdatasheet.pdf + +photos: + main: photos/r718pc.jpg diff --git a/vendor/netvox/r72632a01-codec.yaml b/vendor/netvox/r72632a01-codec.yaml new file mode 100755 index 0000000000..c523539244 --- /dev/null +++ b/vendor/netvox/r72632a01-codec.yaml @@ -0,0 +1,258 @@ +uplinkDecoder: + fileName: payload/ra0715_r72615_ra0715y_r72615a.js + examples: + - description: Startup version report + input: + fPort: 6 + bytes: [0x01, 0x09, 0x00, 0x82, 0x04, 0x20, 0x20, 0x11, 0x05, 0x00, 0x00] + output: + data: + Device: 'R726 Series' + SWver: 13 + HWver: 4 + Datecode: '20201105' + + - description: Status report - 1 + input: + fPort: 6 + bytes: [0x01, 0x09, 0x01, 0x48, 0x00, 0x64, 0x00, 0xC8, 0x02, 0xBC, 0x00] + output: + data: + Device: 'R726 Series' + Volt: 7.2 + PM1_0: 100 + PM2_5: 200 + PM10: 700 + + - description: Status report - 2 + input: + fPort: 6 + bytes: [0x01, 0x09, 0x02, 0x48, 0x00, 0x64, 0x00, 0xC8, 0x02, 0xBC, 0x00] + output: + data: + Device: 'R726 Series' + Volt: 7.2 + PM1_0: 100 + PM2_5: 200 + PM10: 700 + + - description: Status report - 3 + input: + fPort: 6 + bytes: [0x01, 0x09, 0x03, 0x48, 0x00, 0x64, 0x00, 0xC8, 0x02, 0xBC, 0x00] + output: + data: + Device: 'R726 Series' + Volt: 7.2 + um0_3: 100 + um0_5: 200 + um1_0: 700 + + - description: Status report - 4 + input: + fPort: 6 + bytes: [0x01, 0x09, 0x04, 0x48, 0x00, 0x64, 0x00, 0xC8, 0x02, 0xBC, 0x00] + output: + data: + Device: 'R726 Series' + Volt: 7.2 + um2_5: 100 + um5_0: 200 + um10: 700 + + - description: Status report - 5 + input: + fPort: 6 + bytes: [0x01, 0x09, 0x05, 0x48, 0x00, 0x64, 0x00, 0xC8, 0x02, 0xBC, 0x00] + output: + data: + Device: 'R726 Series' + Volt: 7.2 + O3: 10 + CO: 20 + NO: 70 + + - description: Status report - 6 + input: + fPort: 6 + bytes: [0x01, 0x09, 0x06, 0x48, 0x00, 0x64, 0x00, 0xC8, 0x02, 0xBC, 0x00] + output: + data: + Device: 'R726 Series' + Volt: 7.2 + NO2: 10 + SO2: 20 + H2S: 70 + + - description: Status report - 7 + input: + fPort: 6 + bytes: [0x01, 0x09, 0x07, 0x48, 0x13, 0x88, 0xFF, 0xFF, 0xFF, 0xFF, 0x00] + output: + data: + Device: 'R726 Series' + Volt: 7.2 + CO2: 500 + NH3: 'NoSensor' + Noise: 'NoSensor' + + - description: Status report - 8 + input: + fPort: 6 + bytes: [0x01, 0x09, 0x08, 0x48, 0x03, 0xE8, 0xFF, 0xFF, 0xFF, 0xF6, 0x00] + output: + data: + Device: 'R726 Series' + Volt: 7.2 + PH: 10 + TempPH: 'NoSensor' + ORP: -10 + + - description: Status report - 9 + input: + fPort: 6 + bytes: [0x01, 0x09, 0x09, 0x48, 0x03, 0xE8, 0xFC, 0xE8, 0x03, 0xE8, 0x00] + output: + data: + Device: 'R726 Series' + Volt: 7.2 + NTU: 100 + TempNTU: -7.92 + EC5SoildHumi: 10 + + - description: Status report - 0A + input: + fPort: 6 + bytes: [0x01, 0x09, 0x0A, 0x48, 0x03, 0xE8, 0xFF, 0x30, 0xFF, 0xFF, 0xFF] + output: + data: + Device: 'R726 Series' + Volt: 7.2 + SoildHumi5TE: 10 + SoildTemp5TE: -2.08 + WaterLevel: 'NoSensor' + EC5TE: 'NoSensor' + + - description: Status report - 0B + input: + fPort: 6 + bytes: [0x01, 0x09, 0x0B, 0x48, 0xF8, 0x30, 0x03, 0xE8, 0x03, 0xE8, 0x00] + output: + data: + Device: 'R726 Series' + Volt: 7.2 + TempLDO: -20 + LDO_DO: 10 + LDO_Sat: 100 + + - description: Status report - 0C + input: + fPort: 6 + bytes: [0x01, 0x09, 0x0C, 0x48, 0xF8, 0x30, 0x03, 0xE8, 0xFF, 0xFF, 0x00] + output: + data: + Device: 'R726 Series' + Volt: 7.2 + Temperature: -20 + Humidity: 10 + WindSpeed: 'NoSensor' + + - description: Status report - 0D + input: + fPort: 6 + bytes: [0x01, 0x09, 0x0D, 0x48, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x99, 0x00] + output: + data: + Device: 'R726 Series' + Volt: 7.2 + WindDirection: 10 + Atomsphere: 1.53 + + - description: Status report - 0E + input: + fPort: 6 + bytes: [0x01, 0x09, 0x0E, 0x48, 0x03, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Device: 'R726 Series' + Volt: 7.2 + VOC: 90 + + - description: Status report - 0F + input: + fPort: 6 + bytes: [0x01, 0x09, 0x0F, 0x48, 0x03, 0x84, 0x1A, 0x02, 0x01, 0x23, 0x00] + output: + data: + Device: 'R726 Series' + Volt: 7.2 + Nitrogen: 900 + Phosphorus: 6658 + Potassium: 291 + + - description: Configure report response + input: + fPort: 7 + bytes: [0x81, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportRsp' + Device: 'R726 Series' + Status: 'Success' + + - description: Read configure report response + input: + fPort: 7 + bytes: [0x82, 0x09, 0x03, 0x84, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigReportRsp' + Device: 'R726 Series' + MinTime: 900 + MaxTime: 1800 + +downlinkDecoder: + fileName: payload/ra0715_r72615_ra0715y_r72615a.js + examples: + - description: Configure report request + input: + fPort: 7 + bytes: [0x01, 0x09, 0x03, 0x84, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportReq' + Device: 'R726 Series' + MinTime: 900 + MaxTime: 1800 + + - description: Read configure report request + input: + fPort: 7 + bytes: [0x02, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R726 Series' + +downlinkEncoder: + fileName: payload/ra0715_r72615_ra0715y_r72615a.js + examples: + - description: Configure report request + input: + data: + Cmd: 'ConfigReportReq' + Device: 'R726 Series' + MinTime: 900 + MaxTime: 1800 + output: + fPort: 7 + bytes: [0x01, 0x09, 0x03, 0x84, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: Read configure report request + input: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R726 Series' + output: + fPort: 7 + bytes: [0x02, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] diff --git a/vendor/netvox/r72632a01.yaml b/vendor/netvox/r72632a01.yaml new file mode 100755 index 0000000000..f6cde29cad --- /dev/null +++ b/vendor/netvox/r72632a01.yaml @@ -0,0 +1,51 @@ +name: R72632A01 - Wireless Outdoor Nitrogen/Phosphorus/Potassium Sensor with Solar Panel +description: > + The R72632A01 is equipped with a temperature and humidity sensor that detects and transmits ambient temperature and humidity data. It is a wireless communication method that uses the SX1276 wireless communication module. +hardwareVersions: + - version: '4' + numeric: 4 +firmwareVersions: + - version: '13' + numeric: 13 + hardwareVersions: + - '4' + profiles: + EU863-870: + id: profile-eu868 + codec: r72632a01-codec + AS923: + id: profile-as923 + codec: r72632a01-codec + US902-928: + id: profile-us915 + codec: r72632a01-codec + AU915-928: + id: profile-au915 + codec: r72632a01-codec + KR920-923: + id: profile-kr920 + codec: r72632a01-codec + IN865-867: + id: profile-in865 + codec: r72632a01-codec + CN470-510: + id: profile-cn470 + codec: r72632a01-codec +dimensions: + diameter: 220 + height: 340 +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=R72632A01 +dataSheetURL: http://www.netvox.com.tw/um/R72616/R72632A01datasheet.pdf +photos: + main: photos/r72616.jpg diff --git a/vendor/netvox/r900a01-codec.yaml b/vendor/netvox/r900a01-codec.yaml new file mode 100755 index 0000000000..6fdca7811e --- /dev/null +++ b/vendor/netvox/r900a01-codec.yaml @@ -0,0 +1,160 @@ +uplinkDecoder: + fileName: payload/r900a01.js + examples: + - description: Startup version report + input: + fPort: 22 + bytes: [0x03, 0x01, 0x09, 0x00, 0x64, 0x0B, 0x20, 0x19, 0x11, 0x12] + output: + data: + Device: 'R900A01' + SWver: 10 + HWver: 11 + Datecode: '20191112' + + - description: Status report + input: + fPort: 22 + bytes: [0x03, 0x01, 0x09, 0x01, 0x78, 0x07, 0x08, 0x04, 0x4c, 0x00, 0x00] + output: + data: + Device: 'R900A01' + Volt: 12 + Temperature: '18℃' + Humidity: '11%' + LowTemperatureAlarm: 0 + HighTemperatureAlarm: 0 + LowHumidityAlarm: 0 + HighHumidityAlarm: 0 + ShockTamperAlarm: 'NoAlarm' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x81, 0x01, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportRsp' + Device: 'R900A01' + Status: 'Success' + + - description: Read configure report response + input: + fPort: 23 + bytes: [0x82, 0x01, 0x09, 0x03, 0x84, 0x07, 0x08, 0x01, 0x50, 0x06, 0x01] + output: + data: + Cmd: 'ReadConfigReportRsp' + Device: 'R900A01' + MinTime: 900 + MaxTime: 1800 + TemperatureChange: '3.36℃' + HumidityChange: '15.37%' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x83, 0x01, 0x09, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetShockSensorSensitivityRsp' + Device: 'R900A01' + Status: 'Failure' + + - description: Read configure report response + input: + fPort: 23 + bytes: [0x84, 0x01, 0x09, 0x08, 0x84, 0x07, 0x08, 0x01, 0x50, 0x06, 0x01, 0x02, 0x01] + output: + data: + Cmd: 'GetShockSensorSensitivityRsp' + Device: 'R900A01' + ShockSensorSensitivity: 8 + +downlinkDecoder: + fileName: payload/r900a01.js + examples: + - description: Configure report request + input: + fPort: 23 + bytes: [0x01, 0x01, 0x09, 0x03, 0x84, 0x07, 0x08, 0x01, 0x01, 0x00, 0x04, 0x02, 0x10] + output: + data: + Cmd: 'ConfigReportReq' + Device: 'R900A01' + MinTime: 900 + MaxTime: 1800 + TemperatureChange: '2.57℃' + HumidityChange: '0.04%' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x02, 0x01, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R900A01' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x03, 0x01, 0x09, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetShockSensorSensitivityReq' + Device: 'R900A01' + ShockSensorSensitivity: 6 + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x04, 0x01, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetShockSensorSensitivityReq' + Device: 'R900A01' + +downlinkEncoder: + fileName: payload/r900a01.js + examples: + - description: Configure report request + input: + data: + Cmd: 'ConfigReportReq' + Device: 'R900A01' + MinTime: 900 + MaxTime: 1800 + TemperatureChange: 2.57 + HumidityChange: 0.06 + output: + fPort: 23 + bytes: [0x01, 0x01, 0x09, 0x03, 0x84, 0x07, 0x08, 0x01, 0x01, 0x00, 0x06] + + - description: Read configure report request + input: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R900A01' + output: + fPort: 23 + bytes: [0x02, 0x01, 0x09] + + - description: Read configure report request + input: + data: + Cmd: 'SetShockSensorSensitivityReq' + Device: 'R900A01' + ShockSensorSensitivity: 5 + output: + fPort: 23 + bytes: [0x03, 0x01, 0x09, 0x05] + + - description: Read configure report request + input: + data: + Cmd: 'GetShockSensorSensitivityReq' + Device: 'R900A01' + output: + fPort: 23 + bytes: [0x04, 0x01, 0x09] diff --git a/vendor/netvox/r900a01.yaml b/vendor/netvox/r900a01.yaml new file mode 100755 index 0000000000..2ff52a6c7e --- /dev/null +++ b/vendor/netvox/r900a01.yaml @@ -0,0 +1,69 @@ +name: R900A01 - Wireless Water leak Sensor +description: The Netvox R900A01 Water Leak Detector comes with two water leak sensors suitable for detecting water and other liquid leaks in residential and commercial buildings. When the sensor detects a leak, an alarm message will be sent to the LoRaWAN® network. + +hardwareVersions: + - version: '11' + numeric: 11 + +firmwareVersions: + - version: '10' + numeric: 10 + hardwareVersions: + - '11' + + profiles: + EU863-870: + id: profile-eu868 + codec: r900a01-codec + AS923: + id: profile-as923 + codec: r900a01-codec + US902-928: + id: profile-us915 + codec: r900a01-codec + AU915-928: + id: profile-au915 + codec: r900a01-codec + KR920-923: + id: profile-kr920 + codec: r900a01-codec + IN865-867: + id: profile-in865 + codec: r900a01-codec + CN470-510: + id: profile-cn470 + codec: r900a01-codec + +sensors: + - water + +dimensions: + width: 35 + length: 57 + height: 15.2 + +weight: 48.9 + +battery: + replaceable: true + type: 2 x 3.0V CR2450 button batteries + +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=R900A01 +dataSheetURL: http://www.netvox.com.tw/um/R900A01/R900A01datasheet.pdf + +photos: + main: photos/r900a01o1.png diff --git a/vendor/netvox/r900a01o1-codec.yaml b/vendor/netvox/r900a01o1-codec.yaml new file mode 100755 index 0000000000..8d8f9c2624 --- /dev/null +++ b/vendor/netvox/r900a01o1-codec.yaml @@ -0,0 +1,270 @@ +uplinkDecoder: + fileName: payload/r900a01o1.js + examples: + - description: Startup version report + input: + fPort: 22 + bytes: [0x03, 0x01, 0x11, 0x00, 0x64, 0x0B, 0x20, 0x19, 0x11, 0x12] + output: + data: + Device: 'R900A01O1' + SWver: 10 + HWver: 11 + Datecode: '20191112' + + - description: Status report + input: + fPort: 22 + bytes: [0x03, 0x01, 0x11, 0x01, 0x78, 0x07, 0x08, 0x04, 0x4c, 0x00, 0x00] + output: + data: + Device: 'R900A01O1' + Volt: 12 + Temperature: '18℃' + Humidity: '11%' + LowTemperatureAlarm: 0 + HighTemperatureAlarm: 0 + LowHumidityAlarm: 0 + HighHumidityAlarm: 0 + ShockTamperAlarm: 'NoAlarm' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x81, 0x01, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportRsp' + Device: 'R900A01O1' + Status: 'Success' + + - description: Read configure report response + input: + fPort: 23 + bytes: [0x82, 0x01, 0x11, 0x03, 0x84, 0x07, 0x08, 0x01, 0x50, 0x06, 0x01] + output: + data: + Cmd: 'ReadConfigReportRsp' + Device: 'R900A01O1' + MinTime: 900 + MaxTime: 1800 + TemperatureChange: '3.36℃' + HumidityChange: '15.37%' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x83, 0x01, 0x11, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetShockSensorSensitivityRsp' + Device: 'R900A01O1' + Status: 'Failure' + + - description: Read configure report response + input: + fPort: 23 + bytes: [0x84, 0x01, 0x11, 0x08, 0x84, 0x07, 0x08, 0x01, 0x50, 0x06, 0x01, 0x02, 0x01] + output: + data: + Cmd: 'GetShockSensorSensitivityRsp' + Device: 'R900A01O1' + ShockSensorSensitivity: 8 + + - description: Configure report response + input: + fPort: 23 + bytes: [0x85, 0x01, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigDigitalOutPutRsp' + Device: 'R900A01O1' + Status: 'Success' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x86, 0x01, 0x11, 0x01, 0x08, 0x01, 0x00] + output: + data: + Cmd: 'ReadConfigDigitalOutPutRsp' + Device: 'R900A01O1' + DigitalOutPutType: 'NormallyHighLevel' + OutPulseTime: '8s' + LowTemperatureAlarm: 1 + HighTemperatureAlarm: 0 + LowHumidityAlarm: 0 + HighHumidityAlarm: 0 + Channel: 'Channel1' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x87, 0x01, 0x11, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'TriggerDigitalOutPutRsp' + Device: 'R900A01O1' + Status: 'Failure' + +downlinkDecoder: + fileName: payload/r900a01o1.js + examples: + - description: Configure report request + input: + fPort: 23 + bytes: [0x01, 0x01, 0x11, 0x03, 0x84, 0x07, 0x08, 0x01, 0x01, 0x00, 0x04, 0x02, 0x10] + output: + data: + Cmd: 'ConfigReportReq' + Device: 'R900A01O1' + MinTime: 900 + MaxTime: 1800 + TemperatureChange: '2.57℃' + HumidityChange: '0.04%' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x02, 0x01, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R900A01O1' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x03, 0x01, 0x11, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetShockSensorSensitivityReq' + Device: 'R900A01O1' + ShockSensorSensitivity: 6 + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x04, 0x01, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetShockSensorSensitivityReq' + Device: 'R900A01O1' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x05, 0x01, 0x11, 0x00, 0x10, 0x01, 0x01] + output: + data: + Cmd: 'ConfigDigitalOutPutReq' + Device: 'R900A01O1' + DigitalOutPutType: 'NormallyLowLevel' + OutPulseTime: '16s' + LowTemperatureAlarm: 1 + HighTemperatureAlarm: 0 + LowHumidityAlarm: 0 + HighHumidityAlarm: 0 + Channel: 'Channel2' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x06, 0x01, 0x11, 0x00] + output: + data: + Cmd: 'ReadConfigDigitalOutPutReq' + Device: 'R900A01O1' + Channel: 'Channel1' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x07, 0x01, 0x11, 0x06, 0x00] + output: + data: + Cmd: 'TriggerDigitalOutPutReq' + Device: 'R900A01O1' + OutPulseTime: 6 + Channel: 'Channel1' + +downlinkEncoder: + fileName: payload/r900a01o1.js + examples: + - description: Configure report request + input: + data: + Cmd: 'ConfigReportReq' + Device: 'R900A01O1' + MinTime: 900 + MaxTime: 1800 + TemperatureChange: 2.57 + HumidityChange: 0.06 + output: + fPort: 23 + bytes: [0x01, 0x01, 0x11, 0x03, 0x84, 0x07, 0x08, 0x01, 0x01, 0x00, 0x06] + + - description: Read configure report request + input: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R900A01O1' + output: + fPort: 23 + bytes: [0x02, 0x01, 0x11] + + - description: Read configure report request + input: + data: + Cmd: 'SetShockSensorSensitivityReq' + Device: 'R900A01O1' + ShockSensorSensitivity: 5 + output: + fPort: 23 + bytes: [0x03, 0x01, 0x11, 0x05] + + - description: Read configure report request + input: + data: + Cmd: 'GetShockSensorSensitivityReq' + Device: 'R900A01O1' + output: + fPort: 23 + bytes: [0x04, 0x01, 0x11] + + - description: Read configure report request + input: + data: + Cmd: 'ConfigDigitalOutPutReq' + Device: 'R900A01O1' + DigitalOutPutType: 'NormallyLowLevel' + OutPulseTime: 16 + LowTemperatureAlarm: 1 + HighTemperatureAlarm: 0 + LowHumidityAlarm: 0 + HighHumidityAlarm: 0 + Channel: 'Channel2' + output: + fPort: 23 + bytes: [0x05, 0x01, 0x11, 0x00, 0x10, 0x01, 0x01] + + - description: Read configure report request + input: + data: + Cmd: 'ReadConfigDigitalOutPutReq' + Device: 'R900A01O1' + Channel: 'Channel1' + output: + fPort: 23 + bytes: [0x06, 0x01, 0x11, 0x00] + + - description: Read configure report request + input: + data: + Cmd: 'TriggerDigitalOutPutReq' + Device: 'R900A01O1' + OutPulseTime: 6 + Channel: 'Channel1' + output: + fPort: 23 + bytes: [0x07, 0x01, 0x11, 0x06, 0x00] diff --git a/vendor/netvox/r900a01o1.yaml b/vendor/netvox/r900a01o1.yaml new file mode 100755 index 0000000000..8ef2b9d4bb --- /dev/null +++ b/vendor/netvox/r900a01o1.yaml @@ -0,0 +1,69 @@ +name: R900A01O1 - Wireless Water leak Sensor +description: The Netvox R900A01O1 Water Leak Detector comes with two water leak sensors suitable for detecting water and other liquid leaks in residential and commercial buildings. When the sensor detects a leak, an alarm message will be sent to the LoRaWAN® network. + +hardwareVersions: + - version: '11' + numeric: 11 + +firmwareVersions: + - version: '10' + numeric: 10 + hardwareVersions: + - '11' + + profiles: + EU863-870: + id: profile-eu868 + codec: r900a01o1-codec + AS923: + id: profile-as923 + codec: r900a01o1-codec + US902-928: + id: profile-us915 + codec: r900a01o1-codec + AU915-928: + id: profile-au915 + codec: r900a01o1-codec + KR920-923: + id: profile-kr920 + codec: r900a01o1-codec + IN865-867: + id: profile-in865 + codec: r900a01o1-codec + CN470-510: + id: profile-cn470 + codec: r900a01o1-codec + +sensors: + - water + +dimensions: + width: 35 + length: 57 + height: 15.2 + +weight: 48.9 + +battery: + replaceable: true + type: 2 x 3.0V CR2450 button batteries + +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=R900A01O1 +dataSheetURL: http://www.netvox.com.tw/um/R900A01O1/R900A01O1datasheet.pdf + +photos: + main: photos/r900a01o1.png diff --git a/vendor/netvox/r900a02-codec.yaml b/vendor/netvox/r900a02-codec.yaml new file mode 100755 index 0000000000..a4fa7cac93 --- /dev/null +++ b/vendor/netvox/r900a02-codec.yaml @@ -0,0 +1,154 @@ +uplinkDecoder: + fileName: payload/r900a02.js + examples: + - description: Startup version report + input: + fPort: 22 + bytes: [0x03, 0x01, 0x0a, 0x00, 0x64, 0x0B, 0x20, 0x19, 0x11, 0x12] + output: + data: + Device: 'R900A02' + SWver: 10 + HWver: 11 + Datecode: '20191112' + + - description: Status report + input: + fPort: 22 + bytes: [0x03, 0x01, 0x0a, 0x01, 0x78, 0x07, 0x08, 0x04, 0x00] + output: + data: + Device: 'R900A02' + Volt: 12 + Temperature: '18℃' + LowTemperatureAlarm: 0 + HighTemperatureAlarm: 0 + ShockTamperAlarm: 'NoAlarm' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x81, 0x01, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportRsp' + Device: 'R900A02' + Status: 'Success' + + - description: Read configure report response + input: + fPort: 23 + bytes: [0x82, 0x01, 0x0a, 0x03, 0x84, 0x07, 0x08, 0x01, 0x50] + output: + data: + Cmd: 'ReadConfigReportRsp' + Device: 'R900A02' + MinTime: 900 + MaxTime: 1800 + TemperatureChange: '3.36℃' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x83, 0x01, 0x0a, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetShockSensorSensitivityRsp' + Device: 'R900A02' + Status: 'Failure' + + - description: Read configure report response + input: + fPort: 23 + bytes: [0x84, 0x01, 0x0a, 0x09, 0x84, 0x07, 0x08, 0x01, 0x50, 0x06, 0x01, 0x02, 0x01] + output: + data: + Cmd: 'GetShockSensorSensitivityRsp' + Device: 'R900A02' + ShockSensorSensitivity: 9 + +downlinkDecoder: + fileName: payload/r900a02.js + examples: + - description: Configure report request + input: + fPort: 23 + bytes: [0x01, 0x01, 0x0a, 0x03, 0x84, 0x07, 0x08, 0x01, 0x01, 0x00, 0x04] + output: + data: + Cmd: 'ConfigReportReq' + Device: 'R900A02' + MinTime: 900 + MaxTime: 1800 + TemperatureChange: '2.57℃' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x02, 0x01, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R900A02' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x03, 0x01, 0x0a, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetShockSensorSensitivityReq' + Device: 'R900A02' + ShockSensorSensitivity: 3 + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x04, 0x01, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetShockSensorSensitivityReq' + Device: 'R900A02' + +downlinkEncoder: + fileName: payload/r900a02.js + examples: + - description: Configure report request + input: + data: + Cmd: 'ConfigReportReq' + Device: 'R900A02' + MinTime: 900 + MaxTime: 1800 + TemperatureChange: 2.57 + output: + fPort: 23 + bytes: [0x01, 0x01, 0x0a, 0x03, 0x84, 0x07, 0x08, 0x01, 0x01] + + - description: Read configure report request + input: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R900A02' + output: + fPort: 23 + bytes: [0x02, 0x01, 0x0a] + + - description: Read configure report request + input: + data: + Cmd: 'SetShockSensorSensitivityReq' + Device: 'R900A02' + ShockSensorSensitivity: 9 + output: + fPort: 23 + bytes: [0x03, 0x01, 0x0a, 0x09] + + - description: Read configure report request + input: + data: + Cmd: 'GetShockSensorSensitivityReq' + Device: 'R900A02' + output: + fPort: 23 + bytes: [0x04, 0x01, 0x0a] diff --git a/vendor/netvox/r900a02.yaml b/vendor/netvox/r900a02.yaml new file mode 100755 index 0000000000..2219ea81d5 --- /dev/null +++ b/vendor/netvox/r900a02.yaml @@ -0,0 +1,69 @@ +name: R900A02 - Wireless Water leak Sensor +description: The Netvox R900A02 Water Leak Detector comes with two water leak sensors suitable for detecting water and other liquid leaks in residential and commercial buildings. When the sensor detects a leak, an alarm message will be sent to the LoRaWAN® network. + +hardwareVersions: + - version: '11' + numeric: 11 + +firmwareVersions: + - version: '10' + numeric: 10 + hardwareVersions: + - '11' + + profiles: + EU863-870: + id: profile-eu868 + codec: r900a02-codec + AS923: + id: profile-as923 + codec: r900a02-codec + US902-928: + id: profile-us915 + codec: r900a02-codec + AU915-928: + id: profile-au915 + codec: r900a02-codec + KR920-923: + id: profile-kr920 + codec: r900a02-codec + IN865-867: + id: profile-in865 + codec: r900a02-codec + CN470-510: + id: profile-cn470 + codec: r900a02-codec + +sensors: + - water + +dimensions: + width: 35 + length: 57 + height: 15.2 + +weight: 48.9 + +battery: + replaceable: true + type: 2 x 3.0V CR2450 button batteries + +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=R900A02 +dataSheetURL: http://www.netvox.com.tw/um/R900A02/R900A02datasheet.pdf + +photos: + main: photos/r900a02.png diff --git a/vendor/netvox/r900a02o1-codec.yaml b/vendor/netvox/r900a02o1-codec.yaml new file mode 100755 index 0000000000..a857b2ee28 --- /dev/null +++ b/vendor/netvox/r900a02o1-codec.yaml @@ -0,0 +1,258 @@ +uplinkDecoder: + fileName: payload/r900a02o1.js + examples: + - description: Startup version report + input: + fPort: 22 + bytes: [0x03, 0x01, 0x12, 0x00, 0x64, 0x0B, 0x20, 0x19, 0x11, 0x12] + output: + data: + Device: 'R900A02O1' + SWver: 10 + HWver: 11 + Datecode: '20191112' + + - description: Status report + input: + fPort: 22 + bytes: [0x03, 0x01, 0x12, 0x01, 0x78, 0x07, 0x08, 0x04, 0x01] + output: + data: + Device: 'R900A02O1' + Volt: 12 + Temperature: '18℃' + LowTemperatureAlarm: 0 + HighTemperatureAlarm: 0 + ShockTamperAlarm: 'Alarm' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x81, 0x01, 0x12, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportRsp' + Device: 'R900A02O1' + Status: 'Failure' + + - description: Read configure report response + input: + fPort: 23 + bytes: [0x82, 0x01, 0x12, 0x03, 0x84, 0x07, 0x08, 0x01, 0x50] + output: + data: + Cmd: 'ReadConfigReportRsp' + Device: 'R900A02O1' + MinTime: 900 + MaxTime: 1800 + TemperatureChange: '3.36℃' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x83, 0x01, 0x12, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetShockSensorSensitivityRsp' + Device: 'R900A02O1' + Status: 'Failure' + + - description: Read configure report response + input: + fPort: 23 + bytes: [0x84, 0x01, 0x12, 0x03, 0x84, 0x07, 0x08, 0x01, 0x50, 0x06, 0x01, 0x02, 0x01] + output: + data: + Cmd: 'GetShockSensorSensitivityRsp' + Device: 'R900A02O1' + ShockSensorSensitivity: 3 + + - description: Read configure report response + input: + fPort: 23 + bytes: [0x85, 0x01, 0x12, 0x00, 0x84, 0x07, 0x08, 0x01, 0x50, 0x06, 0x01, 0x02, 0x01] + output: + data: + Cmd: 'ConfigDigitalOutPutRsp' + Device: 'R900A02O1' + Status: 'Success' + + - description: Read configure report response + input: + fPort: 23 + bytes: [0x86, 0x01, 0x12, 0x00, 0x84, 0x07, 0x01] + output: + data: + Cmd: 'ReadConfigDigitalOutPutRsp' + Device: 'R900A02O1' + DigitalOutPutType: 'NormallyLowLevel' + OutPulseTime: '132s' + LowTemperatureAlarm: 1 + HighTemperatureAlarm: 1 + Channel: 'Channel2' + + - description: Read configure report response + input: + fPort: 23 + bytes: [0x87, 0x01, 0x12, 0x00, 0x84, 0x07, 0x08, 0x01, 0x50, 0x06, 0x01, 0x02, 0x01] + output: + data: + Cmd: 'TriggerDigitalOutPutRsp' + Device: 'R900A02O1' + Status: 'Success' + +downlinkDecoder: + fileName: payload/r900a02o1.js + examples: + - description: Configure report request + input: + fPort: 23 + bytes: [0x01, 0x01, 0x12, 0x03, 0x84, 0x07, 0x08, 0x01, 0x01, 0x00, 0x04] + output: + data: + Cmd: 'ConfigReportReq' + Device: 'R900A02O1' + MinTime: 900 + MaxTime: 1800 + TemperatureChange: '2.57℃' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x02, 0x01, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R900A02O1' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x03, 0x01, 0x12, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetShockSensorSensitivityReq' + Device: 'R900A02O1' + ShockSensorSensitivity: 3 + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x04, 0x01, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetShockSensorSensitivityReq' + Device: 'R900A02O1' + + - description: Read configure report response + input: + fPort: 23 + bytes: [0x05, 0x01, 0x12, 0x03, 0x84, 0x07, 0x01] + output: + data: + Cmd: 'ConfigDigitalOutPutReq' + Device: 'R900A02O1' + DigitalOutPutType: 3 + OutPulseTime: '132s' + LowTemperatureAlarm: 1 + HighTemperatureAlarm: 1 + Channel: 'Channel2' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x06, 0x01, 0x12, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigDigitalOutPutReq' + Device: 'R900A02O1' + Channel: 'Channel2' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x07, 0x01, 0x12, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'TriggerDigitalOutPutReq' + Device: 'R900A02O1' + OutPulseTime: 7 + Channel: 'Channel1' + +downlinkEncoder: + fileName: payload/r900a02o1.js + examples: + - description: Configure report request + input: + data: + Cmd: 'ConfigReportReq' + Device: 'R900A02O1' + MinTime: 900 + MaxTime: 1800 + TemperatureChange: 2.57 + output: + fPort: 23 + bytes: [0x01, 0x01, 0x12, 0x03, 0x84, 0x07, 0x08, 0x01, 0x01] + + - description: Read configure report request + input: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R900A02O1' + output: + fPort: 23 + bytes: [0x02, 0x01, 0x12] + + - description: Read configure report request + input: + data: + Cmd: 'SetShockSensorSensitivityReq' + Device: 'R900A02O1' + ShockSensorSensitivity: 9 + output: + fPort: 23 + bytes: [0x03, 0x01, 0x12, 0x09] + + - description: Read configure report request + input: + data: + Cmd: 'GetShockSensorSensitivityReq' + Device: 'R900A02O1' + output: + fPort: 23 + bytes: [0x04, 0x01, 0x12] + + - description: Read configure report request + input: + data: + Cmd: 'ConfigDigitalOutPutReq' + Device: 'R900A02O1' + DigitalOutPutType: 3 + OutPulseTime: 132 + LowTemperatureAlarm: 1 + HighTemperatureAlarm: 1 + Channel: 'Channel2' + output: + fPort: 23 + bytes: [0x05, 0x01, 0x12, 0x03, 0x84, 0x03, 0x01] + + - description: Read configure report request + input: + data: + Cmd: 'ReadConfigDigitalOutPutReq' + Device: 'R900A02O1' + Channel: 'Channel2' + output: + fPort: 23 + bytes: [0x06, 0x01, 0x12, 0x01] + + - description: Read configure report request + input: + data: + Cmd: 'TriggerDigitalOutPutReq' + Device: 'R900A02O1' + OutPulseTime: 9 + Channel: 'Channel1' + output: + fPort: 23 + bytes: [0x07, 0x01, 0x12, 0x09, 0x00] diff --git a/vendor/netvox/r900a02o1.yaml b/vendor/netvox/r900a02o1.yaml new file mode 100755 index 0000000000..384772eb8e --- /dev/null +++ b/vendor/netvox/r900a02o1.yaml @@ -0,0 +1,69 @@ +name: R900A02O1 - Wireless Water leak Sensor +description: The Netvox R900A02O1 Water Leak Detector comes with two water leak sensors suitable for detecting water and other liquid leaks in residential and commercial buildings. When the sensor detects a leak, an alarm message will be sent to the LoRaWAN® network. + +hardwareVersions: + - version: '11' + numeric: 11 + +firmwareVersions: + - version: '10' + numeric: 10 + hardwareVersions: + - '11' + + profiles: + EU863-870: + id: profile-eu868 + codec: r900a02o1-codec + AS923: + id: profile-as923 + codec: r900a02o1-codec + US902-928: + id: profile-us915 + codec: r900a02o1-codec + AU915-928: + id: profile-au915 + codec: r900a02o1-codec + KR920-923: + id: profile-kr920 + codec: r900a02o1-codec + IN865-867: + id: profile-in865 + codec: r900a02o1-codec + CN470-510: + id: profile-cn470 + codec: r900a02o1-codec + +sensors: + - water + +dimensions: + width: 35 + length: 57 + height: 15.2 + +weight: 48.9 + +battery: + replaceable: true + type: 2 x 3.0V CR2450 button batteries + +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=R900A02O1 +dataSheetURL: http://www.netvox.com.tw/um/R900A02O1/R900A02O1datasheet.pdf + +photos: + main: photos/r900a02o1.png diff --git a/vendor/netvox/r900a03-codec.yaml b/vendor/netvox/r900a03-codec.yaml new file mode 100755 index 0000000000..2aaabe6754 --- /dev/null +++ b/vendor/netvox/r900a03-codec.yaml @@ -0,0 +1,149 @@ +uplinkDecoder: + fileName: payload/r900a03.js + examples: + - description: Startup version report + input: + fPort: 22 + bytes: [0x03, 0x01, 0x0b, 0x00, 0x64, 0x0B, 0x20, 0x19, 0x11, 0x12] + output: + data: + Device: 'R900A03' + SWver: 10 + HWver: 11 + Datecode: '20191112' + + - description: Status report + input: + fPort: 22 + bytes: [0x03, 0x01, 0x0b, 0x01, 0x78, 0x00, 0x01] + output: + data: + Device: 'R900A03' + Volt: 12 + WaterLeak: 'noLeak' + ShockTamperAlarm: 'Alarm' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x81, 0x01, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportRsp' + Device: 'R900A03' + Status: 'Success' + + - description: Read configure report response + input: + fPort: 23 + bytes: [0x82, 0x01, 0x0b, 0x03, 0x88, 0x07, 0x08, 0x01, 0x50] + output: + data: + Cmd: 'ReadConfigReportRsp' + Device: 'R900A03' + MinTime: 904 + MaxTime: 1800 + + - description: Configure report response + input: + fPort: 23 + bytes: [0x83, 0x01, 0x0b, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetShockSensorSensitivityRsp' + Device: 'R900A03' + Status: 'Failure' + + - description: Read configure report response + input: + fPort: 23 + bytes: [0x84, 0x01, 0x0b, 0x02, 0x84, 0x07, 0x08, 0x01, 0x50, 0x06, 0x01, 0x02, 0x01] + output: + data: + Cmd: 'GetShockSensorSensitivityRsp' + Device: 'R900A03' + ShockSensorSensitivity: 2 + +downlinkDecoder: + fileName: payload/r900a03.js + examples: + - description: Configure report request + input: + fPort: 23 + bytes: [0x01, 0x01, 0x0b, 0x03, 0x84, 0x07, 0x12, 0x01, 0x01, 0x00, 0x04] + output: + data: + Cmd: 'ConfigReportReq' + Device: 'R900A03' + MinTime: 900 + MaxTime: 1810 + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x02, 0x01, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R900A03' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x03, 0x01, 0x0b, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetShockSensorSensitivityReq' + Device: 'R900A03' + ShockSensorSensitivity: 9 + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x04, 0x01, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetShockSensorSensitivityReq' + Device: 'R900A03' + +downlinkEncoder: + fileName: payload/r900a03.js + examples: + - description: Configure report request + input: + data: + Cmd: 'ConfigReportReq' + Device: 'R900A03' + MinTime: 900 + MaxTime: 776 + output: + fPort: 23 + bytes: [0x01, 0x01, 0x0b, 0x03, 0x84, 0x03, 0x08] + + - description: Read configure report request + input: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R900A03' + output: + fPort: 23 + bytes: [0x02, 0x01, 0x0b] + + - description: Read configure report request + input: + data: + Cmd: 'SetShockSensorSensitivityReq' + Device: 'R900A03' + ShockSensorSensitivity: 15 + output: + fPort: 23 + bytes: [0x03, 0x01, 0x0b, 0x0f] + + - description: Read configure report request + input: + data: + Cmd: 'GetShockSensorSensitivityReq' + Device: 'R900A03' + output: + fPort: 23 + bytes: [0x04, 0x01, 0x0b] diff --git a/vendor/netvox/r900a03.yaml b/vendor/netvox/r900a03.yaml new file mode 100755 index 0000000000..613279214d --- /dev/null +++ b/vendor/netvox/r900a03.yaml @@ -0,0 +1,69 @@ +name: R900A03 - Wireless Water leak Sensor +description: The Netvox R900A03 Water Leak Detector comes with two water leak sensors suitable for detecting water and other liquid leaks in residential and commercial buildings. When the sensor detects a leak, an alarm message will be sent to the LoRaWAN® network. + +hardwareVersions: + - version: '11' + numeric: 11 + +firmwareVersions: + - version: '10' + numeric: 10 + hardwareVersions: + - '11' + + profiles: + EU863-870: + id: profile-eu868 + codec: r900a03-codec + AS923: + id: profile-as923 + codec: r900a03-codec + US902-928: + id: profile-us915 + codec: r900a03-codec + AU915-928: + id: profile-au915 + codec: r900a03-codec + KR920-923: + id: profile-kr920 + codec: r900a03-codec + IN865-867: + id: profile-in865 + codec: r900a03-codec + CN470-510: + id: profile-cn470 + codec: r900a03-codec + +sensors: + - water + +dimensions: + width: 35 + length: 57 + height: 15.2 + +weight: 48.9 + +battery: + replaceable: true + type: 2 x 3.0V CR2450 button batteries + +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=R900A03 +dataSheetURL: http://www.netvox.com.tw/um/R900A03/R900A03datasheet.pdf + +photos: + main: photos/r900a03.png diff --git a/vendor/netvox/r900a03o1-codec.yaml b/vendor/netvox/r900a03o1-codec.yaml new file mode 100755 index 0000000000..a694764068 --- /dev/null +++ b/vendor/netvox/r900a03o1-codec.yaml @@ -0,0 +1,250 @@ +uplinkDecoder: + fileName: payload/r900a03o1.js + examples: + - description: Startup version report + input: + fPort: 22 + bytes: [0x03, 0x01, 0x13, 0x00, 0x64, 0x0B, 0x20, 0x19, 0x11, 0x12] + output: + data: + Device: 'R900A03O1' + SWver: 10 + HWver: 11 + Datecode: '20191112' + + - description: Status report + input: + fPort: 22 + bytes: [0x03, 0x01, 0x13, 0x01, 0x78, 0x00, 0x01] + output: + data: + Device: 'R900A03O1' + Volt: 12 + WaterLeak: 'noLeak' + ShockTamperAlarm: 'Alarm' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x81, 0x01, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportRsp' + Device: 'R900A03O1' + Status: 'Success' + + - description: Read configure report response + input: + fPort: 23 + bytes: [0x82, 0x01, 0x13, 0x03, 0x88, 0x07, 0x08, 0x01, 0x50] + output: + data: + Cmd: 'ReadConfigReportRsp' + Device: 'R900A03O1' + MinTime: 904 + MaxTime: 1800 + + - description: Configure report response + input: + fPort: 23 + bytes: [0x83, 0x01, 0x13, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetShockSensorSensitivityRsp' + Device: 'R900A03O1' + Status: 'Failure' + + - description: Read configure report response + input: + fPort: 23 + bytes: [0x84, 0x01, 0x13, 0x02, 0x84, 0x07, 0x08, 0x01, 0x50, 0x06, 0x01, 0x02, 0x01] + output: + data: + Cmd: 'GetShockSensorSensitivityRsp' + Device: 'R900A03O1' + ShockSensorSensitivity: 2 + + - description: Read configure report response + input: + fPort: 23 + bytes: [0x85, 0x01, 0x13, 0x01, 0x02, 0x01, 0x00, 0x01, 0x50, 0x06, 0x01, 0x02, 0x01] + output: + data: + Cmd: 'ConfigDigitalOutPutRsp' + Device: 'R900A03O1' + Status: 'Failure' + + - description: Read configure report response + input: + fPort: 23 + bytes: [0x86, 0x01, 0x13, 0x00, 0x08, 0x01, 0x00, 0x01, 0x50, 0x06, 0x01, 0x02, 0x01] + output: + data: + Cmd: 'ReadConfigDigitalOutPutRsp' + Device: 'R900A03O1' + DigitalOutPutType: 'NormallyLowLevel' + OutPulseTime: 8 + WaterLeak: 1 + Channel: 'Channel1' + + - description: Read configure report response + input: + fPort: 23 + bytes: [0x87, 0x01, 0x13, 0x00, 0x01, 0x07, 0x08, 0x01, 0x50, 0x06, 0x01, 0x02, 0x01] + output: + data: + Cmd: 'TriggerDigitalOutPutRsp' + Device: 'R900A03O1' + Status: 'Success' + +downlinkDecoder: + fileName: payload/r900a03o1.js + examples: + - description: Configure report request + input: + fPort: 23 + bytes: [0x01, 0x01, 0x13, 0x03, 0x84, 0x07, 0x12, 0x01, 0x01, 0x00, 0x04] + output: + data: + Cmd: 'ConfigReportReq' + Device: 'R900A03O1' + MinTime: 900 + MaxTime: 1810 + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x02, 0x01, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R900A03O1' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x03, 0x01, 0x13, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetShockSensorSensitivityReq' + Device: 'R900A03O1' + ShockSensorSensitivity: 9 + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x04, 0x01, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetShockSensorSensitivityReq' + Device: 'R900A03O1' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x05, 0x01, 0x13, 0x00, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigDigitalOutPutReq' + Device: 'R900A03O1' + DigitalOutPutType: 'NormallyLowLevel' + OutPulseTime: 8 + WaterLeak: 1 + Channel: 'Channel1' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x06, 0x01, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigDigitalOutPutReq' + Device: 'R900A03O1' + Channel: 'Channel1' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x07, 0x01, 0x13, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'TriggerDigitalOutPutReq' + Device: 'R900A03O1' + OutPulseTime: 8 + Channel: 'Channel1' + +downlinkEncoder: + fileName: payload/r900a03o1.js + examples: + - description: Configure report request + input: + data: + Cmd: 'ConfigReportReq' + Device: 'R900A03O1' + MinTime: 900 + MaxTime: 776 + output: + fPort: 23 + bytes: [0x01, 0x01, 0x13, 0x03, 0x84, 0x03, 0x08] + + - description: Read configure report request + input: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R900A03O1' + output: + fPort: 23 + bytes: [0x02, 0x01, 0x13] + + - description: Read configure report request + input: + data: + Cmd: 'SetShockSensorSensitivityReq' + Device: 'R900A03O1' + ShockSensorSensitivity: 15 + output: + fPort: 23 + bytes: [0x03, 0x01, 0x13, 0x0f] + + - description: Read configure report request + input: + data: + Cmd: 'GetShockSensorSensitivityReq' + Device: 'R900A03O1' + output: + fPort: 23 + bytes: [0x04, 0x01, 0x13] + + - description: Read configure report request + input: + data: + Cmd: 'ConfigDigitalOutPutReq' + Device: 'R900A03O1' + DigitalOutPutType: 'NormallyLowLevel' + OutPulseTime: 8 + WaterLeak: 1 + Channel: 'Channel1' + output: + fPort: 23 + bytes: [0x05, 0x01, 0x13, 0x00, 0x08, 0x01, 0x00] + + - description: Read configure report request + input: + data: + Cmd: 'ReadConfigDigitalOutPutReq' + Device: 'R900A03O1' + Channel: 'Channel1' + output: + fPort: 23 + bytes: [0x06, 0x01, 0x13, 0x00] + + - description: Read configure report request + input: + data: + Cmd: 'TriggerDigitalOutPutReq' + Device: 'R900A03O1' + OutPulseTime: 8 + Channel: 'Channel1' + output: + fPort: 23 + bytes: [0x07, 0x01, 0x13, 0x08, 0x00] diff --git a/vendor/netvox/r900a03o1.yaml b/vendor/netvox/r900a03o1.yaml new file mode 100755 index 0000000000..7bf253e608 --- /dev/null +++ b/vendor/netvox/r900a03o1.yaml @@ -0,0 +1,69 @@ +name: R900A03O1 - Wireless Water leak Sensor +description: The Netvox R900A03O1 Water Leak Detector comes with two water leak sensors suitable for detecting water and other liquid leaks in residential and commercial buildings. When the sensor detects a leak, an alarm message will be sent to the LoRaWAN® network. + +hardwareVersions: + - version: '11' + numeric: 11 + +firmwareVersions: + - version: '10' + numeric: 10 + hardwareVersions: + - '11' + + profiles: + EU863-870: + id: profile-eu868 + codec: r900a03o1-codec + AS923: + id: profile-as923 + codec: r900a03o1-codec + US902-928: + id: profile-us915 + codec: r900a03o1-codec + AU915-928: + id: profile-au915 + codec: r900a03o1-codec + KR920-923: + id: profile-kr920 + codec: r900a03o1-codec + IN865-867: + id: profile-in865 + codec: r900a03o1-codec + CN470-510: + id: profile-cn470 + codec: r900a03o1-codec + +sensors: + - water + +dimensions: + width: 35 + length: 57 + height: 15.2 + +weight: 48.9 + +battery: + replaceable: true + type: 2 x 3.0V CR2450 button batteries + +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=R900A03O1 +dataSheetURL: http://www.netvox.com.tw/um/R900A03O1/R900A03O1datasheet.pdf + +photos: + main: photos/r900a03o1.png diff --git a/vendor/netvox/r900nac1-codec.yaml b/vendor/netvox/r900nac1-codec.yaml new file mode 100755 index 0000000000..7444d54a22 --- /dev/null +++ b/vendor/netvox/r900nac1-codec.yaml @@ -0,0 +1,154 @@ +uplinkDecoder: + fileName: payload/r900nac1.js + examples: + - description: Startup version report + input: + fPort: 22 + bytes: [0x03, 0x01, 0x00, 0x00, 0x64, 0x0B, 0x20, 0x19, 0x11, 0x12] + output: + data: + Device: 'R900NAC1' + SWver: 10 + HWver: 11 + Datecode: '20191112' + + - description: Status report + input: + fPort: 22 + bytes: [0x03, 0x01, 0x00, 0x01, 0x01, 0x00, 0x03, 0x03, 0x00, 0x01, 0x01, 0x01, 0x01] + output: + data: + Device: 'R900NAC1' + Volt: 0.1 + Current1: '771mA' + LowCurrent1Alarm: 0 + HighCurrent1Alarm: 0 + ShockTamperAlarm: 'Alarm' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x81, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportRsp' + Device: 'R900NAC1' + Status: 'Success' + + - description: Read configure report response + input: + fPort: 23 + bytes: [0x82, 0x01, 0x00, 0x03, 0x84, 0x07, 0x08, 0x01, 0x50, 0x06, 0x01, 0x02, 0x01] + output: + data: + Cmd: 'ReadConfigReportRsp' + Device: 'R900NAC1' + MinTime: 900 + MaxTime: 1800 + CurrentChange: '336mA' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x83, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetShockSensorSensitivityRsp' + Device: 'R900NAC1' + Status: 'Failure' + + - description: Read configure report response + input: + fPort: 23 + bytes: [0x84, 0x01, 0x00, 0x08, 0x84, 0x07, 0x08, 0x01, 0x50, 0x06, 0x01, 0x02, 0x01] + output: + data: + Cmd: 'GetShockSensorSensitivityRsp' + Device: 'R900NAC1' + ShockSensorSensitivity: 8 + +downlinkDecoder: + fileName: payload/r900nac1.js + examples: + - description: Configure report request + input: + fPort: 23 + bytes: [0x01, 0x01, 0x00, 0x03, 0x84, 0x07, 0x08, 0x01, 0x01, 0x00, 0x04, 0x02, 0x10] + output: + data: + Cmd: 'ConfigReportReq' + Device: 'R900NAC1' + MinTime: 900 + MaxTime: 1800 + CurrentChange: '257mA' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R900NAC1' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x03, 0x01, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetShockSensorSensitivityReq' + Device: 'R900NAC1' + ShockSensorSensitivity: 6 + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x04, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetShockSensorSensitivityReq' + Device: 'R900NAC1' + +downlinkEncoder: + fileName: payload/r900nac1.js + examples: + - description: Configure report request + input: + data: + Cmd: 'ConfigReportReq' + Device: 'R900NAC1' + MinTime: 900 + MaxTime: 1800 + CurrentChange: 257 + output: + fPort: 23 + bytes: [0x01, 0x01, 0x00, 0x03, 0x84, 0x07, 0x08, 0x01, 0x01] + + - description: Read configure report request + input: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R900NAC1' + output: + fPort: 23 + bytes: [0x02, 0x01, 0x00] + + - description: Read configure report request + input: + data: + Cmd: 'SetShockSensorSensitivityReq' + Device: 'R900NAC1' + ShockSensorSensitivity: 5 + output: + fPort: 23 + bytes: [0x03, 0x01, 0x00, 0x05] + + - description: Read configure report request + input: + data: + Cmd: 'GetShockSensorSensitivityReq' + Device: 'R900NAC1' + output: + fPort: 23 + bytes: [0x04, 0x01, 0x00] diff --git a/vendor/netvox/r900nac1.yaml b/vendor/netvox/r900nac1.yaml new file mode 100755 index 0000000000..b7a8e61841 --- /dev/null +++ b/vendor/netvox/r900nac1.yaml @@ -0,0 +1,69 @@ +name: R900NAC1 - Wireless Water leak Sensor +description: The Netvox R900NAC1 Water Leak Detector comes with two water leak sensors suitable for detecting water and other liquid leaks in residential and commercial buildings. When the sensor detects a leak, an alarm message will be sent to the LoRaWAN® network. + +hardwareVersions: + - version: '11' + numeric: 11 + +firmwareVersions: + - version: '10' + numeric: 10 + hardwareVersions: + - '11' + + profiles: + EU863-870: + id: profile-eu868 + codec: r900nac1-codec + AS923: + id: profile-as923 + codec: r900nac1-codec + US902-928: + id: profile-us915 + codec: r900nac1-codec + AU915-928: + id: profile-au915 + codec: r900nac1-codec + KR920-923: + id: profile-kr920 + codec: r900nac1-codec + IN865-867: + id: profile-in865 + codec: r900nac1-codec + CN470-510: + id: profile-cn470 + codec: r900nac1-codec + +sensors: + - water + +dimensions: + width: 35 + length: 57 + height: 15.2 + +weight: 48.9 + +battery: + replaceable: true + type: 2 x 3.0V CR2450 button batteries + +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=R900NAC1 +dataSheetURL: http://www.netvox.com.tw/um/R900NAC1/R900NAC1datasheet.pdf + +photos: + main: photos/r211.jpg diff --git a/vendor/netvox/r900nac3-codec.yaml b/vendor/netvox/r900nac3-codec.yaml new file mode 100755 index 0000000000..71c437b761 --- /dev/null +++ b/vendor/netvox/r900nac3-codec.yaml @@ -0,0 +1,160 @@ +uplinkDecoder: + fileName: payload/r900nac3.js + examples: + - description: Startup version report + input: + fPort: 22 + bytes: [0x03, 0x01, 0x01, 0x00, 0x64, 0x0B, 0x20, 0x19, 0x11, 0x12] + output: + data: + Device: 'R900NAC3' + SWver: 10 + HWver: 11 + Datecode: '20191112' + + - description: Status report + input: + fPort: 22 + bytes: [0x03, 0x01, 0x01, 0x01, 0x6e, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x0b, 0x01, 0x01] + output: + data: + Device: 'R900NAC3' + Volt: 11 + Current1: '11mA' + Current2: '11mA' + Current3: '11mA' + LowCurrent1Alarm: 1 + HighCurrent1Alarm: 0 + LowCurrent2Alarm: 0 + HighCurrent2Alarm: 0 + LowCurrent3Alarm: 0 + HighCurrent3Alarm: 0 + ShockTamperAlarm: 'Alarm' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x81, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportRsp' + Device: 'R900NAC3' + Status: 'Success' + + - description: Read configure report response + input: + fPort: 23 + bytes: [0x82, 0x01, 0x01, 0x03, 0x84, 0x07, 0x08, 0x01, 0x50, 0x06, 0x01, 0x02, 0x01] + output: + data: + Cmd: 'ReadConfigReportRsp' + Device: 'R900NAC3' + MinTime: 900 + MaxTime: 1800 + CurrentChange: '336mA' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x83, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetShockSensorSensitivityRsp' + Device: 'R900NAC3' + Status: 'Failure' + + - description: Read configure report response + input: + fPort: 23 + bytes: [0x84, 0x01, 0x01, 0x08, 0x84, 0x07, 0x08, 0x01, 0x50, 0x06, 0x01, 0x02, 0x01] + output: + data: + Cmd: 'GetShockSensorSensitivityRsp' + Device: 'R900NAC3' + ShockSensorSensitivity: 8 + +downlinkDecoder: + fileName: payload/r900nac3.js + examples: + - description: Configure report request + input: + fPort: 23 + bytes: [0x01, 0x01, 0x01, 0x03, 0x84, 0x07, 0x08, 0x01, 0x01, 0x00, 0x04, 0x02, 0x10] + output: + data: + Cmd: 'ConfigReportReq' + Device: 'R900NAC3' + MinTime: 900 + MaxTime: 1800 + CurrentChange: '257mA' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R900NAC3' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x03, 0x01, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetShockSensorSensitivityReq' + Device: 'R900NAC3' + ShockSensorSensitivity: 6 + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x04, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetShockSensorSensitivityReq' + Device: 'R900NAC3' + +downlinkEncoder: + fileName: payload/r900nac3.js + examples: + - description: Configure report request + input: + data: + Cmd: 'ConfigReportReq' + Device: 'R900NAC3' + MinTime: 900 + MaxTime: 1800 + CurrentChange: 257 + output: + fPort: 23 + bytes: [0x01, 0x01, 0x01, 0x03, 0x84, 0x07, 0x08, 0x01, 0x01] + + - description: Read configure report request + input: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R900NAC3' + output: + fPort: 23 + bytes: [0x02, 0x01, 0x01] + + - description: Read configure report request + input: + data: + Cmd: 'SetShockSensorSensitivityReq' + Device: 'R900NAC3' + ShockSensorSensitivity: 5 + output: + fPort: 23 + bytes: [0x03, 0x01, 0x01, 0x05] + + - description: Read configure report request + input: + data: + Cmd: 'GetShockSensorSensitivityReq' + Device: 'R900NAC3' + output: + fPort: 23 + bytes: [0x04, 0x01, 0x01] diff --git a/vendor/netvox/r900nac3.yaml b/vendor/netvox/r900nac3.yaml new file mode 100755 index 0000000000..0460476e88 --- /dev/null +++ b/vendor/netvox/r900nac3.yaml @@ -0,0 +1,69 @@ +name: R900NAC3 - Wireless Water leak Sensor +description: The Netvox R900NAC3 Water Leak Detector comes with two water leak sensors suitable for detecting water and other liquid leaks in residential and commercial buildings. When the sensor detects a leak, an alarm message will be sent to the LoRaWAN® network. + +hardwareVersions: + - version: '11' + numeric: 11 + +firmwareVersions: + - version: '10' + numeric: 10 + hardwareVersions: + - '11' + + profiles: + EU863-870: + id: profile-eu868 + codec: r900nac3-codec + AS923: + id: profile-as923 + codec: r900nac3-codec + US902-928: + id: profile-us915 + codec: r900nac3-codec + AU915-928: + id: profile-au915 + codec: r900nac3-codec + KR920-923: + id: profile-kr920 + codec: r900nac3-codec + IN865-867: + id: profile-in865 + codec: r900nac3-codec + CN470-510: + id: profile-cn470 + codec: r900nac3-codec + +sensors: + - water + +dimensions: + width: 35 + length: 57 + height: 15.2 + +weight: 48.9 + +battery: + replaceable: true + type: 2 x 3.0V CR2450 button batteries + +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=R900NAC3 +dataSheetURL: http://www.netvox.com.tw/um/R900NAC3/R900NAC3datasheet.pdf + +photos: + main: photos/r211.jpg diff --git a/vendor/netvox/r900nac6-codec.yaml b/vendor/netvox/r900nac6-codec.yaml new file mode 100755 index 0000000000..266b745e30 --- /dev/null +++ b/vendor/netvox/r900nac6-codec.yaml @@ -0,0 +1,169 @@ +uplinkDecoder: + fileName: payload/r900nac6.js + examples: + - description: Startup version report + input: + fPort: 22 + bytes: [0x03, 0x01, 0x02, 0x00, 0x64, 0x0B, 0x20, 0x19, 0x11, 0x12] + output: + data: + Device: 'R900NAC6' + SWver: 10 + HWver: 11 + Datecode: '20191112' + + - description: Status report + input: + fPort: 22 + bytes: [0x03, 0x01, 0x02, 0x01, 0x6e, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x00, 0x00, 0x17, 0x00, 0x00, 0x16, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x0b, 0x00, 0x01, 0x01] + output: + data: + Device: 'R900NAC6' + Volt: 11 + Current1: '12mA' + Current2: '1mA' + Current3: '23mA' + Current4: '22mA' + Current5: '11mA' + Current6: '11mA' + LowCurrent1Alarm: 1 + HighCurrent1Alarm: 0 + LowCurrent2Alarm: 0 + HighCurrent2Alarm: 0 + LowCurrent3Alarm: 0 + HighCurrent3Alarm: 0 + LowCurrent4Alarm: 0 + HighCurrent4Alarm: 0 + LowCurrent5Alarm: 0 + HighCurrent5Alarm: 0 + LowCurrent6Alarm: 0 + HighCurrent6Alarm: 0 + ShockTamperAlarm: 'Alarm' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x81, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportRsp' + Device: 'R900NAC6' + Status: 'Success' + + - description: Read configure report response + input: + fPort: 23 + bytes: [0x82, 0x01, 0x02, 0x03, 0x84, 0x07, 0x08, 0x01, 0x50, 0x06, 0x01, 0x02, 0x01] + output: + data: + Cmd: 'ReadConfigReportRsp' + Device: 'R900NAC6' + MinTime: 900 + MaxTime: 1800 + CurrentChange: '336mA' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x83, 0x01, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetShockSensorSensitivityRsp' + Device: 'R900NAC6' + Status: 'Failure' + + - description: Read configure report response + input: + fPort: 23 + bytes: [0x84, 0x01, 0x02, 0x08, 0x84, 0x07, 0x08, 0x01, 0x50, 0x06, 0x01, 0x02, 0x01] + output: + data: + Cmd: 'GetShockSensorSensitivityRsp' + Device: 'R900NAC6' + ShockSensorSensitivity: 8 + +downlinkDecoder: + fileName: payload/r900nac6.js + examples: + - description: Configure report request + input: + fPort: 23 + bytes: [0x01, 0x01, 0x02, 0x03, 0x84, 0x07, 0x08, 0x01, 0x01, 0x00, 0x04, 0x02, 0x10] + output: + data: + Cmd: 'ConfigReportReq' + Device: 'R900NAC6' + MinTime: 900 + MaxTime: 1800 + CurrentChange: '257mA' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x02, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R900NAC6' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x03, 0x01, 0x02, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetShockSensorSensitivityReq' + Device: 'R900NAC6' + ShockSensorSensitivity: 6 + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x04, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetShockSensorSensitivityReq' + Device: 'R900NAC6' + +downlinkEncoder: + fileName: payload/r900nac6.js + examples: + - description: Configure report request + input: + data: + Cmd: 'ConfigReportReq' + Device: 'R900NAC6' + MinTime: 900 + MaxTime: 1800 + CurrentChange: 257 + output: + fPort: 23 + bytes: [0x01, 0x01, 0x02, 0x03, 0x84, 0x07, 0x08, 0x01, 0x01] + + - description: Read configure report request + input: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R900NAC6' + output: + fPort: 23 + bytes: [0x02, 0x01, 0x02] + + - description: Read configure report request + input: + data: + Cmd: 'SetShockSensorSensitivityReq' + Device: 'R900NAC6' + ShockSensorSensitivity: 5 + output: + fPort: 23 + bytes: [0x03, 0x01, 0x02, 0x05] + + - description: Read configure report request + input: + data: + Cmd: 'GetShockSensorSensitivityReq' + Device: 'R900NAC6' + output: + fPort: 23 + bytes: [0x04, 0x01, 0x02] diff --git a/vendor/netvox/r900nac6.yaml b/vendor/netvox/r900nac6.yaml new file mode 100755 index 0000000000..ccb76a7a50 --- /dev/null +++ b/vendor/netvox/r900nac6.yaml @@ -0,0 +1,69 @@ +name: R900NAC6 - Wireless Water leak Sensor +description: The Netvox R900NAC6 Water Leak Detector comes with two water leak sensors suitable for detecting water and other liquid leaks in residential and commercial buildings. When the sensor detects a leak, an alarm message will be sent to the LoRaWAN® network. + +hardwareVersions: + - version: '11' + numeric: 11 + +firmwareVersions: + - version: '10' + numeric: 10 + hardwareVersions: + - '11' + + profiles: + EU863-870: + id: profile-eu868 + codec: r900nac6-codec + AS923: + id: profile-as923 + codec: r900nac6-codec + US902-928: + id: profile-us915 + codec: r900nac6-codec + AU915-928: + id: profile-au915 + codec: r900nac6-codec + KR920-923: + id: profile-kr920 + codec: r900nac6-codec + IN865-867: + id: profile-in865 + codec: r900nac6-codec + CN470-510: + id: profile-cn470 + codec: r900nac6-codec + +sensors: + - water + +dimensions: + width: 35 + length: 57 + height: 15.2 + +weight: 48.9 + +battery: + replaceable: true + type: 2 x 3.0V CR2450 button batteries + +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=R900NAC6 +dataSheetURL: http://www.netvox.com.tw/um/R900NAC6/R900NAC6datasheet.pdf + +photos: + main: photos/r211.jpg diff --git a/vendor/netvox/r900ndc-codec.yaml b/vendor/netvox/r900ndc-codec.yaml new file mode 100755 index 0000000000..96dffd0146 --- /dev/null +++ b/vendor/netvox/r900ndc-codec.yaml @@ -0,0 +1,157 @@ +uplinkDecoder: + fileName: payload/r900ndc.js + examples: + - description: Startup version report + input: + fPort: 22 + bytes: [0x03, 0x01, 0x03, 0x00, 0x64, 0x0B, 0x20, 0x19, 0x11, 0x12] + output: + data: + Device: 'R900NDC' + SWver: 10 + HWver: 11 + Datecode: '20191112' + + - description: Status report + input: + fPort: 22 + bytes: [0x03, 0x01, 0x03, 0x01, 0x78, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x0e, 0x02, 0x00] + output: + data: + Device: 'R900NDC' + Volt: 12 + Current1: '29mA' + Current2: '14mA' + LowCurrent1Alarm: 0 + HighCurrent1Alarm: 1 + LowCurrent2Alarm: 0 + HighCurrent2Alarm: 0 + ShockTamperAlarm: 'NoAlarm' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x81, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportRsp' + Device: 'R900NDC' + Status: 'Success' + + - description: Read configure report response + input: + fPort: 23 + bytes: [0x82, 0x01, 0x03, 0x03, 0x84, 0x07, 0x08, 0x01, 0x50, 0x06, 0x01, 0x02, 0x01] + output: + data: + Cmd: 'ReadConfigReportRsp' + Device: 'R900NDC' + MinTime: 900 + MaxTime: 1800 + CurrentChange: '336mA' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x83, 0x01, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetShockSensorSensitivityRsp' + Device: 'R900NDC' + Status: 'Failure' + + - description: Read configure report response + input: + fPort: 23 + bytes: [0x84, 0x01, 0x03, 0x08, 0x84, 0x07, 0x08, 0x01, 0x50, 0x06, 0x01, 0x02, 0x01] + output: + data: + Cmd: 'GetShockSensorSensitivityRsp' + Device: 'R900NDC' + ShockSensorSensitivity: 8 + +downlinkDecoder: + fileName: payload/r900ndc.js + examples: + - description: Configure report request + input: + fPort: 23 + bytes: [0x01, 0x01, 0x03, 0x03, 0x84, 0x07, 0x08, 0x01, 0x01, 0x00, 0x04, 0x02, 0x10] + output: + data: + Cmd: 'ConfigReportReq' + Device: 'R900NDC' + MinTime: 900 + MaxTime: 1800 + CurrentChange: '257mA' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x02, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R900NDC' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x03, 0x01, 0x03, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetShockSensorSensitivityReq' + Device: 'R900NDC' + ShockSensorSensitivity: 6 + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x04, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetShockSensorSensitivityReq' + Device: 'R900NDC' + +downlinkEncoder: + fileName: payload/r900ndc.js + examples: + - description: Configure report request + input: + data: + Cmd: 'ConfigReportReq' + Device: 'R900NDC' + MinTime: 900 + MaxTime: 1800 + CurrentChange: 257 + output: + fPort: 23 + bytes: [0x01, 0x01, 0x03, 0x03, 0x84, 0x07, 0x08, 0x01, 0x01] + + - description: Read configure report request + input: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R900NDC' + output: + fPort: 23 + bytes: [0x02, 0x01, 0x03] + + - description: Read configure report request + input: + data: + Cmd: 'SetShockSensorSensitivityReq' + Device: 'R900NDC' + ShockSensorSensitivity: 5 + output: + fPort: 23 + bytes: [0x03, 0x01, 0x03, 0x05] + + - description: Read configure report request + input: + data: + Cmd: 'GetShockSensorSensitivityReq' + Device: 'R900NDC' + output: + fPort: 23 + bytes: [0x04, 0x01, 0x03] diff --git a/vendor/netvox/r900ndc.yaml b/vendor/netvox/r900ndc.yaml new file mode 100755 index 0000000000..a400fa863b --- /dev/null +++ b/vendor/netvox/r900ndc.yaml @@ -0,0 +1,69 @@ +name: R900NDC - Wireless Water leak Sensor +description: The Netvox R900NDC Water Leak Detector comes with two water leak sensors suitable for detecting water and other liquid leaks in residential and commercial buildings. When the sensor detects a leak, an alarm message will be sent to the LoRaWAN® network. + +hardwareVersions: + - version: '11' + numeric: 11 + +firmwareVersions: + - version: '10' + numeric: 10 + hardwareVersions: + - '11' + + profiles: + EU863-870: + id: profile-eu868 + codec: r900ndc-codec + AS923: + id: profile-as923 + codec: r900ndc-codec + US902-928: + id: profile-us915 + codec: r900ndc-codec + AU915-928: + id: profile-au915 + codec: r900ndc-codec + KR920-923: + id: profile-kr920 + codec: r900ndc-codec + IN865-867: + id: profile-in865 + codec: r900ndc-codec + CN470-510: + id: profile-cn470 + codec: r900ndc-codec + +sensors: + - water + +dimensions: + width: 35 + length: 57 + height: 15.2 + +weight: 48.9 + +battery: + replaceable: true + type: 2 x 3.0V CR2450 button batteries + +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=R900NDC +dataSheetURL: http://www.netvox.com.tw/um/R900NDC/R900NDCdatasheet.pdf + +photos: + main: photos/r211.jpg diff --git a/vendor/netvox/r900pb02-codec.yaml b/vendor/netvox/r900pb02-codec.yaml new file mode 100755 index 0000000000..a49de846c6 --- /dev/null +++ b/vendor/netvox/r900pb02-codec.yaml @@ -0,0 +1,224 @@ +uplinkDecoder: + fileName: payload/r900pb02.js + examples: + - description: Startup version report + input: + fPort: 22 + bytes: [0x03, 0x01, 0x07, 0x00, 0x64, 0x0B, 0x20, 0x19, 0x11, 0x12] + output: + data: + Device: 'R900PB02' + SWver: 10 + HWver: 11 + Datecode: '20191112' + + - description: Status report + input: + fPort: 22 + bytes: [0x03, 0x01, 0x07, 0x01, 0x01, 0x00, 0x03, 0x03, 0x00, 0x01, 0x01, 0x01, 0x01] + output: + data: + Device: 'R900PB02' + Volt: 0.1 + Soil_VWC: '0.03%' + Soil_Temperature: '7.68℃' + Soil_EC: '0.257ds/m' + LowSoil_VWCAlarm: 1 + HighSoil_VWCAlarm: 0 + LowSoil_TemperatureAlarm: 0 + HighSoil_TemperatureAlarm: 0 + LowSoil_ECAlarm: 0 + HighSoil_ECAlarm: 0 + ShockTamperAlarm: 'Alarm' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x81, 0x01, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportRsp' + Device: 'R900PB02' + Status: 'Success' + + - description: Read configure report response + input: + fPort: 23 + bytes: [0x82, 0x01, 0x07, 0x03, 0x84, 0x07, 0x08, 0x01, 0x50, 0x06, 0x01, 0x02, 0x01] + output: + data: + Cmd: 'ReadConfigReportRsp' + Device: 'R900PB02' + MinTime: 900 + MaxTime: 1800 + Soil_VWCChange: '3.36%' + Soil_TemperatureChange: '15.37℃' + Soil_ECChange: '0.513ds/m' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x83, 0x01, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetShockSensorSensitivityRsp' + Device: 'R900PB02' + Status: 'Failure' + + - description: Read configure report response + input: + fPort: 23 + bytes: [0x84, 0x01, 0x07, 0x03, 0x84, 0x07, 0x08, 0x01, 0x50, 0x06, 0x01, 0x02, 0x01] + output: + data: + Cmd: 'GetShockSensorSensitivityRsp' + Device: 'R900PB02' + ShockSensorSensitivity: 3 + + - description: Configure report response + input: + fPort: 23 + bytes: [0x85, 0x01, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetSoilTypeRsp' + Device: 'R900PB02' + Status: 'Failure' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x86, 0x01, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetSoilTypeRsp' + Device: 'R900PB02' + SoilType: 'SandySoil' + +downlinkDecoder: + fileName: payload/r900pb02.js + examples: + - description: Configure report request + input: + fPort: 23 + bytes: [0x01, 0x01, 0x07, 0x03, 0x84, 0x07, 0x08, 0x01, 0x01, 0x00, 0x04, 0x02, 0x10] + output: + data: + Cmd: 'ConfigReportReq' + Device: 'R900PB02' + MinTime: 900 + MaxTime: 1800 + Soil_VWCChange: '2.57%' + Soil_TemperatureChange: '0.04℃' + Soil_ECChange: '0.528ds/m' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x02, 0x01, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R900PB02' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x03, 0x01, 0x07, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetShockSensorSensitivityReq' + Device: 'R900PB02' + ShockSensorSensitivity: 9 + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x04, 0x01, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetShockSensorSensitivityReq' + Device: 'R900PB02' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x05, 0x01, 0x07, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetSoilTypeReq' + Device: 'R900PB02' + SoilType: 'Clay' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x06, 0x01, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetSoilTypeReq' + Device: 'R900PB02' + +downlinkEncoder: + fileName: payload/r900pb02.js + examples: + - description: Configure report request + input: + data: + Cmd: 'ConfigReportReq' + Device: 'R900PB02' + MinTime: 900 + MaxTime: 1800 + Soil_VWCChange: 2.57 + Soil_TemperatureChange: 0.04 + Soil_ECChange: 0.528 + output: + fPort: 23 + bytes: [0x01, 0x01, 0x07, 0x03, 0x84, 0x07, 0x08, 0x01, 0x01, 0x00, 0x04, 0x02, 0x10] + + - description: Read configure report request + input: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R900PB02' + output: + fPort: 23 + bytes: [0x02, 0x01, 0x07] + + - description: Read configure report request + input: + data: + Cmd: 'SetShockSensorSensitivityReq' + Device: 'R900PB02' + ShockSensorSensitivity: 5 + output: + fPort: 23 + bytes: [0x03, 0x01, 0x07, 0x05] + + - description: Read configure report request + input: + data: + Cmd: 'GetShockSensorSensitivityReq' + Device: 'R900PB02' + output: + fPort: 23 + bytes: [0x04, 0x01, 0x07] + + - description: Read configure report request + input: + data: + Cmd: 'SetSoilTypeReq' + Device: 'R900PB02' + SoilType: 'Organic soil' + output: + fPort: 23 + bytes: [0x05, 0x01, 0x07, 0x03] + + - description: Read configure report request + input: + data: + Cmd: 'GetSoilTypeReq' + Device: 'R900PB02' + output: + fPort: 23 + bytes: [0x06, 0x01, 0x07] diff --git a/vendor/netvox/r900pb02.yaml b/vendor/netvox/r900pb02.yaml new file mode 100755 index 0000000000..b3646550de --- /dev/null +++ b/vendor/netvox/r900pb02.yaml @@ -0,0 +1,69 @@ +name: R900PB02 - Wireless Water leak Sensor +description: The Netvox R900PB02 Water Leak Detector comes with two water leak sensors suitable for detecting water and other liquid leaks in residential and commercial buildings. When the sensor detects a leak, an alarm message will be sent to the LoRaWAN® network. + +hardwareVersions: + - version: '11' + numeric: 11 + +firmwareVersions: + - version: '10' + numeric: 10 + hardwareVersions: + - '11' + + profiles: + EU863-870: + id: profile-eu868 + codec: r900pb02-codec + AS923: + id: profile-as923 + codec: r900pb02-codec + US902-928: + id: profile-us915 + codec: r900pb02-codec + AU915-928: + id: profile-au915 + codec: r900pb02-codec + KR920-923: + id: profile-kr920 + codec: r900pb02-codec + IN865-867: + id: profile-in865 + codec: r900pb02-codec + CN470-510: + id: profile-cn470 + codec: r900pb02-codec + +sensors: + - water + +dimensions: + width: 35 + length: 57 + height: 15.2 + +weight: 48.9 + +battery: + replaceable: true + type: 2 x 3.0V CR2450 button batteries + +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=R900PB02 +dataSheetURL: http://www.netvox.com.tw/um/R900PB02/R900PB02datasheet.pdf + +photos: + main: photos/r900pb02.png diff --git a/vendor/netvox/r900pb02o1-codec.yaml b/vendor/netvox/r900pb02o1-codec.yaml new file mode 100755 index 0000000000..bb90d98d8b --- /dev/null +++ b/vendor/netvox/r900pb02o1-codec.yaml @@ -0,0 +1,340 @@ +uplinkDecoder: + fileName: payload/r900pb02.js + examples: + - description: Startup version report + input: + fPort: 22 + bytes: [0x03, 0x01, 0x0f, 0x00, 0x64, 0x0B, 0x20, 0x19, 0x11, 0x12] + output: + data: + Device: 'R900PB02O1' + SWver: 10 + HWver: 11 + Datecode: '20191112' + + - description: Status report + input: + fPort: 22 + bytes: [0x03, 0x01, 0x0f, 0x01, 0x01, 0x00, 0x03, 0x03, 0x00, 0x01, 0x01, 0x01, 0x01] + output: + data: + Device: 'R900PB02O1' + Volt: 0.1 + Soil_VWC: '0.03%' + Soil_Temperature: '7.68℃' + Soil_EC: '0.257ds/m' + LowSoil_VWCAlarm: 1 + HighSoil_VWCAlarm: 0 + LowSoil_TemperatureAlarm: 0 + HighSoil_TemperatureAlarm: 0 + LowSoil_ECAlarm: 0 + HighSoil_ECAlarm: 0 + ShockTamperAlarm: 'Alarm' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x81, 0x01, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportRsp' + Device: 'R900PB02O1' + Status: 'Success' + + - description: Read configure report response + input: + fPort: 23 + bytes: [0x82, 0x01, 0x0f, 0x03, 0x84, 0x07, 0x08, 0x01, 0x50, 0x06, 0x01, 0x02, 0x01] + output: + data: + Cmd: 'ReadConfigReportRsp' + Device: 'R900PB02O1' + MinTime: 900 + MaxTime: 1800 + Soil_VWCChange: '3.36%' + Soil_TemperatureChange: '15.37℃' + Soil_ECChange: '0.513ds/m' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x83, 0x01, 0x0f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetShockSensorSensitivityRsp' + Device: 'R900PB02O1' + Status: 'Failure' + + - description: Read configure report response + input: + fPort: 23 + bytes: [0x84, 0x01, 0x0f, 0x03, 0x84, 0x07, 0x08, 0x01, 0x50, 0x06, 0x01, 0x02, 0x01] + output: + data: + Cmd: 'GetShockSensorSensitivityRsp' + Device: 'R900PB02O1' + ShockSensorSensitivity: 3 + + - description: Configure report response + input: + fPort: 23 + bytes: [0x85, 0x01, 0x0f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetSoilTypeRsp' + Device: 'R900PB02O1' + Status: 'Failure' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x86, 0x01, 0x0f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetSoilTypeRsp' + Device: 'R900PB02O1' + SoilType: 'SandySoil' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x87, 0x01, 0x0f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigDryContactPointOutRsp' + Device: 'R900PB02O1' + Status: 'Failure' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x88, 0x01, 0x0f, 0x00, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigDryContactPointOutRsp' + Device: 'R900PB02O1' + DryContactPointOutType: 'NormallyLowLevel' + OutPluseTime: '8s' + LowSoil_VWCAlarm: 1 + HighSoil_VWCAlarm: 0 + LowSoil_TemperatureAlarm: 0 + HighSoil_TemperatureAlarm: 0 + LowSoil_ECAlarm: 0 + HighSoil_ECAlarm: 0 + Channel: 'Channel1' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x89, 0x01, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'TriggerDryContactPointOutRsp' + Device: 'R900PB02O1' + Status: 'Success' + +downlinkDecoder: + fileName: payload/r900pb02.js + examples: + - description: Configure report request + input: + fPort: 23 + bytes: [0x01, 0x01, 0x0f, 0x03, 0x84, 0x07, 0x08, 0x01, 0x01, 0x00, 0x04, 0x02, 0x10] + output: + data: + Cmd: 'ConfigReportReq' + Device: 'R900PB02O1' + MinTime: 900 + MaxTime: 1800 + Soil_VWCChange: '2.57%' + Soil_TemperatureChange: '0.04℃' + Soil_ECChange: '0.528ds/m' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x02, 0x01, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R900PB02O1' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x03, 0x01, 0x0f, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetShockSensorSensitivityReq' + Device: 'R900PB02O1' + ShockSensorSensitivity: 9 + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x04, 0x01, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetShockSensorSensitivityReq' + Device: 'R900PB02O1' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x05, 0x01, 0x0f, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetSoilTypeReq' + Device: 'R900PB02O1' + SoilType: 'Clay' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x06, 0x01, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetSoilTypeReq' + Device: 'R900PB02O1' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x07, 0x01, 0x0f, 0x00, 0x08, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigDryContactPointOutReq' + Device: 'R900PB02O1' + DryContactPointOutType: 'NormallyLowLevel' + OutPluseTime: '8s' + LowSoil_VWCAlarm: 0 + HighSoil_VWCAlarm: 1 + LowSoil_TemperatureAlarm: 0 + HighSoil_TemperatureAlarm: 0 + LowSoil_ECAlarm: 0 + HighSoil_ECAlarm: 0 + Channel: 'Channel1' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x08, 0x01, 0x0f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigDryContactPointOutReq' + Device: 'R900PB02O1' + Channel: 'Channel2' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x09, 0x01, 0x0f, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'TriggerDryContactPointOutReq' + Device: 'R900PB02O1' + OutPluseTime: 9 + Channel: 'Channel1' + +downlinkEncoder: + fileName: payload/r900pb02.js + examples: + - description: Configure report request + input: + data: + Cmd: 'ConfigReportReq' + Device: 'R900PB02O1' + MinTime: 900 + MaxTime: 1800 + Soil_VWCChange: 2.57 + Soil_TemperatureChange: 0.04 + Soil_ECChange: 0.528 + output: + fPort: 23 + bytes: [0x01, 0x01, 0x0f, 0x03, 0x84, 0x07, 0x08, 0x01, 0x01, 0x00, 0x04, 0x02, 0x10] + + - description: Read configure report request + input: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R900PB02O1' + output: + fPort: 23 + bytes: [0x02, 0x01, 0x0f] + + - description: Read configure report request + input: + data: + Cmd: 'SetShockSensorSensitivityReq' + Device: 'R900PB02O1' + ShockSensorSensitivity: 5 + output: + fPort: 23 + bytes: [0x03, 0x01, 0x0f, 0x05] + + - description: Read configure report request + input: + data: + Cmd: 'GetShockSensorSensitivityReq' + Device: 'R900PB02O1' + output: + fPort: 23 + bytes: [0x04, 0x01, 0x0f] + + - description: Read configure report request + input: + data: + Cmd: 'SetSoilTypeReq' + Device: 'R900PB02O1' + SoilType: 'Organic soil' + output: + fPort: 23 + bytes: [0x05, 0x01, 0x0f, 0x03] + + - description: Read configure report request + input: + data: + Cmd: 'GetSoilTypeReq' + Device: 'R900PB02O1' + output: + fPort: 23 + bytes: [0x06, 0x01, 0x0f] + + - description: Read configure report request + input: + data: + Cmd: 'ConfigDryContactPointOutReq' + Device: 'R900PB02O1' + DryContactPointOutType: 'NormallyLowLevel' + OutPluseTime: 8 + LowSoil_VWCAlarm: 1 + HighSoil_VWCAlarm: 1 + LowSoil_TemperatureAlarm: 0 + HighSoil_TemperatureAlarm: 0 + LowSoil_ECAlarm: 0 + HighSoil_ECAlarm: 0 + Channel: 'Channel1' + output: + fPort: 23 + bytes: [0x07, 0x01, 0x0f, 0x00, 0x08, 0x03, 0x00] + + - description: Read configure report request + input: + data: + Cmd: 'ReadConfigDryContactPointOutReq' + Device: 'R900PB02O1' + Channel: 'Channel1' + output: + fPort: 23 + bytes: [0x08, 0x01, 0x0f, 0x00] + + - description: Read configure report request + input: + data: + Cmd: 'TriggerDryContactPointOutReq' + Device: 'R900PB02O1' + OutPluseTime: 7 + Channel: 'Channel2' + output: + fPort: 23 + bytes: [0x09, 0x01, 0x0f, 0x07, 0x01] diff --git a/vendor/netvox/r900pb02o1.yaml b/vendor/netvox/r900pb02o1.yaml new file mode 100755 index 0000000000..50c6c998f6 --- /dev/null +++ b/vendor/netvox/r900pb02o1.yaml @@ -0,0 +1,69 @@ +name: R900PB02O1 - Wireless Water leak Sensor +description: The Netvox R900PB02O1 Water Leak Detector comes with two water leak sensors suitable for detecting water and other liquid leaks in residential and commercial buildings. When the sensor detects a leak, an alarm message will be sent to the LoRaWAN® network. + +hardwareVersions: + - version: '11' + numeric: 11 + +firmwareVersions: + - version: '10' + numeric: 10 + hardwareVersions: + - '11' + + profiles: + EU863-870: + id: profile-eu868 + codec: r900pb02o1-codec + AS923: + id: profile-as923 + codec: r900pb02o1-codec + US902-928: + id: profile-us915 + codec: r900pb02o1-codec + AU915-928: + id: profile-au915 + codec: r900pb02o1-codec + KR920-923: + id: profile-kr920 + codec: r900pb02o1-codec + IN865-867: + id: profile-in865 + codec: r900pb02o1-codec + CN470-510: + id: profile-cn470 + codec: r900pb02o1-codec + +sensors: + - water + +dimensions: + width: 35 + length: 57 + height: 15.2 + +weight: 48.9 + +battery: + replaceable: true + type: 2 x 3.0V CR2450 button batteries + +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=R900PB02O1 +dataSheetURL: http://www.netvox.com.tw/um/R900PB02O1/R900PB02O1datasheet.pdf + +photos: + main: photos/r900pb02o1.png diff --git a/vendor/netvox/r900pb03-codec.yaml b/vendor/netvox/r900pb03-codec.yaml new file mode 100755 index 0000000000..628f83fdbc --- /dev/null +++ b/vendor/netvox/r900pb03-codec.yaml @@ -0,0 +1,332 @@ +uplinkDecoder: + fileName: payload/r900pb03.js + examples: + - description: Startup version report + input: + fPort: 22 + bytes: [0x03, 0x01, 0x08, 0x00, 0x64, 0x0B, 0x20, 0x19, 0x11, 0x12] + output: + data: + Device: 'R900PB03' + SWver: 10 + HWver: 11 + Datecode: '20191112' + + - description: Status report + input: + fPort: 22 + bytes: [0x03, 0x01, 0x08, 0x01, 0x01, 0x00, 0x03, 0x03, 0x00, 0x01, 0x01] + output: + data: + Device: 'R900PB03' + Volt: 0.1 + Status: 'Off' + Distance: '771mm' + FillLevel: '0%' + LowDistanceAlarm: 1 + HighDistanceAlarm: 0 + LowFillLevelAlarm: 0 + HighFillLevelAlarm: 0 + ShockTamperAlarm: 'Alarm' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x81, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportRsp' + Device: 'R900PB03' + Status: 'Success' + + - description: Read configure report response + input: + fPort: 23 + bytes: [0x82, 0x01, 0x08, 0x03, 0x84, 0x07, 0x08, 0x01, 0x50] + output: + data: + Cmd: 'ReadConfigReportRsp' + Device: 'R900PB03' + MinTime: 900 + MaxTime: 1800 + DistanceChange: '336mm' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x83, 0x01, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetShockSensorSensitivityRsp' + Device: 'R900PB03' + Status: 'Failure' + + - description: Read configure report response + input: + fPort: 23 + bytes: [0x84, 0x01, 0x08, 0x03, 0x84, 0x07, 0x08, 0x01, 0x50, 0x06, 0x01, 0x02, 0x01] + output: + data: + Cmd: 'GetShockSensorSensitivityRsp' + Device: 'R900PB03' + ShockSensorSensitivity: 3 + + - description: Configure report response + input: + fPort: 23 + bytes: [0x85, 0x01, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetOnDistanceThresholdRrsp' + Device: 'R900PB03' + Status: 'Failure' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x86, 0x01, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetOnDistanceThresholdRrsp' + Device: 'R900PB03' + OnDistanceThreshold: '256mm' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x87, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetFillMaxDistanceRsp' + Device: 'R900PB03' + Status: 'Success' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x88, 0x01, 0x08, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetFillMaxDistanceRsp' + Device: 'R900PB03' + FillMaxDistance: '272mm' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x89, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetDeadZoneDistanceRsp' + Device: 'R900PB03' + Status: 'Success' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x8a, 0x01, 0x08, 0x01, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetDeadZoneDistanceRsp' + Device: 'R900PB03' + DeadZoneDistance: '265mm' + +downlinkDecoder: + fileName: payload/r900pb03.js + examples: + - description: Configure report request + input: + fPort: 23 + bytes: [0x01, 0x01, 0x08, 0x03, 0x84, 0x07, 0x08, 0x01, 0x01] + output: + data: + Cmd: 'ConfigReportReq' + Device: 'R900PB03' + MinTime: 900 + MaxTime: 1800 + DistanceChange: '257mm' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x02, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R900PB03' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x03, 0x01, 0x08, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetShockSensorSensitivityReq' + Device: 'R900PB03' + ShockSensorSensitivity: 9 + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x04, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetShockSensorSensitivityReq' + Device: 'R900PB03' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x05, 0x01, 0x08, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetOnDistanceThresholdRreq' + Device: 'R900PB03' + OnDistanceThreshold: '512mm' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x06, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetOnDistanceThresholdRreq' + Device: 'R900PB03' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x07, 0x01, 0x08, 0x01, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetFillMaxDistanceReq' + Device: 'R900PB03' + FillMaxDistance: '288mm' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x08, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetFillMaxDistanceReq' + Device: 'R900PB03' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x09, 0x01, 0x08, 0x00, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetDeadZoneDistanceReq' + Device: 'R900PB03' + DeadZoneDistance: '37mm' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x0a, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetDeadZoneDistanceReq' + Device: 'R900PB03' + +downlinkEncoder: + fileName: payload/r900pb03.js + examples: + - description: Configure report request + input: + data: + Cmd: 'ConfigReportReq' + Device: 'R900PB03' + MinTime: 900 + MaxTime: 1800 + DistanceChange: '18' + output: + fPort: 23 + bytes: [0x01, 0x01, 0x08, 0x03, 0x84, 0x07, 0x08, 0x00, 0x12] + + - description: Read configure report request + input: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R900PB03' + output: + fPort: 23 + bytes: [0x02, 0x01, 0x08] + + - description: Read configure report request + input: + data: + Cmd: 'SetShockSensorSensitivityReq' + Device: 'R900PB03' + ShockSensorSensitivity: 5 + output: + fPort: 23 + bytes: [0x03, 0x01, 0x08, 0x05] + + - description: Read configure report request + input: + data: + Cmd: 'GetShockSensorSensitivityReq' + Device: 'R900PB03' + output: + fPort: 23 + bytes: [0x04, 0x01, 0x08] + + - description: Read configure report request + input: + data: + Cmd: 'SetOnDistanceThresholdRreq' + Device: 'R900PB03' + OnDistanceThreshold: 801 + output: + fPort: 23 + bytes: [0x05, 0x01, 0x08, 0x03, 0x21] + + - description: Read configure report request + input: + data: + Cmd: 'GetOnDistanceThresholdRreq' + Device: 'R900PB03' + output: + fPort: 23 + bytes: [0x06, 0x01, 0x08] + + - description: Read configure report request + input: + data: + Cmd: 'SetFillMaxDistanceReq' + Device: 'R900PB03' + FillMaxDistance: 518 + output: + fPort: 23 + bytes: [0x07, 0x01, 0x08, 0x02, 0x06] + + - description: Read configure report request + input: + data: + Cmd: 'GetFillMaxDistanceReq' + Device: 'R900PB03' + output: + fPort: 23 + bytes: [0x08, 0x01, 0x08] + + - description: Read configure report request + input: + data: + Cmd: 'SetDeadZoneDistanceReq' + Device: 'R900PB03' + DeadZoneDistance: 5137 + output: + fPort: 23 + bytes: [0x09, 0x01, 0x08, 0x14, 0x11] + + - description: Read configure report request + input: + data: + Cmd: 'GetDeadZoneDistanceReq' + Device: 'R900PB03' + output: + fPort: 23 + bytes: [0x0a, 0x01, 0x08] diff --git a/vendor/netvox/r900pb03.yaml b/vendor/netvox/r900pb03.yaml new file mode 100755 index 0000000000..77082ec40d --- /dev/null +++ b/vendor/netvox/r900pb03.yaml @@ -0,0 +1,69 @@ +name: R900PB03 - Wireless Water leak Sensor +description: The Netvox R900PB03 Water Leak Detector comes with two water leak sensors suitable for detecting water and other liquid leaks in residential and commercial buildings. When the sensor detects a leak, an alarm message will be sent to the LoRaWAN® network. + +hardwareVersions: + - version: '11' + numeric: 11 + +firmwareVersions: + - version: '10' + numeric: 10 + hardwareVersions: + - '11' + + profiles: + EU863-870: + id: profile-eu868 + codec: r900pb03-codec + AS923: + id: profile-as923 + codec: r900pb03-codec + US902-928: + id: profile-us915 + codec: r900pb03-codec + AU915-928: + id: profile-au915 + codec: r900pb03-codec + KR920-923: + id: profile-kr920 + codec: r900pb03-codec + IN865-867: + id: profile-in865 + codec: r900pb03-codec + CN470-510: + id: profile-cn470 + codec: r900pb03-codec + +sensors: + - water + +dimensions: + width: 35 + length: 57 + height: 15.2 + +weight: 48.9 + +battery: + replaceable: true + type: 2 x 3.0V CR2450 button batteries + +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=R900PB03 +dataSheetURL: http://www.netvox.com.tw/um/R900PB03/R900PB03datasheet.pdf + +photos: + main: photos/r900pb03.png diff --git a/vendor/netvox/r900pb03o1-codec.yaml b/vendor/netvox/r900pb03o1-codec.yaml new file mode 100755 index 0000000000..236dd05f36 --- /dev/null +++ b/vendor/netvox/r900pb03o1-codec.yaml @@ -0,0 +1,442 @@ +uplinkDecoder: + fileName: payload/r900pb03.js + examples: + - description: Startup version report + input: + fPort: 22 + bytes: [0x03, 0x01, 0x10, 0x00, 0x64, 0x0B, 0x20, 0x19, 0x11, 0x12] + output: + data: + Device: 'R900PB03O1' + SWver: 10 + HWver: 11 + Datecode: '20191112' + + - description: Status report + input: + fPort: 22 + bytes: [0x03, 0x01, 0x10, 0x01, 0x01, 0x00, 0x03, 0x03, 0x00, 0x01, 0x01] + output: + data: + Device: 'R900PB03O1' + Volt: 0.1 + Status: 'Off' + Distance: '771mm' + FillLevel: '0%' + LowDistanceAlarm: 1 + HighDistanceAlarm: 0 + LowFillLevelAlarm: 0 + HighFillLevelAlarm: 0 + ShockTamperAlarm: 'Alarm' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x81, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportRsp' + Device: 'R900PB03O1' + Status: 'Success' + + - description: Read configure report response + input: + fPort: 23 + bytes: [0x82, 0x01, 0x10, 0x03, 0x84, 0x07, 0x08, 0x01, 0x50] + output: + data: + Cmd: 'ReadConfigReportRsp' + Device: 'R900PB03O1' + MinTime: 900 + MaxTime: 1800 + DistanceChange: '336mm' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x83, 0x01, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetShockSensorSensitivityRsp' + Device: 'R900PB03O1' + Status: 'Failure' + + - description: Read configure report response + input: + fPort: 23 + bytes: [0x84, 0x01, 0x10, 0x03, 0x84, 0x07, 0x08, 0x01, 0x50, 0x06, 0x01, 0x02, 0x01] + output: + data: + Cmd: 'GetShockSensorSensitivityRsp' + Device: 'R900PB03O1' + ShockSensorSensitivity: 3 + + - description: Configure report response + input: + fPort: 23 + bytes: [0x85, 0x01, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetOnDistanceThresholdRrsp' + Device: 'R900PB03O1' + Status: 'Failure' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x86, 0x01, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetOnDistanceThresholdRrsp' + Device: 'R900PB03O1' + OnDistanceThreshold: '256mm' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x87, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetFillMaxDistanceRsp' + Device: 'R900PB03O1' + Status: 'Success' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x88, 0x01, 0x10, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetFillMaxDistanceRsp' + Device: 'R900PB03O1' + FillMaxDistance: '272mm' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x89, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetDeadZoneDistanceRsp' + Device: 'R900PB03O1' + Status: 'Success' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x8a, 0x01, 0x10, 0x01, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetDeadZoneDistanceRsp' + Device: 'R900PB03O1' + DeadZoneDistance: '265mm' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x8b, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigDryContactPointOutRsp' + Device: 'R900PB03O1' + Status: 'Success' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x8c, 0x01, 0x10, 0x00, 0x0a, 0x01, 0x01] + output: + data: + Cmd: 'ReadConfigDryContactPointOutRsp' + Device: 'R900PB03O1' + DryContactPointOutType: 'NormallyLowLevel' + OutPluseTime: '10s' + LowDistanceAlarm: 1 + HighDistanceAlarm: 0 + LowFillLevelAlarm: 0 + HighFillLevelAlarm: 0 + Channel: 'Channel2' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x8d, 0x01, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'TriggerDryContactPointOutRsp' + Device: 'R900PB03O1' + Status: 'Failure' + +downlinkDecoder: + fileName: payload/r900pb03.js + examples: + - description: Configure report request + input: + fPort: 23 + bytes: [0x01, 0x01, 0x10, 0x03, 0x84, 0x07, 0x08, 0x01, 0x01] + output: + data: + Cmd: 'ConfigReportReq' + Device: 'R900PB03O1' + MinTime: 900 + MaxTime: 1800 + DistanceChange: '257mm' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x02, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R900PB03O1' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x03, 0x01, 0x10, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetShockSensorSensitivityReq' + Device: 'R900PB03O1' + ShockSensorSensitivity: 9 + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x04, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetShockSensorSensitivityReq' + Device: 'R900PB03O1' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x05, 0x01, 0x10, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetOnDistanceThresholdRreq' + Device: 'R900PB03O1' + OnDistanceThreshold: '512mm' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x06, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetOnDistanceThresholdRreq' + Device: 'R900PB03O1' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x07, 0x01, 0x10, 0x01, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetFillMaxDistanceReq' + Device: 'R900PB03O1' + FillMaxDistance: '288mm' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x08, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetFillMaxDistanceReq' + Device: 'R900PB03O1' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x09, 0x01, 0x10, 0x00, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetDeadZoneDistanceReq' + Device: 'R900PB03O1' + DeadZoneDistance: '37mm' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x0a, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetDeadZoneDistanceReq' + Device: 'R900PB03O1' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x0b, 0x01, 0x10, 0x01, 0x05, 0x02, 0x00] + output: + data: + Cmd: 'ConfigDryContactPointOutReq' + Device: 'R900PB03O1' + DryContactPointOutType: 'NormallyHighLevel' + OutPluseTime: '5s' + LowDistanceAlarm: 0 + HighDistanceAlarm: 1 + LowFillLevelAlarm: 0 + HighFillLevelAlarm: 0 + Channel: 'Channel1' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x0c, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigDryContactPointOutReq' + Device: 'R900PB03O1' + Channel: 'Channel1' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x0d, 0x01, 0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'TriggerDryContactPointOutReq' + Device: 'R900PB03O1' + OutPluseTime: 8 + Channel: 'Channel1' + +downlinkEncoder: + fileName: payload/r900pb03.js + examples: + - description: Configure report request + input: + data: + Cmd: 'ConfigReportReq' + Device: 'R900PB03O1' + MinTime: 900 + MaxTime: 1800 + DistanceChange: '18' + output: + fPort: 23 + bytes: [0x01, 0x01, 0x10, 0x03, 0x84, 0x07, 0x08, 0x00, 0x12] + + - description: Read configure report request + input: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R900PB03O1' + output: + fPort: 23 + bytes: [0x02, 0x01, 0x10] + + - description: Read configure report request + input: + data: + Cmd: 'SetShockSensorSensitivityReq' + Device: 'R900PB03O1' + ShockSensorSensitivity: 5 + output: + fPort: 23 + bytes: [0x03, 0x01, 0x10, 0x05] + + - description: Read configure report request + input: + data: + Cmd: 'GetShockSensorSensitivityReq' + Device: 'R900PB03O1' + output: + fPort: 23 + bytes: [0x04, 0x01, 0x10] + + - description: Read configure report request + input: + data: + Cmd: 'SetOnDistanceThresholdRreq' + Device: 'R900PB03O1' + OnDistanceThreshold: 801 + output: + fPort: 23 + bytes: [0x05, 0x01, 0x10, 0x03, 0x21] + + - description: Read configure report request + input: + data: + Cmd: 'GetOnDistanceThresholdRreq' + Device: 'R900PB03O1' + output: + fPort: 23 + bytes: [0x06, 0x01, 0x10] + + - description: Read configure report request + input: + data: + Cmd: 'SetFillMaxDistanceReq' + Device: 'R900PB03O1' + FillMaxDistance: 518 + output: + fPort: 23 + bytes: [0x07, 0x01, 0x10, 0x02, 0x06] + + - description: Read configure report request + input: + data: + Cmd: 'GetFillMaxDistanceReq' + Device: 'R900PB03O1' + output: + fPort: 23 + bytes: [0x08, 0x01, 0x10] + + - description: Read configure report request + input: + data: + Cmd: 'SetDeadZoneDistanceReq' + Device: 'R900PB03O1' + DeadZoneDistance: 5137 + output: + fPort: 23 + bytes: [0x09, 0x01, 0x10, 0x14, 0x11] + + - description: Read configure report request + input: + data: + Cmd: 'GetDeadZoneDistanceReq' + Device: 'R900PB03O1' + output: + fPort: 23 + bytes: [0x0a, 0x01, 0x10] + + - description: Read configure report request + input: + data: + Cmd: 'ConfigDryContactPointOutReq' + Device: 'R900PB03O1' + DryContactPointOutType: 'NormallyHighLevel' + OutPluseTime: 5 + LowDistanceAlarm: 0 + HighDistanceAlarm: 1 + LowFillLevelAlarm: 0 + HighFillLevelAlarm: 0 + Channel: 'Channel2' + output: + fPort: 23 + bytes: [0x0b, 0x01, 0x10, 0x01, 0x05, 0x02, 0x01] + + - description: Read configure report request + input: + data: + Cmd: 'ReadConfigDryContactPointOutReq' + Device: 'R900PB03O1' + Channel: 'Channel2' + output: + fPort: 23 + bytes: [0x0c, 0x01, 0x10, 0x01] + + - description: Read configure report request + input: + data: + Cmd: 'TriggerDryContactPointOutReq' + Device: 'R900PB03O1' + OutPluseTime: 8 + Channel: 'Channel1' + output: + fPort: 23 + bytes: [0x0d, 0x01, 0x10, 0x08, 0x00] diff --git a/vendor/netvox/r900pb03o1.yaml b/vendor/netvox/r900pb03o1.yaml new file mode 100755 index 0000000000..f330704b84 --- /dev/null +++ b/vendor/netvox/r900pb03o1.yaml @@ -0,0 +1,69 @@ +name: R900PB03O1 - Wireless Water leak Sensor +description: The Netvox R900PB03O1 Water Leak Detector comes with two water leak sensors suitable for detecting water and other liquid leaks in residential and commercial buildings. When the sensor detects a leak, an alarm message will be sent to the LoRaWAN® network. + +hardwareVersions: + - version: '11' + numeric: 11 + +firmwareVersions: + - version: '10' + numeric: 10 + hardwareVersions: + - '11' + + profiles: + EU863-870: + id: profile-eu868 + codec: r900pb03o1-codec + AS923: + id: profile-as923 + codec: r900pb03o1-codec + US902-928: + id: profile-us915 + codec: r900pb03o1-codec + AU915-928: + id: profile-au915 + codec: r900pb03o1-codec + KR920-923: + id: profile-kr920 + codec: r900pb03o1-codec + IN865-867: + id: profile-in865 + codec: r900pb03o1-codec + CN470-510: + id: profile-cn470 + codec: r900pb03o1-codec + +sensors: + - water + +dimensions: + width: 35 + length: 57 + height: 15.2 + +weight: 48.9 + +battery: + replaceable: true + type: 2 x 3.0V CR2450 button batteries + +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=R900PB03O1 +dataSheetURL: http://www.netvox.com.tw/um/R900PB03O1/R900PB03O1datasheet.pdf + +photos: + main: photos/r900pb03o1.png diff --git a/vendor/netvox/r900pd01-codec.yaml b/vendor/netvox/r900pd01-codec.yaml new file mode 100755 index 0000000000..865e7dd1be --- /dev/null +++ b/vendor/netvox/r900pd01-codec.yaml @@ -0,0 +1,174 @@ +uplinkDecoder: + fileName: payload/r900pd01.js + examples: + - description: Startup version report + input: + fPort: 22 + bytes: [0x03, 0x01, 0x06, 0x00, 0x64, 0x0B, 0x20, 0x19, 0x11, 0x12] + output: + data: + Device: 'R900PD01' + SWver: 10 + HWver: 11 + Datecode: '20191112' + + - description: Status report + input: + fPort: 22 + bytes: [0x03, 0x01, 0x06, 0x01, 0x01, 0x03, 0x03, 0x03, 0x00, 0x09, 0x01, 0x01, 0x01, 0x12, 0x00, 0x02, 0x01] + output: + data: + Device: 'R900PD01' + PH: '2.59pH' + TemperaturewithPH: '7.71℃' + NTU: '0.9ntu' + TemperaturewithNTU: '2.57℃' + Residual: '2.74mg/L' + LowPHAlarm: 0 + HighPHAlarm: 1 + LowNTUAlarm: 0 + HighNTUAlarm: 0 + LowResidualChlorineAlarm: 0 + HighResidualChlorineAlarm: 0 + LowTempWithPHAlarm: 0 + HighTempWithPHAlarm: 0 + LowTempWithNTUAlarm: 0 + HighTempWithNTUAlarm: 0 + ShockTamperAlarm: 'Alarm' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x81, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportRsp' + Device: 'R900PD01' + Status: 'Success' + + - description: Read configure report response + input: + fPort: 23 + bytes: [0x82, 0x01, 0x06, 0x03, 0x84, 0x07, 0x08, 0x01, 0x50, 0x06, 0x01, 0x02, 0x01, 0x00, 0x08] + output: + data: + Cmd: 'ReadConfigReportRsp' + Device: 'R900PD01' + MinTime: 900 + MaxTime: 1800 + PHChange: '3.36pH' + NTUChange: '153.7ntu' + ResidualChlorineChange: '5.13mg/L' + TemperatureChange: '0.08℃' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x83, 0x01, 0x06, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetShockSensorSensitivityRsp' + Device: 'R900PD01' + Status: 'Failure' + + - description: Read configure report response + input: + fPort: 23 + bytes: [0x84, 0x01, 0x06, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetShockSensorSensitivityRsp' + Device: 'R900PD01' + ShockSensorSensitivity: 3 + +downlinkDecoder: + fileName: payload/r900pd01.js + examples: + - description: Configure report request + input: + fPort: 23 + bytes: [0x01, 0x01, 0x06, 0x03, 0x84, 0x07, 0x08, 0x01, 0x01, 0x00, 0x04, 0x02, 0x10, 0x10, 0x10] + output: + data: + Cmd: 'ConfigReportReq' + Device: 'R900PD01' + MinTime: 900 + MaxTime: 1800 + PHChange: '2.57pH' + NTUChange: '0.4ntu' + ResidualChlorineChange: '5.28mg/L' + TemperatureChange: '41.12℃' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x02, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R900PD01' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x03, 0x01, 0x06, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetShockSensorSensitivityReq' + Device: 'R900PD01' + ShockSensorSensitivity: 9 + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x04, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetShockSensorSensitivityReq' + Device: 'R900PD01' + +downlinkEncoder: + fileName: payload/r900pd01.js + examples: + - description: Configure report request + input: + data: + Cmd: 'ConfigReportReq' + Device: 'R900PD01' + MinTime: 900 + MaxTime: 1800 + PHChange: 2.57 + NTUChange: 0.4 + ResidualChlorineChange: 5.28 + TemperatureChange: 41.12 + output: + fPort: 23 + bytes: [0x01, 0x01, 0x06, 0x03, 0x84, 0x07, 0x08, 0x01, 0x01, 0x00, 0x04, 0x02, 0x10, 0x10, 0x10] + + - description: Read configure report request + input: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R900PD01' + output: + fPort: 23 + bytes: [0x02, 0x01, 0x06] + + - description: Read configure report request + input: + data: + Cmd: 'SetShockSensorSensitivityReq' + Device: 'R900PD01' + ShockSensorSensitivity: 5 + output: + fPort: 23 + bytes: [0x03, 0x01, 0x06, 0x05] + + - description: Read configure report request + input: + data: + Cmd: 'GetShockSensorSensitivityReq' + Device: 'R900PD01' + output: + fPort: 23 + bytes: [0x04, 0x01, 0x06] diff --git a/vendor/netvox/r900pd01.yaml b/vendor/netvox/r900pd01.yaml new file mode 100755 index 0000000000..7c40ed65d5 --- /dev/null +++ b/vendor/netvox/r900pd01.yaml @@ -0,0 +1,69 @@ +name: R900PD01 - Wireless Water leak Sensor +description: The Netvox R900PD01 Water Leak Detector comes with two water leak sensors suitable for detecting water and other liquid leaks in residential and commercial buildings. When the sensor detects a leak, an alarm message will be sent to the LoRaWAN® network. + +hardwareVersions: + - version: '11' + numeric: 11 + +firmwareVersions: + - version: '10' + numeric: 10 + hardwareVersions: + - '11' + + profiles: + EU863-870: + id: profile-eu868 + codec: r900pd01-codec + AS923: + id: profile-as923 + codec: r900pd01-codec + US902-928: + id: profile-us915 + codec: r900pd01-codec + AU915-928: + id: profile-au915 + codec: r900pd01-codec + KR920-923: + id: profile-kr920 + codec: r900pd01-codec + IN865-867: + id: profile-in865 + codec: r900pd01-codec + CN470-510: + id: profile-cn470 + codec: r900pd01-codec + +sensors: + - water + +dimensions: + width: 35 + length: 57 + height: 15.2 + +weight: 48.9 + +battery: + replaceable: true + type: 2 x 3.0V CR2450 button batteries + +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=R900PD01 +dataSheetURL: http://www.netvox.com.tw/um/R900PD01/R900PD01datasheet.pdf + +photos: + main: photos/r900pd01.png diff --git a/vendor/netvox/r900pd01o1-codec.yaml b/vendor/netvox/r900pd01o1-codec.yaml new file mode 100755 index 0000000000..8e2a895115 --- /dev/null +++ b/vendor/netvox/r900pd01o1-codec.yaml @@ -0,0 +1,302 @@ +uplinkDecoder: + fileName: payload/r900pd01.js + examples: + - description: Startup version report + input: + fPort: 22 + bytes: [0x03, 0x01, 0x0e, 0x00, 0x64, 0x0B, 0x20, 0x19, 0x11, 0x12] + output: + data: + Device: 'R900PD01O1' + SWver: 10 + HWver: 11 + Datecode: '20191112' + + - description: Status report + input: + fPort: 22 + bytes: [0x03, 0x01, 0x0e, 0x01, 0x01, 0x03, 0x03, 0x03, 0x00, 0x09, 0x01, 0x01, 0x01, 0x12, 0x00, 0x02, 0x01] + output: + data: + Device: 'R900PD01O1' + PH: '2.59pH' + TemperaturewithPH: '7.71℃' + NTU: '0.9ntu' + TemperaturewithNTU: '2.57℃' + Residual: '2.74mg/L' + LowPHAlarm: 0 + HighPHAlarm: 1 + LowNTUAlarm: 0 + HighNTUAlarm: 0 + LowResidualChlorineAlarm: 0 + HighResidualChlorineAlarm: 0 + LowTempWithPHAlarm: 0 + HighTempWithPHAlarm: 0 + LowTempWithNTUAlarm: 0 + HighTempWithNTUAlarm: 0 + ShockTamperAlarm: 'Alarm' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x81, 0x01, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportRsp' + Device: 'R900PD01O1' + Status: 'Success' + + - description: Read configure report response + input: + fPort: 23 + bytes: [0x82, 0x01, 0x0e, 0x03, 0x84, 0x07, 0x08, 0x01, 0x50, 0x06, 0x01, 0x02, 0x01, 0x00, 0x08] + output: + data: + Cmd: 'ReadConfigReportRsp' + Device: 'R900PD01O1' + MinTime: 900 + MaxTime: 1800 + PHChange: '3.36pH' + NTUChange: '153.7ntu' + ResidualChlorineChange: '5.13mg/L' + TemperatureChange: '0.08℃' + + - description: Configure report response + input: + fPort: 23 + bytes: [0x83, 0x01, 0x0e, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetShockSensorSensitivityRsp' + Device: 'R900PD01O1' + Status: 'Failure' + + - description: Read configure report response + input: + fPort: 23 + bytes: [0x84, 0x01, 0x0e, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetShockSensorSensitivityRsp' + Device: 'R900PD01O1' + ShockSensorSensitivity: 3 + + - description: Read configure report response + input: + fPort: 23 + bytes: [0x85, 0x01, 0x0e, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigDryContactPointOutRsp' + Device: 'R900PD01O1' + Status: 'Failure' + + - description: Read configure report response + input: + fPort: 23 + bytes: [0x86, 0x01, 0x0e, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigDryContactPointOutRsp' + Device: 'R900PD01O1' + DryContactPointOutType: 'NormallyLowLevel' + OutPluseTime: '3s' + LowPHAlarm: 1 + HighPHAlarm: 1 + LowNTUAlarm: 0 + HighNTUAlarm: 0 + LowResidualChlorineAlarm: 0 + HighResidualChlorineAlarm: 0 + LowTempWithPHAlarm: 0 + HighTempWithPHAlarm: 0 + LowTempWithNTUAlarm: 0 + HighTempWithNTUAlarm: 0 + Channel: 'Channel1' + + - description: Read configure report response + input: + fPort: 23 + bytes: [0x87, 0x01, 0x0e, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'TriggerDryContactPointOutRsp' + Device: 'R900PD01O1' + Status: 'Failure' + +downlinkDecoder: + fileName: payload/r900pd01.js + examples: + - description: Configure report request + input: + fPort: 23 + bytes: [0x01, 0x01, 0x0e, 0x03, 0x84, 0x07, 0x08, 0x01, 0x01, 0x00, 0x04, 0x02, 0x10, 0x10, 0x10] + output: + data: + Cmd: 'ConfigReportReq' + Device: 'R900PD01O1' + MinTime: 900 + MaxTime: 1800 + PHChange: '2.57pH' + NTUChange: '0.4ntu' + ResidualChlorineChange: '5.28mg/L' + TemperatureChange: '41.12℃' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x02, 0x01, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R900PD01O1' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x03, 0x01, 0x0e, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetShockSensorSensitivityReq' + Device: 'R900PD01O1' + ShockSensorSensitivity: 9 + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x04, 0x01, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetShockSensorSensitivityReq' + Device: 'R900PD01O1' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x05, 0x01, 0x0e, 0x00, 0x0a, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigDryContactPointOutReq' + Device: 'R900PD01O1' + DryContactPointOutType: 'NormallyLowLevel' + OutPluseTime: '10s' + LowPHAlarm: 0 + HighPHAlarm: 0 + LowNTUAlarm: 1 + HighNTUAlarm: 0 + LowResidualChlorineAlarm: 0 + HighResidualChlorineAlarm: 0 + LowTempWithPHAlarm: 0 + HighTempWithPHAlarm: 0 + LowTempWithNTUAlarm: 0 + HighTempWithNTUAlarm: 0 + Channel: 'Channel1' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x06, 0x01, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigDryContactPointOutReq' + Device: 'R900PD01O1' + Channel: 'Channel1' + + - description: Read configure report request + input: + fPort: 23 + bytes: [0x07, 0x01, 0x0e, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'TriggerDryContactPointOutReq' + Device: 'R900PD01O1' + OutPluseTime: 2 + Channel: 'Channel2' + +downlinkEncoder: + fileName: payload/r900pd01.js + examples: + - description: Configure report request + input: + data: + Cmd: 'ConfigReportReq' + Device: 'R900PD01O1' + MinTime: 900 + MaxTime: 1800 + PHChange: 2.57 + NTUChange: 0.4 + ResidualChlorineChange: 5.28 + TemperatureChange: 41.12 + output: + fPort: 23 + bytes: [0x01, 0x01, 0x0e, 0x03, 0x84, 0x07, 0x08, 0x01, 0x01, 0x00, 0x04, 0x02, 0x10, 0x10, 0x10] + + - description: Read configure report request + input: + data: + Cmd: 'ReadConfigReportReq' + Device: 'R900PD01O1' + output: + fPort: 23 + bytes: [0x02, 0x01, 0x0e] + + - description: Read configure report request + input: + data: + Cmd: 'SetShockSensorSensitivityReq' + Device: 'R900PD01O1' + ShockSensorSensitivity: 5 + output: + fPort: 23 + bytes: [0x03, 0x01, 0x0e, 0x05] + + - description: Read configure report request + input: + data: + Cmd: 'GetShockSensorSensitivityReq' + Device: 'R900PD01O1' + output: + fPort: 23 + bytes: [0x04, 0x01, 0x0e] + + - description: Read configure report request + input: + data: + Cmd: 'ConfigDryContactPointOutReq' + Device: 'R900PD01O1' + DryContactPointOutType: 'NormallyLowLevel' + OutPluseTime: 10 + LowPHAlarm: 0 + HighPHAlarm: 0 + LowNTUAlarm: 0 + HighNTUAlarm: 1 + LowResidualChlorineAlarm: 0 + HighResidualChlorineAlarm: 0 + LowTempWithPHAlarm: 0 + HighTempWithPHAlarm: 0 + LowTempWithNTUAlarm: 0 + HighTempWithNTUAlarm: 0 + Channel: 'Channel1' + output: + fPort: 23 + bytes: [0x05, 0x01, 0x0e, 0x00, 0x0a, 0x00, 0x08, 0x00] + + - description: Read configure report request + input: + data: + Cmd: 'ReadConfigDryContactPointOutReq' + Device: 'R900PD01O1' + Channel: 'Channel1' + output: + fPort: 23 + bytes: [0x06, 0x01, 0x0e, 0x00] + + - description: Read configure report request + input: + data: + Cmd: 'TriggerDryContactPointOutReq' + Device: 'R900PD01O1' + OutPluseTime: 17 + Channel: 'Channel2' + output: + fPort: 23 + bytes: [0x07, 0x01, 0x0e, 0x11, 0x01] diff --git a/vendor/netvox/r900pd01o1.yaml b/vendor/netvox/r900pd01o1.yaml new file mode 100755 index 0000000000..9fa9cb2297 --- /dev/null +++ b/vendor/netvox/r900pd01o1.yaml @@ -0,0 +1,69 @@ +name: R900PD01O1 - Wireless Water leak Sensor +description: The Netvox R900PD01O1 Water Leak Detector comes with two water leak sensors suitable for detecting water and other liquid leaks in residential and commercial buildings. When the sensor detects a leak, an alarm message will be sent to the LoRaWAN® network. + +hardwareVersions: + - version: '11' + numeric: 11 + +firmwareVersions: + - version: '10' + numeric: 10 + hardwareVersions: + - '11' + + profiles: + EU863-870: + id: profile-eu868 + codec: r900pd01o1-codec + AS923: + id: profile-as923 + codec: r900pd01o1-codec + US902-928: + id: profile-us915 + codec: r900pd01o1-codec + AU915-928: + id: profile-au915 + codec: r900pd01o1-codec + KR920-923: + id: profile-kr920 + codec: r900pd01o1-codec + IN865-867: + id: profile-in865 + codec: r900pd01o1-codec + CN470-510: + id: profile-cn470 + codec: r900pd01o1-codec + +sensors: + - water + +dimensions: + width: 35 + length: 57 + height: 15.2 + +weight: 48.9 + +battery: + replaceable: true + type: 2 x 3.0V CR2450 button batteries + +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=R900PD01O1 +dataSheetURL: http://www.netvox.com.tw/um/R900PD01O1/R900PD01O1datasheet.pdf + +photos: + main: photos/r900pd01o1.png diff --git a/vendor/netvox/ra02c-codec.yaml b/vendor/netvox/ra02c-codec.yaml index 65e0b205bb..ff1c6ee864 100755 --- a/vendor/netvox/ra02c-codec.yaml +++ b/vendor/netvox/ra02c-codec.yaml @@ -1,5 +1,5 @@ uplinkDecoder: - fileName: payload/ra02a.js + fileName: payload/ra02c.js examples: - description: Startup version report input: @@ -66,7 +66,7 @@ uplinkDecoder: AlarmThreshold: 100 downlinkDecoder: - fileName: payload/ra02a.js + fileName: payload/ra02c.js examples: - description: Configure report request input: @@ -109,7 +109,7 @@ downlinkDecoder: Device: 'RA02C' downlinkEncoder: - fileName: payload/ra02a.js + fileName: payload/ra02c.js examples: - description: Configure report request input: diff --git a/vendor/netvox/ra02d1-codec.yaml b/vendor/netvox/ra02d1-codec.yaml new file mode 100755 index 0000000000..97a612b461 --- /dev/null +++ b/vendor/netvox/ra02d1-codec.yaml @@ -0,0 +1,92 @@ +uplinkDecoder: + fileName: payload/ra02d1.js + examples: + - description: Startup version report + input: + fPort: 6 + bytes: [0x01, 0xD6, 0x00, 0x64, 0x0B, 0x20, 0x19, 0x11, 0x12, 0x00, 0x00] + output: + data: + Device: 'RA02D1' + SWver: 10 + HWver: 11 + Datecode: '20191112' + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0xD6, 0x01, 0x01, 0x00, 0x01, 0x00, 0x03, 0x00, 0x00, 0x00] + output: + data: + Device: 'RA02D1' + Volt: 0.1 + LPGAlarm: 'noalarm' + HighTempAlarm: 'alarm' + Temp: 0.3 + + - description: Configure report response + input: + fPort: 7 + bytes: [0x81, 0xD6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportRsp' + Device: 'RA02D1' + Status: 'Success' + + - description: Read configure report response + input: + fPort: 7 + bytes: [0x82, 0xD6, 0x03, 0x84, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigReportRsp' + Device: 'RA02D1' + MinTime: 900 + MaxTime: 1800 + +downlinkDecoder: + fileName: payload/ra02d1.js + examples: + - description: Configure report request + input: + fPort: 7 + bytes: [0x01, 0xD6, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportReq' + Device: 'RA02D1' + MinTime: 900 + MaxTime: 1800 + + - description: Read configure report request + input: + fPort: 7 + bytes: [0x02, 0xD6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigReportReq' + Device: 'RA02D1' + +downlinkEncoder: + fileName: payload/ra02d1.js + examples: + - description: Configure report request + input: + data: + Cmd: 'ConfigReportReq' + Device: 'RA02D1' + MinTime: 900 + MaxTime: 1800 + output: + fPort: 7 + bytes: [0x01, 0xD6, 0x03, 0x84, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: Read configure report request + input: + data: + Cmd: 'ReadConfigReportReq' + Device: 'RA02D1' + output: + fPort: 7 + bytes: [0x02, 0xD6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] diff --git a/vendor/netvox/ra02d1.yaml b/vendor/netvox/ra02d1.yaml new file mode 100755 index 0000000000..83a8d1f450 --- /dev/null +++ b/vendor/netvox/ra02d1.yaml @@ -0,0 +1,69 @@ +name: RA02D1 - Wireless Water leak Sensor +description: The Netvox RA02D1 Water Leak Detector comes with two water leak sensors suitable for detecting water and other liquid leaks in residential and commercial buildings. When the sensor detects a leak, an alarm message will be sent to the LoRaWAN® network. + +hardwareVersions: + - version: '11' + numeric: 11 + +firmwareVersions: + - version: '10' + numeric: 10 + hardwareVersions: + - '11' + + profiles: + EU863-870: + id: profile-eu868 + codec: ra02d1-codec + AS923: + id: profile-as923 + codec: ra02d1-codec + US902-928: + id: profile-us915 + codec: ra02d1-codec + AU915-928: + id: profile-au915 + codec: ra02d1-codec + KR920-923: + id: profile-kr920 + codec: ra02d1-codec + IN865-867: + id: profile-in865 + codec: ra02d1-codec + CN470-510: + id: profile-cn470 + codec: ra02d1-codec + +sensors: + - water + +dimensions: + width: 35 + length: 57 + height: 15.2 + +weight: 48.9 + +battery: + replaceable: true + type: 2 x 3.0V CR2450 button batteries + +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=RA02D1 +dataSheetURL: http://www.netvox.com.tw/um/RA02D1/RA02D1datasheet.pdf + +photos: + main: photos/ra02d1.png diff --git a/vendor/netvox/ra02g-codec.yaml b/vendor/netvox/ra02g-codec.yaml new file mode 100755 index 0000000000..5fdae9cd2e --- /dev/null +++ b/vendor/netvox/ra02g-codec.yaml @@ -0,0 +1,234 @@ +uplinkDecoder: + fileName: payload/ra02g.js + examples: + - description: Startup version report + input: + fPort: 6 + bytes: [0x01, 0xD7, 0x00, 0x64, 0x15, 0x20, 0x20, 0x08, 0x11, 0x00, 0x00] + output: + data: + Device: 'RA02G' + SWver: 10 + HWver: 21 + Datecode: '20200811' + + - description: Status report + input: + fPort: 6 + bytes: [0x01, 0xD7, 0x01, 0x30, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00] + output: + data: + Device: 'RA02G' + Volt: 4.8 + IncenseSmokeAlarm: 'No Alarm' + HighSoundAlarm: 'No Alarm' + TemShockTamperAlarmp: 'Alarm' + PowerOffAlarm: 'Alarm' + + - description: Configure report response + input: + fPort: 7 + bytes: [0x81, 0xD7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportRsp' + Device: 'RA02G' + Status: 'Success' + + - description: Read configure report response + input: + fPort: 7 + bytes: [0x82, 0xD7, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ReadConfigReportRsp' + Device: 'RA02G' + MinTime: 900 + MaxTime: 1800 + + - description: Read configure report response + input: + fPort: 7 + bytes: [0x84, 0xD7, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetSmokeSensitivityRsp' + Device: 'RA02G' + SmokesensorSensitivity: 'Level3' + + - description: Read configure report response + input: + fPort: 7 + bytes: [0x86, 0xD7, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetShockSensorSensitivityRsp' + Device: 'RA02G' + ShockSensorSensitivity: 3 + + - description: Read configure report response + input: + fPort: 7 + bytes: [0x88, 0xD7, 0x03, 0x04, 0x07, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetHighSoundAlarmTriggerThresholdTimeRsp' + Device: 'RA02G' + HighSoundAlarmTriggerThreshold: 772 + HighSoundAlarmTriggerDuration: 1800 + + - description: Read configure report response + input: + fPort: 7 + bytes: [0x8A, 0xD7, 0x03, 0x08, 0x07, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetBeeperDurationRsp' + Device: 'RA02G' + BeeperDuration: 776 + AlarmSoundLevel: 7 + + - description: Read configure report response + input: + fPort: 7 + bytes: [0x8D, 0xD7, 0x02, 0x10, 0x16, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'GetSmokeDebounceandResumeCheckTimeRsp' + Device: 'RA02G' + SmokeDebounceTIme: 528 + SmokeResumeTime: 22 + +downlinkDecoder: + fileName: payload/ra02g.js + examples: + - description: Configure report request + input: + fPort: 7 + bytes: [0x01, 0xD7, 0x03, 0x84, 0x07, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'ConfigReportReq' + Device: 'RA02G' + MinTime: 900 + MaxTime: 1800 + + - description: Read configure report request + input: + fPort: 7 + bytes: [0x03, 0xD7, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetSmokeSensitivityReq' + Device: 'RA02G' + SmokesensorSensitivity: 'Level1' + + - description: Read configure report response + input: + fPort: 7 + bytes: [0x05, 0xD7, 0x13, 0x84, 0x07, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetShockSensorSensitivityReq' + Device: 'RA02G' + ShockSensorSensitivity: 19 + + - description: Read configure report response + input: + fPort: 7 + bytes: [0x07, 0xD7, 0x03, 0x18, 0x07, 0x18, 0x01, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetHighSoundAlarmTriggerThresholdTimeReq' + Device: 'RA02G' + HighSoundAlarmTriggerThreshold: 792 + HighSoundAlarmTriggerDuration: 1816 + + - description: Read configure report response + input: + fPort: 7 + bytes: [0x09, 0xD7, 0x03, 0x12, 0x07, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetBeeperDurationReq' + Device: 'RA02G' + BeeperDuration: 786 + AlarmSoundLevel: 7 + + - description: Read configure report response + input: + fPort: 7 + bytes: [0x0C, 0xD7, 0x06, 0x04, 0x07, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00] + output: + data: + Cmd: 'SetSmokeDebounceandResumeCheckTimeReq' + Device: 'RA02G' + SmokeDebounceTIme: 1540 + SmokeResumeTime: 7 + +downlinkEncoder: + fileName: payload/ra02g.js + examples: + - description: Configure report request + input: + data: + Cmd: 'ConfigReportReq' + Device: 'RA02G' + MinTime: 900 + MaxTime: 1800 + output: + fPort: 7 + bytes: [0x01, 0xD7, 0x03, 0x84, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: Read configure report request + input: + data: + Cmd: 'SetSmokeSensitivityReq' + Device: 'RA02G' + SmokesensorSensitivity: 'Level1' + output: + fPort: 7 + bytes: [0x03, 0xD7, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: Read configure report request + input: + data: + Cmd: 'SetShockSensorSensitivityReq' + Device: 'RA02G' + ShockSensorSensitivity: 19 + output: + fPort: 7 + bytes: [0x05, 0xD7, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: Read configure report request + input: + data: + Cmd: 'SetHighSoundAlarmTriggerThresholdTimeReq' + Device: 'RA02G' + HighSoundAlarmTriggerThreshold: 792 + HighSoundAlarmTriggerDuration: 1816 + output: + fPort: 7 + bytes: [0x07, 0xD7, 0x03, 0x18, 0x07, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: Read configure report request + input: + data: + Cmd: 'SetBeeperDurationReq' + Device: 'RA02G' + BeeperDuration: 786 + AlarmSoundLevel: 7 + output: + fPort: 7 + bytes: [0x09, 0xD7, 0x03, 0x12, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + + - description: Read configure report request + input: + data: + Cmd: 'SetSmokeDebounceandResumeCheckTimeReq' + Device: 'RA02G' + SmokeDebounceTIme: 1540 + SmokeResumeTime: 7 + output: + fPort: 7 + bytes: [0x0C, 0xD7, 0x06, 0x04, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] diff --git a/vendor/netvox/ra02g.yaml b/vendor/netvox/ra02g.yaml new file mode 100755 index 0000000000..d9fd8bea3f --- /dev/null +++ b/vendor/netvox/ra02g.yaml @@ -0,0 +1,63 @@ +name: RA02G - Wireless Smoking Warning +description: RA02G is a Wireless Smoking Warning. + +hardwareVersions: + - version: '21' + numeric: 21 + +firmwareVersions: + - version: '10' + numeric: 10 + hardwareVersions: + - '21' + + profiles: + EU863-870: + id: profile-eu868 + codec: ra02g-codec + AS923: + id: profile-as923 + codec: ra02g-codec + US902-928: + id: profile-us915 + codec: ra02g-codec + AU915-928: + id: profile-au915 + codec: ra02g-codec + KR920-923: + id: profile-kr920 + codec: ra02g-codec + IN865-867: + id: profile-in865 + codec: ra02g-codec + CN470-510: + id: profile-cn470 + codec: ra02g-codec + +dimensions: + diameter: 106 + height: 40.6 + +battery: + replaceable: true + type: 2 x1.5V AAA alkaline batteries + +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=RA02G +dataSheetURL: http://www.netvox.com.tw/um/RA02G/RA02Gdatasheet.pdf + +photos: + main: photos/ra02g.png diff --git a/vendor/netvox/rp02.yaml b/vendor/netvox/rp02.yaml index 92a59377f7..03c773d37d 100755 --- a/vendor/netvox/rp02.yaml +++ b/vendor/netvox/rp02.yaml @@ -33,11 +33,9 @@ firmwareVersions: CN470-510: id: profile-cn470 codec: rp02-codec - sensors: - current - voltage - dimensions: width: 88.19 length: 112