GemeOpen
写几行代码,就可以控制的智能设备!
智能红外控制器 S2开发者文档
产品型号:GSCU2B
产品概要信息
基本描述
内置红外接收管、5-24V供电、外接红外发射器、外接温度传感器、红蓝双色灯
主要特点
一款小巧的方便隐藏安装的红外遥控器……
产品图片
技术支持
企业微信扫一扫
武汉智鸟科技有限责任公司
企业官网:www.smart-bird.cn
服务热线:130-0715-9689
办公地址:湖北省武汉市高新大道光谷崇文中心B1栋1401、1409
全部指令
controller-infrared-emit
指令简介
向设备发送指令
服务端向设备订阅topic发送消息
{
"action" : "emit",
"data" :
{
"no" : 110
},
"messageId" : "20260520",
"type" : "infrared"
}
"action" : "emit",
"data" :
{
"no" : 110
},
"messageId" : "20260520",
"type" : "infrared"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | action | String | 学习红外码指令默认填"emit" | emit |
| 2 | data | Object | 数据 | |
| 3 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 4 | no | int | 红外码编号,编号范围0~127 | 110 |
| 5 | type | String | 固定值"infrared" | infrared |
设备返回信息
设备向服务端订阅topic上报消息
{
"commandName" : "controller-infrared-emit",
"mac" : "2026bb16aa14",
"message" : "ok",
"messageId" : "20260520",
"no" : 110,
"source" : "command",
"success" : true
}
"commandName" : "controller-infrared-emit",
"mac" : "2026bb16aa14",
"message" : "ok",
"messageId" : "20260520",
"no" : 110,
"source" : "command",
"success" : true
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | commandName | String | 指令名称 | controller-infrared-emit |
| 2 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 2026bb16aa14 |
| 3 | message | String | 执行返回结果,若红外码不存在,则信息为“Infrared data does not exist” | ok |
| 4 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 5 | no | int | 红外码编号,编号范围0~127 | 110 |
| 6 | source | String | 指令回复“command" | command |
| 7 | success | boolean | 执行结果 | true |
controller-infrared-erase
指令简介
向设备发送指令
服务端向设备订阅topic发送消息
{
"action" : "erase",
"messageId" : "20260520",
"type" : "infrared"
}
"action" : "erase",
"messageId" : "20260520",
"type" : "infrared"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | action | String | 擦除红外码指令默认填"erase" | erase |
| 2 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 3 | type | String | 固定值"infrared" | infrared |
设备返回信息
设备向服务端订阅topic上报消息
{
"commandName" : "controller-infrared-erase",
"mac" : "2026bb16aa14",
"message" : "ok",
"messageId" : "20260520",
"source" : "command",
"success" : true
}
"commandName" : "controller-infrared-erase",
"mac" : "2026bb16aa14",
"message" : "ok",
"messageId" : "20260520",
"source" : "command",
"success" : true
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | commandName | String | 指令名称 | controller-infrared-erase |
| 2 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 2026bb16aa14 |
| 3 | message | String | 执行返回结果 | ok |
| 4 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 5 | source | String | 指令回复“command" | command |
| 6 | success | boolean | 执行结果 | true |
controller-infrared-learn
指令简介
向设备发送指令
服务端向设备订阅topic发送消息
{
"action" : "learn",
"data" :
{
"no" : 110
},
"messageId" : "20260520",
"type" : "infrared"
}
"action" : "learn",
"data" :
{
"no" : 110
},
"messageId" : "20260520",
"type" : "infrared"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | action | String | 学习红外码指令默认填"learn" | learn |
| 2 | data | Object | 数据 | |
| 3 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 4 | no | int | 红外码编号,编号范围0~127 | 110 |
| 5 | type | String | 固定值"infrared" | infrared |
设备返回信息
设备向服务端订阅topic上报消息
{
"commandName" : "controller-infrared-learn",
"mac" : "2026bb16aa14",
"message" : "ok",
"messageId" : "20260520",
"no" : 110,
"source" : "command",
"success" : true
}
"commandName" : "controller-infrared-learn",
"mac" : "2026bb16aa14",
"message" : "ok",
"messageId" : "20260520",
"no" : 110,
"source" : "command",
"success" : true
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | commandName | String | 指令名称 | controller-infrared-learn |
| 2 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 2026bb16aa14 |
| 3 | message | String | 执行返回结果,若超时失败(未学习到,20s超时)则信息为“time out of learning” | ok |
| 4 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 5 | no | int | 红外码编号,编号范围0~127 | 110 |
| 6 | source | String | 指令回复“command" | command |
| 7 | success | boolean | 执行结果 | true |
取消学习指令
controller-infrared-learn-cancel
指令简介
取消学习指令
向设备发送指令
服务端向设备订阅topic发送消息
{
"action" : "learnCancel",
"messageId" : "20260520",
"type" : "infrared"
}
"action" : "learnCancel",
"messageId" : "20260520",
"type" : "infrared"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | action | String | 取消学习红外码指令默认填"learnCancel" | learnCancel |
| 2 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 3 | type | String | 固定值"infrared" | infrared |
设备返回信息
设备向服务端订阅topic上报消息
{
"commandName" : "controller-infrared-learn-cancel",
"mac" : "2026bb16aa14",
"message" : "ok",
"messageId" : "20260520",
"source" : "command",
"success" : true
}
"commandName" : "controller-infrared-learn-cancel",
"mac" : "2026bb16aa14",
"message" : "ok",
"messageId" : "20260520",
"source" : "command",
"success" : true
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | commandName | String | 指令名称 | controller-infrared-learn-cancel |
| 2 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 2026bb16aa14 |
| 3 | message | String | 执行返回结果 | ok |
| 4 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 5 | source | String | 指令回复“command" | command |
| 6 | success | boolean | 执行结果 | true |
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" : "2026bb16aa14",
"message" : "ok",
"messageId" : "20260520",
"source" : "command",
"success" : true
}
"commandName" : "controller-reset",
"mac" : "2026bb16aa14",
"message" : "ok",
"messageId" : "20260520",
"source" : "command",
"success" : true
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | commandName | String | 指令名称 | controller-reset |
| 2 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 2026bb16aa14 |
| 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" : "2026bb16aa14",
"message" : "ok",
"messageId" : "20260520",
"source" : "command",
"success" : true
}
"commandName" : "controller-restart",
"mac" : "2026bb16aa14",
"message" : "ok",
"messageId" : "20260520",
"source" : "command",
"success" : true
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | commandName | String | 指令名称 | controller-restart |
| 2 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 2026bb16aa14 |
| 3 | message | String | 执行返回结果 | ok |
| 4 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 5 | source | String | 指令回复“command" | command |
| 6 | success | boolean | 执行结果 | true |
device-timer-interval
指令简介
设置温度定时上报的频率。
向设备发送指令
服务端向设备订阅topic发送消息
{
"messageId" : "20260520",
"timerEnable" : 1,
"timerInterval" : 15,
"type" : "setting"
}
"messageId" : "20260520",
"timerEnable" : 1,
"timerInterval" : 15,
"type" : "setting"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 2 | timerEnable | int | 设备统计信息定时上报状态,0:关闭;1:开启 | 1 |
| 3 | timerInterval | int | 设备统计信息上报时间间隔(单位秒),取值范围5-86400 | 15 |
| 4 | type | String | 设备设置固定值"setting" | setting |
设备返回信息
设备向服务端订阅topic上报消息
{
"commandName" : "device-timer-interval",
"mac" : "2026bb16aa14",
"message" : "ok",
"messageId" : "20260520",
"source" : "command",
"success" : true,
"timerEnable" : 1,
"timerInterval" : 15
}
"commandName" : "device-timer-interval",
"mac" : "2026bb16aa14",
"message" : "ok",
"messageId" : "20260520",
"source" : "command",
"success" : true,
"timerEnable" : 1,
"timerInterval" : 15
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | commandName | String | 指令名称 | device-timer-interval |
| 2 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 2026bb16aa14 |
| 3 | message | String | 执行返回结果 | ok |
| 4 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 5 | source | String | 指令回复“command" | command |
| 6 | success | boolean | 执行结果 | true |
| 7 | timerEnable | int | 设备统计信息定时上报状态,0:关闭;1:开启 | 1 |
| 8 | timerInterval | int | 设备统计信息上报时间间隔(单位秒),取值范围5-86400 | 15 |
自动上报任务(定时上报)
device-timer-task
指令简介
主动上报信息,与设置定时上报任务(device-timer-interval)相关联。未接温度传感器时,上报内容为:{"commandName" : "device-timer-task","mac" : "2026bb16aa14","source" : "auto"}
向设备发送指令
服务端向设备订阅topic发送消息
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|
设备返回信息
设备向服务端订阅topic上报消息
{
"commandName" : "device-timer-task",
"mac" : "2026bb16aa14",
"source" : "auto",
"temperature" : 28
}
"commandName" : "device-timer-task",
"mac" : "2026bb16aa14",
"source" : "auto",
"temperature" : 28
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | commandName | String | 指令名称 | device-timer-task |
| 2 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 2026bb16aa14 |
| 3 | source | String | 指令回复“auto" | auto |
| 4 | temperature | float | 温度 (单位:摄氏度),未接温度传感器时则无该字段 | 28 |
info-all
指令简介
获取设备信息一般会包含:设备通断电状态、MAC/IMEI、固件版本、设备内网IP地址、设备WIFI网络名称等信息,不同的产品返回的信息有所差异
向设备发送指令
服务端向设备订阅topic发送消息
{
"messageId" : "20260520",
"type" : "info"
}
"messageId" : "20260520",
"type" : "info"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 2 | type | String | 固定值"info" | info |
设备返回信息
设备向服务端订阅topic上报消息
{
"bssid" : "742ad779046",
"code" : "GSCU2B",
"commandName" : "info-all",
"ip" : "192.168.122.119",
"mac" : "2026bb16aa14",
"messageId" : "20260520",
"signal" : -75,
"source" : "command",
"ssid" : "gemeopen",
"tempOffset" : 0,
"timerEnable" : 1,
"timerInterval" : 15,
"version" : "1.0.0",
"wifiLock" : 0
}
"bssid" : "742ad779046",
"code" : "GSCU2B",
"commandName" : "info-all",
"ip" : "192.168.122.119",
"mac" : "2026bb16aa14",
"messageId" : "20260520",
"signal" : -75,
"source" : "command",
"ssid" : "gemeopen",
"tempOffset" : 0,
"timerEnable" : 1,
"timerInterval" : 15,
"version" : "1.0.0",
"wifiLock" : 0
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | bssid | String | 路由器 MAC 地址 | 742ad779046 |
| 2 | code | String | 设备型号代码 | GSCU2B |
| 3 | commandName | String | 指令名称 | info-all |
| 4 | ip | String | 设备连接WIFI后获取的IP | 192.168.122.119 |
| 5 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 2026bb16aa14 |
| 6 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 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 | tempOffset | float | 温度补偿偏移值,单位:℃,取值范围:+20~-20; 计算公式:校准后数据=实际读取的数据+tempOffset | 0 |
| 11 | timerEnable | int | 设备统计信息定时上报状态,0:关闭;1:开启 | 1 |
| 12 | timerInterval | int | 设备统计信息上报时间间隔(单位秒),取值范围5-86400 | 15 |
| 13 | version | String | 当前固件版本号 | 1.0.0 |
| 14 | wifiLock | int | 配网锁,0:关闭,1:开启 | 0 |
info-protocol
指令简介
向设备发送指令
服务端向设备订阅topic发送消息
{
"messageId" : "20260520",
"type" : "protocol"
}
"messageId" : "20260520",
"type" : "protocol"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 2 | type | String | 固定值"protocol" | protocol |
设备返回信息
设备向服务端订阅topic上报消息
{
"clientId" : "admin",
"commandName" : "info-protocol",
"mac" : "2026bb16aa14",
"messageId" : "20260520",
"port" : "1883",
"protocol" : "mqtt",
"publish" : "/topic/qos0",
"server" : "192.168.0.66
",
"source" : "command",
"subcribe" : "/topic/qos1
",
"username" : "username"
}
"clientId" : "admin",
"commandName" : "info-protocol",
"mac" : "2026bb16aa14",
"messageId" : "20260520",
"port" : "1883",
"protocol" : "mqtt",
"publish" : "/topic/qos0",
"server" : "192.168.0.66
",
"source" : "command",
"subcribe" : "/topic/qos1
",
"username" : "username"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | clientId | String | 自定义MQTT客户端ID注意:不可重复 | admin |
| 2 | commandName | String | 指令名称 | info-protocol |
| 3 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 2026bb16aa14 |
| 4 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 5 | port | String | 端口号 | 1883 |
| 6 | protocol | String | 协议类型 | mqtt |
| 7 | publish | String | 自定义发布主题 注意:不可重复 | /topic/qos0 |
| 8 | server | String | 自定义服务器地址 | 192.168.0.66 |
| 9 | source | String | 指令回复“command" | command |
| 10 | subcribe | String | 自定义订阅主题,注意:不可重复 | /topic/qos1 |
| 11 | username | String | 自定义服务器用户名 | username |
info-statistic
指令简介
获取设备采集的温度信息
向设备发送指令
服务端向设备订阅topic发送消息
{
"messageId" : "20260520",
"type" : "statistic"
}
"messageId" : "20260520",
"type" : "statistic"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 2 | type | String | 固定值"statistic" | statistic |
设备返回信息
设备向服务端订阅topic上报消息
{
"commandName" : "info-statistic",
"mac" : "2026bb16aa14",
"message" : "ok",
"messageId" : "20260520",
"source" : "command",
"success" : true,
"temperature" : 28
}
"commandName" : "info-statistic",
"mac" : "2026bb16aa14",
"message" : "ok",
"messageId" : "20260520",
"source" : "command",
"success" : true,
"temperature" : 28
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | commandName | String | 指令名称 | info-statistic |
| 2 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 2026bb16aa14 |
| 3 | message | String | 执行返回结果 | ok |
| 4 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 5 | source | String | 指令回复“command" | command |
| 6 | success | boolean | 执行结果 | true |
| 7 | temperature | float | 温度 (单位:摄氏度) | 28 |
ir_read
指令简介
向设备发送指令
服务端向设备订阅topic发送消息
{
"action" : "ir_read",
"data" :
{
"no" : 110
},
"messageId" : "20260520",
"type" : "infrared"
}
"action" : "ir_read",
"data" :
{
"no" : 110
},
"messageId" : "20260520",
"type" : "infrared"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | action | String | 读取红外码指令默认填"ir_read" | ir_read |
| 2 | data | Object | 数据 | |
| 3 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 4 | no | int | 红外码编号,编号范围0~127 | 110 |
| 5 | type | String | 固定值"infrared" | infrared |
设备返回信息
设备向服务端订阅topic上报消息
{
"commandName" : "controller-infrared-read",
"ir_data" : "e80200004e1a138d530340834e03cd89520341834e0341834f0340834e0342834e0342834d0342834d0342834e0342834d0341834e0341834d0342834f03cd895103418340834e03cd89520341834e0341834f0340834e0342834e0342834d0342834d0342834e0342834d0341834e0341834d0342834f03cd895103418340834e03cd89520341834e0341834f0340834e0342834e0342834d0342834d0342834e0342834d0341834e0341834d0342834f03cd8951034183",
"mac" : "2026bb16aa14",
"message" : "ok",
"messageId" : "20260520",
"no" : 110,
"source" : "command",
"success" : true
}
"commandName" : "controller-infrared-read",
"ir_data" : "e80200004e1a138d530340834e03cd89520341834e0341834f0340834e0342834e0342834d0342834d0342834e0342834d0341834e0341834d0342834f03cd895103418340834e03cd89520341834e0341834f0340834e0342834e0342834d0342834d0342834e0342834d0341834e0341834d0342834f03cd895103418340834e03cd89520341834e0341834f0340834e0342834e0342834d0342834d0342834e0342834d0341834e0341834d0342834f03cd8951034183",
"mac" : "2026bb16aa14",
"message" : "ok",
"messageId" : "20260520",
"no" : 110,
"source" : "command",
"success" : true
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | commandName | String | 指令名称 | controller-infrared-read |
| 2 | ir_data | String | 红外码数据 | e80200004e1a138d530340834e03cd89520341834e0341834f0340834e0342834e0342834d0342834d0342834e0342834d0341834e0341834d0342834f03cd895103418340834e03cd89520341834e0341834f0340834e0342834e0342834d0342834d0342834e0342834d0341834e0341834d0342834f03cd895103418340834e03cd89520341834e0341834f0340834e0342834e0342834d0342834d0342834e0342834d0341834e0341834d0342834f03cd8951034183 |
| 3 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 2026bb16aa14 |
| 4 | message | String | 执行返回结果,若该地址上还没有学习,读取失败,则返回"Infrared data does not exist" | ok |
| 5 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 6 | no | int | 红外码编号,编号范围0~127 | 110 |
| 7 | source | String | 指令回复“command" | command |
| 8 | success | boolean | 执行结果 | true |
ir_write
指令简介
向设备发送指令
服务端向设备订阅topic发送消息
{
"action" : "ir_write",
"ir_data" : "e80200004e1a138d530340834e03cd89520341834e0341834f0340834e0342834e0342834d0342834d0342834e0342834d0341834e0341834d0342834f03cd895103418340834e03cd89520341834e0341834f0340834e0342834e0342834d0342834d0342834e0342834d0341834e0341834d0342834f03cd895103418340834e03cd89520341834e0341834f0340834e0342834e0342834d0342834d0342834e0342834d0341834e0341834d0342834f03cd8951034183",
"messageId" : "20260520",
"no" : 110,
"type" : "infrared"
}
"action" : "ir_write",
"ir_data" : "e80200004e1a138d530340834e03cd89520341834e0341834f0340834e0342834e0342834d0342834d0342834e0342834d0341834e0341834d0342834f03cd895103418340834e03cd89520341834e0341834f0340834e0342834e0342834d0342834d0342834e0342834d0341834e0341834d0342834f03cd895103418340834e03cd89520341834e0341834f0340834e0342834e0342834d0342834d0342834e0342834d0341834e0341834d0342834f03cd8951034183",
"messageId" : "20260520",
"no" : 110,
"type" : "infrared"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | action | String | 写入红外码指令默认填"learn" | ir_write |
| 2 | ir_data | String | 红外码数据 | e80200004e1a138d530340834e03cd89520341834e0341834f0340834e0342834e0342834d0342834d0342834e0342834d0341834e0341834d0342834f03cd895103418340834e03cd89520341834e0341834f0340834e0342834e0342834d0342834d0342834e0342834d0341834e0341834d0342834f03cd895103418340834e03cd89520341834e0341834f0340834e0342834e0342834d0342834d0342834e0342834d0341834e0341834d0342834f03cd8951034183 |
| 3 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 4 | no | int | 红外码编号,编号范围0~127 | 110 |
| 5 | type | String | 设备设置固定值"infrared" | infrared |
设备返回信息
设备向服务端订阅topic上报消息
{
"commandName" : "controller-infrared-write",
"mac" : "2026bb16aa14",
"message" : "ok",
"messageId" : "20260520",
"no" : 110,
"source" : "command",
"success" : true
}
"commandName" : "controller-infrared-write",
"mac" : "2026bb16aa14",
"message" : "ok",
"messageId" : "20260520",
"no" : 110,
"source" : "command",
"success" : true
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | commandName | String | 指令名称 | controller-infrared-write |
| 2 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 2026bb16aa14 |
| 3 | message | String | 执行返回结果 | ok |
| 4 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 5 | no | int | 红外码编号,编号范围0~127 | 110 |
| 6 | source | String | 指令回复“command" | command |
| 7 | success | boolean | 执行结果,若不成功,返回:false | true |
setting-mqtt
指令简介
设备支持自定义MQTT,注意:在通过MQTT自定义MQTT信息后,需要将设备断电重启或者向设备发送重启命令才可生效。
向设备发送指令
服务端向设备订阅topic发送消息
{
"clientId" : "admin",
"messageId" : "20260520",
"password" : "123456",
"port" : "1883",
"protocol" : "mqtt",
"publish" : "/topic/qos0",
"server" : "192.168.0.66",
"subcribe" : "/topic/qos1",
"type" : "setting",
"username" : "username
"
}
"clientId" : "admin",
"messageId" : "20260520",
"password" : "123456",
"port" : "1883",
"protocol" : "mqtt",
"publish" : "/topic/qos0",
"server" : "192.168.0.66",
"subcribe" : "/topic/qos1",
"type" : "setting",
"username" : "username
"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | clientId | String | 自定义MQTT客户端ID注意:不可重复 | admin |
| 2 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 3 | password | String | 密码 | 123456 |
| 4 | port | String | 端口号 | 1883 |
| 5 | protocol | String | 协议类型 | mqtt |
| 6 | publish | String | 自定义发布主题 注意:不可重复 | /topic/qos0 |
| 7 | server | String | 自定义服务器地址 | 192.168.0.66 |
| 8 | subcribe | String | 自定义订阅主题,注意:不可重复 | /topic/qos1 |
| 9 | type | String | 设备设置固定值"setting" | setting |
| 10 | username | String | 自定义服务器用户名 | username |
设备返回信息
设备向服务端订阅topic上报消息
{
"clientId" : "admin",
"commandName" : "setting-mqtt",
"mac" : "2026bb16aa14",
"messageId" : "20260520",
"port" : "1883",
"protocol" : "mqtt",
"publish" : "/topic/qos0
",
"server" : "192.168.0.66
",
"source" : "command",
"subcribe" : "/topic/qos1",
"username" : "username"
}
"clientId" : "admin",
"commandName" : "setting-mqtt",
"mac" : "2026bb16aa14",
"messageId" : "20260520",
"port" : "1883",
"protocol" : "mqtt",
"publish" : "/topic/qos0
",
"server" : "192.168.0.66
",
"source" : "command",
"subcribe" : "/topic/qos1",
"username" : "username"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | clientId | String | 自定义MQTT客户端ID注意:不可重复 | admin |
| 2 | commandName | String | 指令名称 | setting-mqtt |
| 3 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 2026bb16aa14 |
| 4 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 5 | port | String | 端口号 | 1883 |
| 6 | protocol | String | 协议类型 | mqtt |
| 7 | publish | String | 自定义发布主题 注意:不可重复 | /topic/qos0 |
| 8 | server | String | 自定义服务器地址 | 192.168.0.66 |
| 9 | source | String | 指令回复“command" | command |
| 10 | subcribe | String | 自定义订阅主题,注意:不可重复 | /topic/qos1 |
| 11 | username | String | 自定义服务器用户名 | username |
setting-tcp
指令简介
设备支持通过MQTT方式自定义TCP信息,注意:通过MQTT自定义TCP信息后,需要将设备断电重启或者向设备发送重启命令才可生效。
向设备发送指令
服务端向设备订阅topic发送消息
{
"messageId" : "20260520",
"port" : "1883",
"protocol" : "tcp",
"server" : "192.168.0.66",
"type" : "setting"
}
"messageId" : "20260520",
"port" : "1883",
"protocol" : "tcp",
"server" : "192.168.0.66",
"type" : "setting"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 2 | port | String | 端口号 | 1883 |
| 3 | protocol | String | 协议类型 | tcp |
| 4 | server | String | 自定义服务器地址 | 192.168.0.66 |
| 5 | type | String | 设备设置固定值"setting" | setting |
设备返回信息
设备向服务端订阅topic上报消息
{
"commandName" : "setting-tcp",
"mac" : "2026bb16aa14",
"messageId" : "20260520",
"port" : "8080",
"protocol" : "tcp",
"server" : "192.168.0.66",
"source" : "command"
}
"commandName" : "setting-tcp",
"mac" : "2026bb16aa14",
"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号,唯一标识 | 2026bb16aa14 |
| 3 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 4 | port | String | 端口号 | 8080 |
| 5 | protocol | String | 协议类型 | tcp |
| 6 | server | String | 自定义服务器地址 | 192.168.0.66 |
| 7 | source | String | 指令回复“command" | command |
setting-temperature-compensate
指令简介
设置温度的补偿值,用于校准传感器采集数据的偏差。
向设备发送指令
服务端向设备订阅topic发送消息
{
"messageId" : "20260520",
"tempOffset" : 0,
"type" : "setting"
}
"messageId" : "20260520",
"tempOffset" : 0,
"type" : "setting"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 2 | tempOffset | float | 温度补偿偏移值,单位:℃,取值范围:+20~-20; 计算公式:校准后数据=实际读取的数据+tempOffset | 0 |
| 3 | type | String | 设备设置固定值"setting" | setting |
设备返回信息
设备向服务端订阅topic上报消息
{
"commandName" : "setting-temperature-compensate",
"mac" : "2026bb16aa14",
"message" : "ok",
"messageId" : "20260520",
"source" : "command",
"success" : true,
"tempOffset" : 0
}
"commandName" : "setting-temperature-compensate",
"mac" : "2026bb16aa14",
"message" : "ok",
"messageId" : "20260520",
"source" : "command",
"success" : true,
"tempOffset" : 0
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | commandName | String | 指令名称 | setting-temperature-compensate |
| 2 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 2026bb16aa14 |
| 3 | message | String | 执行返回结果 | ok |
| 4 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 5 | source | String | 指令回复“command" | command |
| 6 | success | boolean | 执行结果 | true |
| 7 | tempOffset | float | 温度补偿偏移值,单位:℃,取值范围:+20~-20; 计算公式:校准后数据=实际读取的数据+tempOffset | 0 |
设置设备WiFi信息
setting-wifi-config
指令简介
重启才会连接新设置的wifi信息,可支持空密码wifi,无密码wifi时需不填写password字段或password字段为空,示例:"password":"",
向设备发送指令
服务端向设备订阅topic发送消息
{
"bssid" : "742ad779046",
"messageId" : "20260520",
"password" : "123456",
"ssid" : "gemeopen",
"type" : "setting"
}
"bssid" : "742ad779046",
"messageId" : "20260520",
"password" : "123456",
"ssid" : "gemeopen",
"type" : "setting"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | bssid | String | 路由器 MAC 地址,可选参数,有需求则填写 | 742ad779046 |
| 2 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 3 | password | String | WIFI密码,无密码wifi时可不填写该字段 | 123456 |
| 4 | ssid | String | 设备当前连接的WIFI名称 | gemeopen |
| 5 | type | String | 设备设置固定值"setting" | setting |
设备返回信息
设备向服务端订阅topic上报消息
{
"bssid" : "742ad779046",
"commandName" : "setting-wifi-config",
"mac" : "2026bb16aa14",
"message" : "ok",
"messageId" : "20260520",
"source" : "command",
"success" : true
}
"bssid" : "742ad779046",
"commandName" : "setting-wifi-config",
"mac" : "2026bb16aa14",
"message" : "ok",
"messageId" : "20260520",
"source" : "command",
"success" : true
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | bssid | String | 路由器 MAC 地址 | 742ad779046 |
| 2 | commandName | String | 指令名称 | setting-wifi-config |
| 3 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 2026bb16aa14 |
| 4 | message | String | 执行返回结果 | ok |
| 5 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 6 | source | String | 指令回复“command" | command |
| 7 | success | boolean | 执行结果 | true |
setting-wifi-dhcpEnable
指令简介
设备默认为动态获取ip,通过该接口开启静态IP,需重启生效
配置的静态IP需和路由器处于同一网段下
配置的静态IP需和路由器处于同一网段下
向设备发送指令
服务端向设备订阅topic发送消息
{
"dhcpEnable" : 1,
"dns" : "192.168.0.1",
"gateway" : "192.168.0.1",
"local_ip" : "192.168.0.118",
"messageId" : "20260520",
"subnet" : "255.255.255.0",
"type" : "setting"
}
"dhcpEnable" : 1,
"dns" : "192.168.0.1",
"gateway" : "192.168.0.1",
"local_ip" : "192.168.0.118",
"messageId" : "20260520",
"subnet" : "255.255.255.0",
"type" : "setting"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | dhcpEnable | int | 自动寻址1:开启, 0:关闭,默认开启 | 1 |
| 2 | dns | String | DNS服务器地址 | 192.168.0.1 |
| 3 | gateway | String | 默认网关 | 192.168.0.1 |
| 4 | local_ip | String | IP地址 | 192.168.0.118 |
| 5 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 6 | subnet | String | 子网掩码 | 255.255.255.0 |
| 7 | type | String | 设备设置固定值"setting" | setting |
设备返回信息
设备向服务端订阅topic上报消息
{
"commandName" : "setting-wifi-dhcpEnable",
"mac" : "2026bb16aa14",
"message" : "ok",
"messageId" : "20260520",
"source" : "command",
"success" : true
}
"commandName" : "setting-wifi-dhcpEnable",
"mac" : "2026bb16aa14",
"message" : "ok",
"messageId" : "20260520",
"source" : "command",
"success" : true
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | commandName | String | 指令名称 | setting-wifi-dhcpEnable |
| 2 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 2026bb16aa14 |
| 3 | message | String | 执行返回结果 | ok |
| 4 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 5 | source | String | 指令回复“command" | command |
| 6 | success | boolean | 执行结果 | true |
setting-wifi-lock
指令简介
wifi配网锁定后,设备无法通过长按配网按钮进入配网操作,仅能通过MQTT/TCP协议解锁配网功能
向设备发送指令
服务端向设备订阅topic发送消息
{
"messageId" : "20260520",
"type" : "setting",
"wifiLock" : 0
}
"messageId" : "20260520",
"type" : "setting",
"wifiLock" : 0
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 2 | type | String | 设备设置固定值"setting" | setting |
| 3 | wifiLock | int | 配网锁,0:关闭,1:开启 | 0 |
设备返回信息
设备向服务端订阅topic上报消息
{
"commandName" : "setting-wifi-lock",
"mac" : "2026bb16aa14",
"message" : "ok",
"messageId" : "20260520",
"source" : "command",
"success" : true,
"wifiLock" : 0
}
"commandName" : "setting-wifi-lock",
"mac" : "2026bb16aa14",
"message" : "ok",
"messageId" : "20260520",
"source" : "command",
"success" : true,
"wifiLock" : 0
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | commandName | String | 指令名称 | setting-wifi-lock |
| 2 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 2026bb16aa14 |
| 3 | message | String | 执行返回结果 | ok |
| 4 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 5 | source | String | 指令回复“command" | command |
| 6 | success | boolean | 执行结果 | true |
| 7 | wifiLock | int | 配网锁,0:关闭,1:开启 | 0 |









