GET http://192.168.1.122:8080/devices/019D202A/telegrams 得到的电报
{
"header" : {
"httpStatus" : 200,
"content" : "telegrams",
"gateway" : "DC-GW/EO-IP v0.99.6",
"timestamp" : "1970-01-01T08:07:46.898+0800"
},
"telegrams" : [ {
"deviceId" : "019D202A",
"friendlyId" : "hhh666",
"physicalDevice" : "99999",
"timestamp" : "1970-01-01T08:05:14.072+0800",
"direction" : "from",
"functions" : [ {
"key" : "supplyVoltage",
"value" : 3.60,
"unit" : "V"
},{
"deviceId" : "019D202A",
"friendlyId" : "hhh666",
"physicalDevice" : "99999",
"timestamp" : "1970-01-01T08:06:24.098+0800",
"direction" : "from",
"functions" : [ {
"key" : "supplyVoltage",
"value" : 3.66,
"unit" : "V"
}, {
"key" : "illumination",
"value" : 244.00,
"unit" : "lx"
}, {
"key" : "temperature",
"value" : 21.20,
"unit" : "°C"
}, {
"key" : "motionDetected",
"value" : "true",
"meaning" : "PIR on"
}, {
"key" : "occupancyButton",
"value" : "pressed",
"meaning" : "Button pressed"
} ],
"telegramInfo" : {
"data" : "B77A6A08",
"status" : "0",
"dbm" : -61,
"rorg" : "A5"
}
} ]
}
如何用lua脚本解析一个值输出;如上面代码中有“supplyVoltage”“illumination”“temperature”“motionDetected”“occupancyButton”等值,只取一个值
解析格式类似与
function parameter (value)
return "/temperature/setTemp.php?temp="..value end
这种格式
啊啊~~~~~!