Tài liệu mô tả format publish/subscribe cho các giao thức:
- socket.io
- mqtt
- iot-core
Mọi người cần chỉnh sửa thì fork project > modify > pull request
Edit bằng vscode tabsize=2
sử dụng "Preview to the side" option
(góc trên bên phải) để preview
-
mqtt + iot-core
${prefix}/{object}
-
socket.io
{object}
-
iot-core
arn:aws:iot:${AWS_REGION}:${accountArn}:topic/${provider}/${GatewayUid}
-
mqtt
${provider}/${GatewayUid}
-
rest
${host}/rest
-
socket.io
None
- mqtt + iot-core
JSON || Buffer
- socket.io
Object
- parse
if( data instanceof Buffer || typeof data === 'string') { payload = JSON.parse(payload) }
-
Event /devices
- payload
{ "devices": [ {"nodeId":"0x8307","deviceState":16,"deviceType":"0x0103","timeSinceLastMessage":47,"deviceEndpoint":{"eui64":"0x000B57FFFE4F4F12","endpoint":2,"clusterInfo":[{"clusterId":"0x0000","clusterType":"In"},{"clusterId":"0x0003","clusterType":"In"},{"clusterId":"0x0003","clusterType":"Out"},{"clusterId":"0x0006","clusterType":"Out"}]},"hash":"0x000B57FFFE4F4F12-2","gatewayEui":"000B57FFFE51B5A5","sleepyDevice":false,"otaUpdating":false,"otaTotalBytesSent":0,"otaUpdatePercent":0,"otaTargetImageSizeKB":0,"otaTargetFirmwareVersion":0,"supportsRelay":true,"supportedCluster":[{"clusterId":"0x0006","clusterType":"In"}]} ] }
-
Event /heartbeat
{ "networkUp":true,"networkPanId":"0x43DC","radioTxPower":20,"radioChannel":14,"gatewayEui":"000B57FFFE51B5A5" }
-
Event /relays
{}
-
Event /gatewaysettings
{ "ncpStackVersion":"6.5.0-188","networkUp":true,"networkPanId":"0x43DC","radioTxPower":20,"radioChannel":14 }
-
Event /serversettings
{ "ip":"10.42.0.1","otaInProgress":false,"customerTesting":false,"logStreaming":false,"cliTerminal":false,"testNumber":1 }
-
Device control
-
lighton/lightoff/lighttoggle
{ "type":"lighton", "deviceTableIndex": {}} }
{ "type":"lighton", "deviceEndpoint": {}} }
-
setlightlevel
{ "type":"setlightlevel", "deviceTableIndex": {}} }
{ "type":"setlightlevel", "deviceEndpoint": {}} }
-
setlightcolortemp
{ "type":"setlightcolortemp", "deviceTableIndex": {}} }
{ "type":"setlightcolortemp", "deviceEndpoint": {}} }
-
-
Device add
-
permitjoinZB3OpenNetworkOnly
{ "type":"permitjoinZB3OpenNetworkOnly", "delayMs": "number" }
-
-
Relay/Rule
-
addrelay/deleterelay
{ "type":"addrelay", "inDeviceInfo": {}, "outDeviceInfo": {} }
-
addcloudrule/deletecloudrule
{ "type":"addcloudrule", "inDeviceInfo": {}, "outDeviceInfo": {} }
-
clearrelays
{ "type":"clearrelays" }
-
clearcloudrules
{ "type":"clearcloudrules" }
-
servermessage: addgroup
{ "type":"addgroup", "group": {"devices": ["group1", "group2"]} }
-
servermessage: removegroup
{ "type":"removegroup", "groupName": "group1" }
-
-
Gateway
-
requestgatewaystate
{ "type": "requestgatewaystate" }
-
loadgatewaylog
{ "type": "loadgatewaylog" }
-