设置数据自动上报频率
统一指令:device-timer-interval
配置设备数据的定时上报参数,包括是否上报与上报频率。启用后,设备按设定频率周期上报温湿度等数据至服务器。
向设备发送指令 服务端向设备订阅topic发送消息
{
"messageId" : "202201241610366046",
"timerEnable" : 1,
"timerInterval" : 15,
"type" : "setting"
}
设备返回信息 设备向服务端订阅topic上报消息
{
"code" : "GSTMB1",
"commandName" : "device-timer-interval",
"dhcpEnable" : 1,
"h_compensate" : 0,
"ip" : "192.168.122.119",
"mac" : "4CEBD60BFD62",
"messageId" : "202201241610366046",
"signal" : -75,
"source" : "command",
"ssid" : "GemeOpen",
"timerEnable" : 1,
"timerInterval" : 10,
"t_compensate" : 0,
"version" : "1.0.5"
}
获取设备统计信息
统一指令:info-statistic
获取设备采集的环境温度与湿度信息,注意不同的设备数值单位有区别,取决于设备设计的精度
向设备发送指令 服务端向设备订阅topic发送消息
{
"messageId" : "202201241610366046",
"type" : "statistic"
}
设备返回信息 设备向服务端订阅topic上报消息
{
"commandName" : "info-statistic",
"humidity" : 54.45,
"mac" : "4CEBD60BFD62",
"messageId" : "202201241610366046",
"source" : "command",
"temperature" : 28
}