[ { "id":"6293953092084e2df303ba3e", "uid": "1", "name": "三路开关", "productKey": "eDhXKwEzwFybM5R7", "devices": [ "16538390097670switch0300100500143", "16538390048670switch0300100400141", "16538390008670switch0300100300145", "16538389971670switch0300100200140", "16538389915670switch030010010014c" ], "type": "thingModel", "script": "\nvar mid=1000;\n\nfunction getMid(){\n mid++;\n if(mid>9999){\n\tmid=1;\n }\n return mid+\"\";\n}\n\nfunction getRequestId(){\n return \"RID\"+new Date().getTime()+getMid();\n}\n\n\nthis.receive=function(service,device){\n return [];\n}\n\nthis.report=function(device){\n return {\n \"mid\":getRequestId(),\n \"productKey\":device.productKey, \n \"deviceName\":device.deviceName,\n \"type\":\"property\",\n \"identifier\":\"report\",\n \"occurred\":new Date().getTime(),\t//时间戳,设备上的事件或数据产生的本地时间\n \"time\":new Date().getTime(),\t\t//时间戳,消息上报时间\n \"data\":{\n\t \"rssi\":127-parseInt(Math.random()*127),\n\t \"powerstate_1\":Math.random()>0.5?1:0,\n\t \"powerstate_2\":Math.random()>0.5?1:0,\n\t \"powerstate_3\":Math.random()>0.5?1:0\n }\n }\n}", "trigger": "random", "triggerExpression": "second", "state": "running", "createAt": 1653839152090 }, { "id":"629391ae92084e2df303ba3d", "uid": "1", "name": "温湿度传感器", "productKey": "6kYp6jszrDns2yh4", "devices": [ "16538383943670wenshidu01008000139", "16538383910670wenshidu01007000136", "16538383880670wenshidu0100600013b", "16538383850710wenshidu01005000134", "16538383810690wenshidu01004000132", "16537594784840wenshidu0100300013a", "16537594752710wenshidu0100200013d", "16537594707840wenshidu0100100013c", "16538390097670switch0300100500143", "16514626218250abe124000010000011a" ], "type": "thingModel", "script": "\nvar mid=1000;\n\nfunction getMid(){\n mid++;\n if(mid>9999){\n\tmid=1;\n }\n return mid+\"\";\n}\n\nfunction getRequestId(){\n return \"RID\"+new Date().getTime()+getMid();\n}\n\n\nthis.receive=function(service,device){\n return [];\n}\n\nthis.report=function(device){\n return {\n \"mid\":getRequestId(),\n \"productKey\":device.productKey, \n \"deviceName\":device.deviceName,\n \"type\":\"property\",\n \"identifier\":\"report\",\n \"occurred\":new Date().getTime(),\t//时间戳,设备上的事件或数据产生的本地时间\n \"time\":new Date().getTime(),\t\t//时间戳,消息上报时间\n \"data\":{\n \"humidity\":parseInt(Math.random()*100),\n\t \"temperature\":parseInt(Math.random()*500)-38\n }\n }\n}", "trigger": "random", "triggerExpression": "second", "state": "running", "createAt": 1653838254989 }, { "id": "629390f492084e2df303ba3c", "uid": "1", "name": "调光灯", "productKey": "xpsYHExTKPFaQMS7", "devices": [ "16537595658790linght0010030000128", "16537595624750linght001002000012c", "16537595591780linght0010010000121", "16552594933210linght001007000012f", "16552594898210linght0010060000129", "16552594863210linght001005000012c", "16552594812210linght001004000012d" ], "type": "thingModel", "script": "\nvar mid=1000;\n\nfunction getMid(){\n mid++;\n if(mid>9999){\n\tmid=1;\n }\n return mid+\"\";\n}\n\nfunction getRequestId(){\n return \"RID\"+new Date().getTime()+getMid();\n}\n\n\nthis.receive=function(service,device){\n return [];\n}\n\nthis.report=function(device){\n return {\n \"mid\":getRequestId(),\n \"productKey\":device.productKey, \n \"deviceName\":device.deviceName,\n \"type\":\"property\",\n \"identifier\":\"report\",\n \"occurred\":new Date().getTime(),\t//时间戳,设备上的事件或数据产生的本地时间\n \"time\":new Date().getTime(),\t\t//时间戳,消息上报时间\n \"data\":{\n \"brightness\":parseInt(Math.random()*100),\n\t \"powerstate\":Math.random()>0.5?1:0\n }\n }\n}", "trigger": "random", "triggerExpression": "second", "state": "running", "createAt": 1653838068860 }, { "id": "62925cb72002b44c15caeb1c", "uid": "1", "name": "虚拟门磁1", "productKey": "PN3EDmkBZDD8whDd", "devices": [ "16537591055800menci0001003000012e", "16537590838150menci00010020000128", "16537590780810menci0001001000012b", "16552595723210menci0001008000012f", "16552595685220menci00010070000127", "16552595656210menci0001006000012d", "16501898583770f4cce4feffbd1bec164" ], "type": "thingModel", "script": "\nvar mid=1000;\n\nfunction getMid(){\n mid++;\n if(mid>9999){\n\tmid=1;\n }\n return mid+\"\";\n}\n\nfunction getRequestId(){\n return \"RID\"+new Date().getTime()+getMid();\n}\n\n\nthis.receive=function(service,device){\n return [];\n}\n\nthis.report=function(device){\n return {\n \"mid\":getRequestId(),\n \"productKey\":device.productKey, \n \"deviceName\":device.deviceName,\n \"type\":\"property\",\n \"identifier\":\"report\",\n \"occurred\":new Date().getTime(),\t//时间戳,设备上的事件或数据产生的本地时间\n \"time\":new Date().getTime(),\t\t//时间戳,消息上报时间\n \"data\":{\n \"rssi\":127-parseInt(Math.random()*127),\n \"power\":parseInt(Math.random()*100),\n\t \"doorStatus\":Math.random()>0.5?1:0\n }\n }\n}", "trigger": "random", "triggerExpression": "minute", "state": "running", "createAt": 1653759159567 }, { "id": "628fd800fba69e633a972e12", "uid": "1", "name": "开关1", "productKey": "Rf4QSjbm65X45753", "devices": [ "16465723451670abc123000030000011a", "16465723448670abc1230000200000115" ], "type": "thingModel", "script": "\nvar mid=1000;\n\nfunction getMid(){\n mid++;\n if(mid>9999){\n\tmid=1;\n }\n return mid+\"\";\n}\n\nfunction getRequestId(){\n return \"RID\"+new Date().getTime()+getMid();\n}\n\n\nthis.receive=function(service,device){\n return [{\n \"productKey\":service.productKey,\n \"deviceName\":service.deviceName,\n \"mid\":service.mid,\n \"type\":\"service\",\n \"identifier\":\"reboot_reply\",\n \"data\":{},\n \"code\":0\n },{\n \"mid\":getRequestId(),\n \"productKey\":service.productKey, \n \"deviceName\":service.deviceName,\n \"type\":\"property\",\n \"identifier\":\"report\",\n \"occurred\":new Date().getTime(),\n \"time\":new Date().getTime(),\n \"data\":{\n \"volt\":parseInt(Math.random()*100),\n\t \"powerstate\":Math.random()>0.5?1:0\n }\n }]\n}\n\nthis.report=function(device){\n return {\n \"mid\":getRequestId(),\n \"productKey\":device.productKey, \n \"deviceName\":device.deviceName,\n \"type\":\"property\",\n \"identifier\":\"report\",\n \"occurred\":new Date().getTime(),\t//时间戳,设备上的事件或数据产生的本地时间\n \"time\":new Date().getTime(),\t\t//时间戳,消息上报时间\n \"data\":{\n \"volt\":parseInt(Math.random()*100)\n }\n }\n}", "trigger": "cron", "triggerExpression": "0 * * * * ? ", "state": "running", "createAt": 1653594112764 }, { "id": "628fa6bc1b735b73cb260042", "uid": "1", "name": "虚拟插座12", "productKey": "cGCrkK7Ex4FESAwe", "devices": [ "16534030209640test001230100000118", "16514626216250abe1230000200000114", "16514626214280abe1230000100000116", "16538390924670pulg0a001006000012a", "16538390885690pulg0a0010050000126", "16538390853670pulg0a0010040000121", "16538390820760pulg0a0010030000127", "16538390787670pulg0a0010020000124", "16538390738670pulg0a0010010000125", "16552594646210pulg0a0010160000122", "16552594604220pulg0a0010150000127", "16552594572370pulg0a001014000012e", "16552594542310pulg0a0010130000123", "16552594511210pulg0a001012000012c", "16552594475270pulg0a0010110000125", "16552594444210pulg0a0010100000128", "16552594405220pulg0a0010090000124", "16552594368340pulg0a0010080000126", "16552594320310pulg0a0010070000126" ], "type": "thingModel", "script": "\nvar mid=1000;\n\nfunction getMid(){\n mid++;\n if(mid>9999){\n\tmid=1;\n }\n return mid+\"\";\n}\n\nfunction getRequestId(){\n return \"RID\"+new Date().getTime()+getMid();\n}\n\n\nthis.receive=function(service,device){\n var identifier=service.identifier;\n var result= [{\n \"productKey\":service.productKey,\n \"deviceName\":service.deviceName,\n \"mid\":service.mid,\n \"type\":\"service\",\n \"identifier\":identifier+\"_reply\",\n \"data\":{},\n \"code\":0\n }]\n \n if(service.type==\"property\" && (identifier==\"get\" || identifier==\"set\")){\n\tresult.push({\n\t \"mid\":getRequestId(),\n\t \"productKey\":device.productKey, \n\t \"deviceName\":device.deviceName,\n\t \"type\":\"property\",\n\t \"identifier\":\"report\",\n\t \"occurred\":new Date().getTime(),\n\t \"time\":new Date().getTime(),\n\t \"data\":service.params\n\t});\n }\n \n return result;\n}\n\nthis.report=function(device){\n return {\n \"mid\":getRequestId(),\n \"productKey\":device.productKey, \n \"deviceName\":device.deviceName,\n \"type\":\"property\",\n \"identifier\":\"report\",\n \"occurred\":new Date().getTime(),\t//时间戳,设备上的事件或数据产生的本地时间\n \"time\":new Date().getTime(),\t\t//时间戳,消息上报时间\n \"data\":{\n \"rssi\":127-parseInt(Math.random()*127),\n\t \"powerstate\":Math.random()>0.5?1:0\n }\n }\n}", "trigger": "random", "triggerExpression": "second", "state": "running", "createAt": 1653581500076 } ]