GemeOpen
写几行代码,就可以控制的智能设备!
智能温湿度传感器开发者文档
产品型号:GSTMB1
产品概要信息
基本描述
工业级温湿度采集,DC供电,稳定可靠精度高
主要特点
WiFi/以太网双网络模式,
定时上报数据
定时上报数据
产品图片
技术支持
企业微信扫一扫
武汉智鸟科技有限责任公司
企业官网:www.smart-bird.cn
服务热线:130-0715-9689
办公地址:湖北省武汉市高新大道光谷崇文中心B1栋1401、1409
控制采集
设置数据自动上报频率
device-timer-interval
指令简介
配置设备数据的定时上报参数,包括是否上报与上报频率。启用后,设备按设定频率周期上报温湿度等数据至服务器。
向设备发送指令
服务端向设备订阅topic发送消息
{
"messageId" : "202201241610366046",
"timerEnable" : 1,
"timerInterval" : 15,
"type" : "setting"
}
"messageId" : "202201241610366046",
"timerEnable" : 1,
"timerInterval" : 15,
"type" : "setting"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | messageId | String | 消息ID字段 | 202201241610366046 |
| 2 | timerEnable | int | 设备温湿度信息定时上报状态,0:关闭;1:开启 | 1 |
| 3 | timerInterval | int | 温湿度信息上报时间间隔(单位秒),取值范围5-86400 | 15 |
| 4 | type | String | 设备设置固定传"setting" | 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"
}
"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"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | code | String | 设备型号代码 | GSTMB1 |
| 2 | commandName | String | 指令名称 | device-timer-interval |
| 3 | dhcpEnable | int | 自动寻址1:开启, 0:关闭,默认开启 | 1 |
| 4 | h_compensate | float | 湿度补偿(单位:%)[范围-20至+20] | 0 |
| 5 | ip | String | 设备连接WIFI后获取的IP | 192.168.122.119 |
| 6 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| 7 | messageId | String | 消息ID字段 | 202201241610366046 |
| 8 | signal | int | 信号强度,显示规则为: signal<= 0 && signal>= -50 //信号最好 signal< -50 && signal>= -70 //信号较好 signal< -70 && signal>= -80 //信号一般 signal<-80 && signal>= -100 //信号较差 signal没有在0~(-100)之间,表示无信号 | -75 |
| 9 | source | String | 指令回复“command" | command |
| 10 | ssid | String | 设备当前连接的WIFI名称 | GemeOpen |
| 11 | timerEnable | int | 设备温湿度信息定时上报状态,0:关闭;1:开启 | 1 |
| 12 | timerInterval | int | 温湿度信息上报时间间隔(单位秒),取值范围5-86400 | 10 |
| 13 | t_compensate | float | 温度补偿(单位:摄氏度)[范围-20至+20] | 0 |
| 14 | version | String | 当前固件版本号 | 1.0.5 |
查看数据自动上报格式
device-timer-task
指令简介
查看设备定时上报数据的 JSON 格式,供服务器端对接解析设备上报的数据。是否上报与上报频率由"设置数据定时上报频率"指令配置,配置后设备按周期将数据发布至约定主题(topic),设备端无订阅行为(仅发布),服务端订阅该发布主题后即可接收上报数据。
向设备发送指令
服务端向设备订阅topic发送消息
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|
设备返回信息
设备向服务端订阅topic上报消息
{
"commandName" : "device-timer-interval",
"humidity" : 54.45,
"mac" : "4CEBD60BFD62",
"messageId" : "20260520",
"source" : "command",
"temperature" : 28
}
"commandName" : "device-timer-interval",
"humidity" : 54.45,
"mac" : "4CEBD60BFD62",
"messageId" : "20260520",
"source" : "command",
"temperature" : 28
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | commandName | String | 指令名称 | device-timer-interval |
| 2 | humidity | float | 湿度 (单位:%) | 54.45 |
| 3 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| 4 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 5 | source | String | 指令回复“command" | command |
| 6 | temperature | float | 温度 (单位:摄氏度) | 28 |
获取设备基础信息
info-all
指令简介
获取设备信息一般会包含:设备通断电状态、MAC/IMEI、固件版本、设备内网IP地址、设备WIFI网络名称等信息,不同的产品返回的信息有所差异
向设备发送指令
服务端向设备订阅topic发送消息
{
"messageId" : "202201241610366046",
"type" : "info"
}
"messageId" : "202201241610366046",
"type" : "info"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | messageId | String | 消息ID字段 | 202201241610366046 |
| 2 | type | String | 设备设置固定传"info" | info |
设备返回信息
设备向服务端订阅topic上报消息
{
"code" : "GSTMB1",
"commandName" : "info-all",
"h_compensate" : 0,
"ip" : "192.168.122.119",
"mac" : "4CEBD60BFD62",
"messageId" : "202201241610366046",
"signal" : -75,
"source" : "command",
"ssid" : "GemeOpen",
"timerEnable" : 1,
"timerInterval" : 15,
"t_compensate" : 0,
"version" : "1.0.5"
}
"code" : "GSTMB1",
"commandName" : "info-all",
"h_compensate" : 0,
"ip" : "192.168.122.119",
"mac" : "4CEBD60BFD62",
"messageId" : "202201241610366046",
"signal" : -75,
"source" : "command",
"ssid" : "GemeOpen",
"timerEnable" : 1,
"timerInterval" : 15,
"t_compensate" : 0,
"version" : "1.0.5"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | code | String | 设备型号代码 | GSTMB1 |
| 2 | commandName | String | 指令名称 | info-all |
| 3 | h_compensate | float | 湿度补偿(单位:%)[范围-20至+20] | 0 |
| 4 | ip | String | 设备连接WIFI后获取的IP | 192.168.122.119 |
| 5 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| 6 | messageId | String | 消息ID字段 | 202201241610366046 |
| 7 | signal | int | 信号强度,显示规则为: signal<= 0 && signal>= -50 //信号最好 signal< -50 && signal>= -70 //信号较好 signal< -70 && signal>= -80 //信号一般 signal<-80 && signal>= -100 //信号较差 signal没有在0~(-100)之间,表示无信号 | -75 |
| 8 | source | String | 指令回复“command" | command |
| 9 | ssid | String | 设备当前连接的WIFI名称 | GemeOpen |
| 10 | timerEnable | int | 设备温湿度信息定时上报状态,0:关闭;1:开启 | 1 |
| 11 | timerInterval | int | 温湿度信息上报时间间隔(单位秒),取值范围5-86400 | 15 |
| 12 | t_compensate | float | 温度补偿(单位:摄氏度)[范围-20至+20] | 0 |
| 13 | version | String | 当前固件版本号 | 1.0.5 |
获取设备统计信息
info-statistic
指令简介
获取设备采集的环境温度与湿度信息,注意不同的设备数值单位有区别,取决于设备设计的精度
向设备发送指令
服务端向设备订阅topic发送消息
{
"messageId" : "202201241610366046",
"type" : "statistic"
}
"messageId" : "202201241610366046",
"type" : "statistic"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | messageId | String | 消息ID字段 | 202201241610366046 |
| 2 | type | String | 获取设备温湿度信息固定传"statistic" | statistic |
设备返回信息
设备向服务端订阅topic上报消息
{
"commandName" : "info-statistic",
"humidity" : 54.45,
"mac" : "4CEBD60BFD62",
"messageId" : "202201241610366046",
"source" : "command",
"temperature" : 28
}
"commandName" : "info-statistic",
"humidity" : 54.45,
"mac" : "4CEBD60BFD62",
"messageId" : "202201241610366046",
"source" : "command",
"temperature" : 28
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | commandName | String | 指令名称 | info-statistic |
| 2 | humidity | float | 湿度 (单位:%) | 54.45 |
| 3 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| 4 | messageId | String | 消息ID字段 | 202201241610366046 |
| 5 | source | String | 指令回复“command" | command |
| 6 | temperature | float | 温度 (单位:摄氏度) | 28 |
设备维护
重置设备
controller-reset
指令简介
恢复出厂设置后配网信息和自定义信息都会清空,请谨慎操作!
向设备发送指令
服务端向设备订阅topic发送消息
{
"messageId" : "20260520",
"system" : "reset",
"type" : "setting"
}
"messageId" : "20260520",
"system" : "reset",
"type" : "setting"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 2 | system | String | 重置/恢复出厂设置默认填"reset" | reset |
| 3 | type | String | 设备设置固定传"setting" | setting |
设备返回信息
设备向服务端订阅topic上报消息
{
"commandName" : "controller-reset",
"mac" : "4CEBD60BFD62",
"message" : "ok",
"messageId" : "20260520",
"source" : "command",
"success" : true
}
"commandName" : "controller-reset",
"mac" : "4CEBD60BFD62",
"message" : "ok",
"messageId" : "20260520",
"source" : "command",
"success" : true
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | commandName | String | 指令名称 | controller-reset |
| 2 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| 3 | message | String | 执行返回结果 | ok |
| 4 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 5 | source | String | 指令回复“command" | command |
| 6 | success | boolean | 执行结果 | true |
重启设备
controller-restart
指令简介
软重启后,通过指令设置的参数将生效,同时设备将重新连接Wifi/4G网络,注意设备IP地址可能发生变化
向设备发送指令
服务端向设备订阅topic发送消息
{
"messageId" : "20260520",
"system" : "restart",
"type" : "setting"
}
"messageId" : "20260520",
"system" : "restart",
"type" : "setting"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 2 | system | String | 重置/恢复出厂设置默认填"restart" | restart |
| 3 | type | String | 设备设置固定传"setting" | setting |
设备返回信息
设备向服务端订阅topic上报消息
{
"commandName" : "controller-restart",
"mac" : "4CEBD60BFD62",
"message" : "ok",
"messageId" : "20260520",
"source" : "command",
"success" : true
}
"commandName" : "controller-restart",
"mac" : "4CEBD60BFD62",
"message" : "ok",
"messageId" : "20260520",
"source" : "command",
"success" : true
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | commandName | String | 指令名称 | controller-restart |
| 2 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| 3 | message | String | 执行返回结果 | ok |
| 4 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 5 | source | String | 指令回复“command" | command |
| 6 | success | boolean | 执行结果 | true |
获取设备联网信息
info-connect
指令简介
获取设备当前联网模式时WiFi还是以太网,IP地址、子网掩码、网关、DNS
向设备发送指令
服务端向设备订阅topic发送消息
{
"messageId" : "202201241610366046",
"type" : "connect"
}
"messageId" : "202201241610366046",
"type" : "connect"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | messageId | String | 消息ID字段 | 202201241610366046 |
| 2 | type | String | 固定传“connect” | connect |
设备返回信息
设备向服务端订阅topic上报消息
{
"commandName" : "info-connect",
"connMethod" : "ethernet",
"dhcpEnable" : 0,
"dns" : "192.168.0.1",
"gateway" : "192.168.0.1",
"local_ip" : "192.168.0.118",
"mac" : "4CEBD60BFD62",
"source" : "command",
"subnet" : "255.255.255.0"
}
"commandName" : "info-connect",
"connMethod" : "ethernet",
"dhcpEnable" : 0,
"dns" : "192.168.0.1",
"gateway" : "192.168.0.1",
"local_ip" : "192.168.0.118",
"mac" : "4CEBD60BFD62",
"source" : "command",
"subnet" : "255.255.255.0"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | commandName | String | 指令名称 | info-connect |
| 2 | connMethod | String | 网络连接方式wifi或者ethernet | ethernet |
| 3 | dhcpEnable | int | 自动寻址1:开启, 0:关闭,默认开启 | 0 |
| 4 | dns | String | DNS服务器地址 | 192.168.0.1 |
| 5 | gateway | String | 默认网关 | 192.168.0.1 |
| 6 | local_ip | String | IP地址 | 192.168.0.118 |
| 7 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| 8 | source | String | 指令回复“command" | command |
| 9 | subnet | String | 子网掩码 | 255.255.255.0 |
获取设备通讯信息
info-protocol
指令简介
获取当前设备与服务端交互的通信协议及协议配置参数,目前支持MQTT、TCP Client和HTTP Server(固件版本1.1.1以上支持),设备出厂时默认接入GemeOpen厂家MQTT测试服务器,免费提供客户调试使用,如需接入自己的服务器或使用其他协议,请自行搭建服务器。
向设备发送指令
服务端向设备订阅topic发送消息
{
"messageId" : "20260520",
"type" : "protocol"
}
"messageId" : "20260520",
"type" : "protocol"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 2 | type | String | 获取设备通讯协议固定传protocol | protocol |
设备返回信息
设备向服务端订阅topic上报消息
{
"clientId" : "1C6920F083C4",
"commandName" : "info-protocol",
"mac" : "4CEBD60BFD62",
"messageId" : "202201241610366046",
"port" : "1883",
"protocol" : "mqtt",
"publish" : "/KIduUf/mSEiZxMFxOLD/1C6920F083C4/subscribe",
"server" : "mqtt.smart-bird.cn",
"source" : "command",
"subcribe" : "/KIduUf/mSEiZxMFxOLD/1C6920F083C4/publish",
"username" : "mSEiZxMFxOLD"
}
"clientId" : "1C6920F083C4",
"commandName" : "info-protocol",
"mac" : "4CEBD60BFD62",
"messageId" : "202201241610366046",
"port" : "1883",
"protocol" : "mqtt",
"publish" : "/KIduUf/mSEiZxMFxOLD/1C6920F083C4/subscribe",
"server" : "mqtt.smart-bird.cn",
"source" : "command",
"subcribe" : "/KIduUf/mSEiZxMFxOLD/1C6920F083C4/publish",
"username" : "mSEiZxMFxOLD"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | clientId | String | 自定义MQTT客户端ID注意:不可重复 | 1C6920F083C4 |
| 2 | commandName | String | 指令名称 | info-protocol |
| 3 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| 4 | messageId | String | 消息ID字段 | 202201241610366046 |
| 5 | port | String | 端口号 | 1883 |
| 6 | protocol | String | 协议类型,MQTT协议固定传"mqtt" | mqtt |
| 7 | publish | String | 自定义MQTT发布主题 注意:不可重复 | /KIduUf/mSEiZxMFxOLD/1C6920F083C4/subscribe |
| 8 | server | String | 自定义MQTT服务器地址 | mqtt.smart-bird.cn |
| 9 | source | String | 指令回复“command" | command |
| 10 | subcribe | String | 自定义MQTT订阅主题注意:不可重复 | /KIduUf/mSEiZxMFxOLD/1C6920F083C4/publish |
| 11 | username | String | 自定义MQTT服务器用户名 | mSEiZxMFxOLD |
设置设备网络连接方式
setting-connmethod-config
指令简介
设置设备当前联网方式,设备默认出库为WiFi模式,使用以太网需要下发指令切换网络连接方式(固件版本1.1.5以上,在配置页里的其他设置中支持设置网络连接方式和静态IP设置),需要将设备断电重启或者向设备发送重启命令才可生效。
向设备发送指令
服务端向设备订阅topic发送消息
{
"connMethod" : "ethernet",
"dhcpEnable" : 0,
"dns" : "192.168.0.1",
"gateway" : "192.168.0.1",
"local_ip" : "192.168.0.118",
"messageId" : "202201241610366046",
"password" : "123456",
"ssid" : "GemeOpen",
"subnet" : "255.255.255.0",
"type" : "setting"
}
"connMethod" : "ethernet",
"dhcpEnable" : 0,
"dns" : "192.168.0.1",
"gateway" : "192.168.0.1",
"local_ip" : "192.168.0.118",
"messageId" : "202201241610366046",
"password" : "123456",
"ssid" : "GemeOpen",
"subnet" : "255.255.255.0",
"type" : "setting"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | connMethod | String | 网络连接方式wifi或者ethernet | ethernet |
| 2 | dhcpEnable | int | 自动寻址1:开启, 0:关闭,默认开启 | 0 |
| 3 | dns | String | DNS服务器地址,dhcp关闭才有该字段 | 192.168.0.1 |
| 4 | gateway | String | 默认网关,dhcp关闭才有该字段 | 192.168.0.1 |
| 5 | local_ip | String | 静态ip,dhcp关闭才有该字段 | 192.168.0.118 |
| 6 | messageId | String | 消息ID字段 | 202201241610366046 |
| 7 | password | String | 设置wifi密码,网络连接方式wifi才有该字段 | 123456 |
| 8 | ssid | String | 设置wifi名称,网络连接方式wifi才有该字段 | GemeOpen |
| 9 | subnet | String | 子网掩码,dhcp关闭才有该字段 | 255.255.255.0 |
| 10 | type | String | 设备设置固定传"setting" | setting |
设备返回信息
设备向服务端订阅topic上报消息
{
"commandName" : "setting-connMethod-config",
"mac" : "4CEBD60BFD62",
"message" : "ok",
"messageId" : "202201241610366046",
"source" : "command",
"success" : true
}
"commandName" : "setting-connMethod-config",
"mac" : "4CEBD60BFD62",
"message" : "ok",
"messageId" : "202201241610366046",
"source" : "command",
"success" : true
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | commandName | String | 指令名称 | setting-connMethod-config |
| 2 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| 3 | message | String | 执行返回结果 | ok |
| 4 | messageId | String | 消息ID字段 | 202201241610366046 |
| 5 | source | String | 指令回复“command" | command |
| 6 | success | boolean | 执行结果 | true |
自定义HTTP
setting-http
指令简介
用于配置http回调地址,用来设备事件推送地址,注意不支持https
向设备发送指令
服务端向设备订阅topic发送消息
{
"maxRetry" : 3,
"messageId" : "20260520",
"protocol" : "http",
"type" : "custom",
"url" : "http://192.168.0.63:8080"
}
"maxRetry" : 3,
"messageId" : "20260520",
"protocol" : "http",
"type" : "custom",
"url" : "http://192.168.0.63:8080"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | maxRetry | int | 重试次数 | 3 |
| 2 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 3 | protocol | String | 协议类型 | http |
| 4 | type | String | 设备自定义固定传"custom" | custom |
| 5 | url | String | 回调地址 | http://192.168.0.63:8080 |
设备返回信息
设备向服务端订阅topic上报消息
{
"commandName" : "setting-http",
"mac" : "4CEBD60BFD62",
"messageId" : "20260520",
"protocol" : "http",
"source" : "command",
"url" : "http://192.168.0.168:8080"
}
"commandName" : "setting-http",
"mac" : "4CEBD60BFD62",
"messageId" : "20260520",
"protocol" : "http",
"source" : "command",
"url" : "http://192.168.0.168:8080"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | commandName | String | 指令名称 | setting-http |
| 2 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| 3 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 4 | protocol | String | 协议类型 | http |
| 5 | source | String | 指令回复“command" | command |
| 6 | url | String | 回调地址 | http://192.168.0.168:8080 |
设置温湿度参数补偿
setting-humidity-compensate
指令简介
设置温度和湿度的补偿值,用于校准传感器采集数据的偏差。
向设备发送指令
服务端向设备订阅topic发送消息
{
"h_compensate" : 0,
"messageId" : "20260520",
"type" : "setting",
"t_compensate" : 0
}
"h_compensate" : 0,
"messageId" : "20260520",
"type" : "setting",
"t_compensate" : 0
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | h_compensate | float | 湿度补偿(单位:%)[范围-20至+20] | 0 |
| 2 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 3 | type | String | 设备设置固定值"setting" | setting |
| 4 | t_compensate | float | 温度补偿(单位:摄氏度)[范围-20至+20] | 0 |
设备返回信息
设备向服务端订阅topic上报消息
{
"code" : "GSTMB1",
"commandName" : "setting-humidity-compensate",
"dhcpEnable" : 1,
"h_compensate" : 0,
"ip" : "192.168.122.119
",
"mac" : "2026bb16aa14",
"messageId" : "20260520",
"signal" : -75,
"source" : "command",
"ssid" : "gemeopen",
"timerEnable" : 1,
"timerInterval" : 15,
"type" : "setting",
"t_compensate" : 0,
"version" : "1.0.0"
}
"code" : "GSTMB1",
"commandName" : "setting-humidity-compensate",
"dhcpEnable" : 1,
"h_compensate" : 0,
"ip" : "192.168.122.119
",
"mac" : "2026bb16aa14",
"messageId" : "20260520",
"signal" : -75,
"source" : "command",
"ssid" : "gemeopen",
"timerEnable" : 1,
"timerInterval" : 15,
"type" : "setting",
"t_compensate" : 0,
"version" : "1.0.0"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | code | String | 设备型号代码 | GSTMB1 |
| 2 | commandName | String | 指令名称 | setting-humidity-compensate |
| 3 | dhcpEnable | int | 自动寻址1:开启, 0:关闭,默认开启 | 1 |
| 4 | h_compensate | float | 湿度补偿(单位:%)[范围-20至+20] | 0 |
| 5 | ip | String | 设备连接WIFI后获取的IP | 192.168.122.119 |
| 6 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 2026bb16aa14 |
| 7 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 8 | signal | int | 信号强度,显示规则为: signal<= 0 && signal>= -50 //信号最好 signal< -50 && signal>= -70 //信号较好 signal< -70 && signal>= -80 //信号一般 signal<-80 && signal>= -100 //信号较差 signal没有在0~(-100)之间,表示无信号 | -75 |
| 9 | source | String | 指令回复“command" | command |
| 10 | ssid | String | 设备当前连接的WIFI名称 | gemeopen |
| 11 | timerEnable | int | 设备统计信息定时上报状态,0:关闭;1:开启 | 1 |
| 12 | timerInterval | int | 设备统计信息上报时间间隔(单位秒),取值范围5-86400 | 15 |
| 13 | type | String | 设备设置固定值"setting" | setting |
| 14 | t_compensate | float | 温度补偿(单位:摄氏度)[范围-20至+20] | 0 |
| 15 | version | String | 当前固件版本号 | 1.0.0 |
自定义MQTT
setting-mqtt
指令简介
设备支持自定义MQTT,注意:在通过MQTT自定义MQTT信息后,需要将设备断电重启或者向设备发送重启命令才可生效。
向设备发送指令
服务端向设备订阅topic发送消息
{
"clientId" : "custom",
"messageId" : "20260520",
"password" : "password",
"port" : "1883",
"protocol" : "mqtt",
"publish" : "/topic/qos0",
"server" : "192.168.0.66",
"subcribe" : "/topic/qos1",
"type" : "custom",
"username" : "username"
}
"clientId" : "custom",
"messageId" : "20260520",
"password" : "password",
"port" : "1883",
"protocol" : "mqtt",
"publish" : "/topic/qos0",
"server" : "192.168.0.66",
"subcribe" : "/topic/qos1",
"type" : "custom",
"username" : "username"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | clientId | String | 自定义MQTT客户端ID注意:不可重复 | custom |
| 2 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 3 | password | String | 密码 | password |
| 4 | port | String | 端口号 | 1883 |
| 5 | protocol | String | 协议类型,MQTT协议固定传"mqtt" | mqtt |
| 6 | publish | String | 自定义MQTT发布主题 注意:不可重复 | /topic/qos0 |
| 7 | server | String | 自定义MQTT服务器地址 | 192.168.0.66 |
| 8 | subcribe | String | 自定义订阅主题,注意:不可重复 | /topic/qos1 |
| 9 | type | String | 设备自定义固定传"custom" | custom |
| 10 | username | String | 自定义MQTT服务器用户名 | username |
设备返回信息
设备向服务端订阅topic上报消息
{
"clientId" : "custom",
"commandName" : "setting-mqtt",
"mac" : "4CEBD60BFD62",
"messageId" : "20260520",
"password" : "password",
"port" : "1883",
"protocol" : "mqtt",
"publish" : "/topic/qos0",
"server" : "192.168.0.66",
"source" : "command",
"subcribe" : "/topic/qos1",
"username" : "username"
}
"clientId" : "custom",
"commandName" : "setting-mqtt",
"mac" : "4CEBD60BFD62",
"messageId" : "20260520",
"password" : "password",
"port" : "1883",
"protocol" : "mqtt",
"publish" : "/topic/qos0",
"server" : "192.168.0.66",
"source" : "command",
"subcribe" : "/topic/qos1",
"username" : "username"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | clientId | String | 自定义MQTT客户端ID注意:不可重复 | custom |
| 2 | commandName | String | 指令名称 | setting-mqtt |
| 3 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| 4 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 5 | password | String | 密码 | password |
| 6 | port | String | 端口号 | 1883 |
| 7 | protocol | String | 协议类型 | mqtt |
| 8 | publish | String | 自定义发布主题 注意:不可重复 | /topic/qos0 |
| 9 | server | String | 自定义服务器地址 | 192.168.0.66 |
| 10 | source | String | 指令回复“command" | command |
| 11 | subcribe | String | 自定义订阅主题,注意:不可重复 | /topic/qos1 |
| 12 | username | String | 自定义服务器用户名 | username |
自定义TCP
setting-tcp
指令简介
设备支持通过MQTT方式自定义TCP信息,注意:通过MQTT自定义TCP信息后,需要将设备断电重启或者向设备发送重启命令才可生效。
向设备发送指令
服务端向设备订阅topic发送消息
{
"messageId" : "20260520",
"port" : "8080",
"protocol" : "tcp",
"server" : "192.168.0.66",
"type" : "custom"
}
"messageId" : "20260520",
"port" : "8080",
"protocol" : "tcp",
"server" : "192.168.0.66",
"type" : "custom"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 2 | port | String | 端口号 | 8080 |
| 3 | protocol | String | 协议类型 | tcp |
| 4 | server | String | 自定义服务器地址 | 192.168.0.66 |
| 5 | type | String | 设备自定义固定传"custom" | custom |
设备返回信息
设备向服务端订阅topic上报消息
{
"commandName" : "setting-tcp",
"mac" : "4CEBD60BFD62",
"messageId" : "20260520",
"port" : "8080",
"protocol" : "tcp",
"server" : "192.168.0.66",
"source" : "command"
}
"commandName" : "setting-tcp",
"mac" : "4CEBD60BFD62",
"messageId" : "20260520",
"port" : "8080",
"protocol" : "tcp",
"server" : "192.168.0.66",
"source" : "command"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | commandName | String | 指令名称 | setting-tcp |
| 2 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| 3 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 4 | port | String | 端口号 | 8080 |
| 5 | protocol | String | 协议类型 | tcp |
| 6 | server | String | 自定义服务器地址 | 192.168.0.66 |
| 7 | source | String | 指令回复“command" | command |









