GemeOpen
写几行代码,就可以控制的智能设备!
智能转换器插座10A-S1 Plus-WiFi开发者文档
产品型号:GSPM1B2
产品概要信息
基本描述
主控芯片升级为ESP32,增加过零检测
主要特点
热销10000+稳定可靠
WiFi网络,电流电压视在功率电量采集
AC110-250V,最大负载电流10A
WiFi网络,电流电压视在功率电量采集
AC110-250V,最大负载电流10A
产品图片
技术支持
企业微信扫一扫
武汉智鸟科技有限责任公司
企业官网:www.smart-bird.cn
服务热线:130-0715-9689
办公地址:湖北省武汉市高新大道光谷崇文中心B1栋1401、1409
控制采集
远程控制设备通断电
controller-event
指令简介
远程控制设备的通断电状态(通电/断电),指令执行后,设备立即切换继电器状态。
向设备发送指令
服务端向设备订阅topic发送消息
{
"key" : 0,
"messageId" : "202201241610366046",
"type" : "event"
}
"key" : 0,
"messageId" : "202201241610366046",
"type" : "event"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | key | int | 插座通断电状态,0:断电,1:通电 | 0 |
| 2 | messageId | String | 消息ID字段 | 202201241610366046 |
| 3 | type | String | 控制设备开关固定传"event" | event |
设备返回信息
设备向服务端订阅topic上报消息
{
"bssid" : "742ad779046",
"commandName" : "controller-event",
"ip" : "192.168.1.200",
"key" : 1,
"keyLock" : 0,
"mac" : "28372fcbbbb8",
"messageId" : "geekopen1234",
"onState" : 1,
"signal" : -75,
"source" : "command",
"ssid" : "GemeOpen",
"timerEnable" : 1,
"timerInterval" : 15,
"type" : "event",
"version" : "4.1_1.1.1",
"wifiLock" : 0
}
"bssid" : "742ad779046",
"commandName" : "controller-event",
"ip" : "192.168.1.200",
"key" : 1,
"keyLock" : 0,
"mac" : "28372fcbbbb8",
"messageId" : "geekopen1234",
"onState" : 1,
"signal" : -75,
"source" : "command",
"ssid" : "GemeOpen",
"timerEnable" : 1,
"timerInterval" : 15,
"type" : "event",
"version" : "4.1_1.1.1",
"wifiLock" : 0
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | bssid | String | 路由器 MAC 地址 | 742ad779046 |
| 2 | commandName | String | 指令名称 | controller-event |
| 3 | ip | String | 设备连接WIFI后获取的IP | 192.168.1.200 |
| 4 | key | int | 继电器通断电状态,0:断电,1:通电 | 1 |
| 5 | keyLock | int | 按键锁,0:关闭,1:开启 | 0 |
| 6 | mac | String | 设备MAC,唯一标识 | 28372fcbbbb8 |
| 7 | messageId | String | 如果发送json中,发送了messageId,返回的json中就返回发送时确定的值,如果发送json中没有值,此处为空 | geekopen1234 |
| 8 | onState | int | 设备上电的默认状态,0:记忆;1:关闭;2:开启,即通电,默认=1 | 1 |
| 9 | signal | int | 信号强度,显示规则为: signal<= 0 && signal>= -50 //信号最好 signal< -50 && signal>= -70 //信号较好 signal< -70 && signal>= -80 //信号一般 signal<-80 && signal>= -100 //信号较差 signal没有在0~(-100)之间,表示无信号 | -75 |
| 10 | source | String | 指令回复“command" | command |
| 11 | ssid | String | 设备当前连接的WIFI名称 | GemeOpen |
| 12 | timerEnable | int | 设备电量信息定时上报状态,0:关闭;1:开启 | 1 |
| 13 | timerInterval | int | 电量信息上报时间间隔(单位秒),取值范围5-86400 | 15 |
| 14 | type | String | 控制继电器通断,固定返回"event" | event |
| 15 | version | String | 当前固件版本号 | 4.1_1.1.1 |
| 16 | wifiLock | int | 配网锁,0:关闭,1:开启 | 0 |
设置用电数据上报频率
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上报消息
{
"iccid": "89861125208093419602",
"onState": 1,
"imei": "866965087693583",
"signal": 16,
"commandName": "device-timer-interval",
"version": "1.1.0",
"timerEnable": 1,
"code": "GSCW1B-4G",
"keyLock": 0,
"key2": 0,
"timerInterval": 15,
"source": "command",
"resetLock": 0,
"messageId": "202201241610366046"
}
"iccid": "89861125208093419602",
"onState": 1,
"imei": "866965087693583",
"signal": 16,
"commandName": "device-timer-interval",
"version": "1.1.0",
"timerEnable": 1,
"code": "GSCW1B-4G",
"keyLock": 0,
"key2": 0,
"timerInterval": 15,
"source": "command",
"resetLock": 0,
"messageId": "202201241610366046"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | bssid | String | 路由器 MAC 地址 | 742ad779046 |
| 2 | code | String | 设备型号代码 | GSCW1B-4G |
| 3 | commandName | String | 指令名称 | device-timer-interval |
| 4 | iccid | String | SIM-卡ICCID值 | 89861125208093419602 |
| 5 | imei | String | 设备唯一标识 | 866965087693583 |
| 6 | ip | String | 设备连接WIFI后获取的IP | 192.168.122.119 |
| 7 | key | int | 插座通断电状态,0:断电,1:通电 | 0 |
| 8 | key2 | int | 控制设备二路通断 0:关灯,1:开灯 | 0 |
| 9 | keyLock | int | 按键锁,0:关闭,1:开启 | 0 |
| 10 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| 11 | messageId | String | 消息ID字段 | 202201241610366046 |
| 12 | onState | int | 设备上电的默认状态: 0:记忆;是指记忆最后一次设备断电前的状态,如断电前设备是通电状态(指示灯是蓝的),设备下次上电默认是通电状态(指示灯是蓝的)。 1:关闭,即断电状态(指示灯是灭的),如断电前,设备是通电状态(指示灯是蓝的),设备下次上电默认是依旧是断电状态(指示灯是灭的)。需要手动/远程开启通电状态。 2:开启,即通电状态(指示灯是蓝色的),是指设备上电之后,默认是通电状态,此刻需要注意,插在设备上的负载会通电运行,会有安全风险,所以建议是默认上电状态为关闭。 | 1 |
| 13 | resetLock | int | 重置锁,0:关闭,1:开启 | 0 |
| 14 | signal | int | 信号强度,显示规则为: signal<= 0 && signal>= -50 //信号最好 signal< -50 && signal>= -70 //信号较好 signal< -70 && signal>= -80 //信号一般 signal<-80 && signal>= -100 //信号较差 signal没有在0~(-100)之间,表示无信号 | -75 |
| 15 | source | String | 指令回复“command" | command |
| 16 | ssid | String | 设备当前连接的WIFI名称 | GemeOpen |
| 17 | timerEnable | int | 设备电量信息定时上报状态,0:关闭;1:开启 | 1 |
| 18 | timerInterval | int | 设备统计信息上报时间间隔(单位秒),取值范围5-86400 | 15 |
| 19 | type | String | 设备类型 | GSPM1B2 |
| 20 | version | String | 当前固件版本号 | 4.1_1.1.1 |
| 21 | wifiLock | int | 配网锁,0:关闭,1:开启 | 0 |
用电数据定时上报
device-timer-task
指令简介
查看设备定时上报数据的 JSON 格式,供服务器端对接解析设备上报的数据。是否上报与上报频率由"设置数据定时上报频率"指令配置,配置后设备按周期将数据发布至约定主题(topic),设备端无订阅行为(仅发布),服务端订阅该发布主题后即可接收上报数据。
向设备发送指令
服务端向设备订阅topic发送消息
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|
设备返回信息
设备向服务端订阅topic上报消息
{
"commandName" : "device-timer-interval",
"current" : 15.027,
"energy" : 25.047,
"key" : 0,
"mac" : "2026bb16aa14",
"power" : 2921.511,
"source" : "command",
"voltage" : 226.024
}
"commandName" : "device-timer-interval",
"current" : 15.027,
"energy" : 25.047,
"key" : 0,
"mac" : "2026bb16aa14",
"power" : 2921.511,
"source" : "command",
"voltage" : 226.024
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | commandName | String | 指令名称 | device-timer-interval |
| 2 | current | float | 当前电流,单位A,保留三位小数 | 15.027 |
| 3 | energy | float | 累计用电量,单位KW*H,保留三位小数,断电后不会归零,重置后会归零 | 25.047 |
| 4 | key | int | 设备通断电状态,0:断电,1:通电 | 0 |
| 5 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 2026bb16aa14 |
| 6 | power | float | 当前功率,单位W,保留三位小数 | 2921.511 |
| 7 | source | String | 指令回复“command" | command |
| 8 | voltage | float | 当前电压,单位V,保留三位小数 | 226.024 |
获取设备基础信息
info-all
指令简介
查询当前设备的基础信息,如设备MAC地址、设备型号、固件版本号、当前连接的WiFi名称(ssid)、当前设备被分配的IP地址、WiFi信号强度及相关配置信息。
向设备发送指令
服务端向设备订阅topic发送消息
{
"messageId" : "Abcd123456",
"type" : "info"
}
"messageId" : "Abcd123456",
"type" : "info"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | messageId | String | 如果发送json中,发送了messageId,返回的json中就返回发送时确定的值,如果发送json中没有值,此处为空 | Abcd123456 |
| 2 | type | String | 获取设备基本信息固定传"info" | info |
设备返回信息
设备向服务端订阅topic上报消息
{
"ip" : "192.168.122.119",
"key" : 1,
"keyLock" : 0,
"mac" : "4CEBD60BFD62",
"messageId" : "Abcd123456",
"onState" : 0,
"signal" : -47,
"ssid" : "GeekOpen",
"timerEnable" : 1,
"type" : "Socket-86",
"version" : "1.2.3",
"wifiLock" : 0
}
"ip" : "192.168.122.119",
"key" : 1,
"keyLock" : 0,
"mac" : "4CEBD60BFD62",
"messageId" : "Abcd123456",
"onState" : 0,
"signal" : -47,
"ssid" : "GeekOpen",
"timerEnable" : 1,
"type" : "Socket-86",
"version" : "1.2.3",
"wifiLock" : 0
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | ip | String | 设备连接WIFI后获取的IP | 192.168.122.119 |
| 2 | key | int | 设备通断电状态,0:断电,1:通电 | 1 |
| 3 | keyLock | int | 按键锁,0:关闭,1:开启 | 0 |
| 4 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| 5 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | Abcd123456 |
| 6 | onState | int | 设备上电的默认状态,0:记忆;1:关闭;2:开启,即通电,默认=1 | 0 |
| 7 | signal | int | 设备网络信号强度, | -47 |
| 8 | ssid | String | 设备当前连接的WIFI名称 | GeekOpen |
| 9 | timerEnable | int | 设备统计信息定时上报状态,0:关闭;1:开启 | 1 |
| 10 | type | String | 固定值"xxx" | Socket-86 |
| 11 | version | String | 当前固件版本号 | 1.2.3 |
| 12 | wifiLock | int | 配网锁,0:关闭,1:开启 | 0 |
获取设备用电信息
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",
"current" : 15.027,
"energy" : 25.047,
"key" : 0,
"mac" : "4CEBD60BFD62",
"messageId" : "202201241610366046",
"power" : 2921.511,
"source" : "command",
"voltage" : 226.024
}
"commandName" : "info-statistic",
"current" : 15.027,
"energy" : 25.047,
"key" : 0,
"mac" : "4CEBD60BFD62",
"messageId" : "202201241610366046",
"power" : 2921.511,
"source" : "command",
"voltage" : 226.024
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | commandName | String | 指令名称 | info-statistic |
| 2 | current | float | 当前电流,单位A,保留三位小数 | 15.027 |
| 3 | energy | float | 累计用电量,单位KW*H,保留三位小数,断电后不会归零,重置后会归零 | 25.047 |
| 4 | key | int | 插座通断电状态,0:断电,1:通电 | 0 |
| 5 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| 6 | messageId | String | 消息ID字段 | 202201241610366046 |
| 7 | power | float | 当前功率,单位W,保留三位小数 | 2921.511 |
| 8 | source | String | 指令回复“command" | command |
| 9 | voltage | float | 当前电压,单位V,保留三位小数 | 226.024 |
定时任务
查询定时通断任务
info-timer-task-query
指令简介
查询设备已设置的定时通断电任务列表及详情。
向设备发送指令
服务端向设备订阅topic发送消息
{
"action" : "timerTaskQuery",
"messageId" : "202201241610366046",
"type" : "event"
}
"action" : "timerTaskQuery",
"messageId" : "202201241610366046",
"type" : "event"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | action | String | 固定值timerTaskQuery | timerTaskQuery |
| 2 | messageId | String | 消息ID字段 | 202201241610366046 |
| 3 | type | String | 设备设置固定传"event" | event |
设备返回信息
设备向服务端订阅topic上报消息
{
"action" : "timerTaskQuery",
"commandName" : "info-timer-task-query",
"list" :
[
{
"command" : { "key":1, "type":"event" },
"hour" : 0,
"minute" : 0,
"number" : 1,
"repeat" : "week"
},
],
"mac" : "4CEBD60BFD62",
"messageId" : "202201241610366046",
"source" : "command",
"type" : "event"
}
"action" : "timerTaskQuery",
"commandName" : "info-timer-task-query",
"list" :
[
{
"command" : { "key":1, "type":"event" },
"hour" : 0,
"minute" : 0,
"number" : 1,
"repeat" : "week"
},
],
"mac" : "4CEBD60BFD62",
"messageId" : "202201241610366046",
"source" : "command",
"type" : "event"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | action | String | 固定值timerTaskQuery | timerTaskQuery |
| 2 | command | Object | 指令 | { "key":1, "type":"event" } |
| 3 | commandName | String | 指令名称 | info-timer-task-query |
| 4 | hour | int | 小时0~23 | 0 |
| 5 | list | List | list为列表,参数带year、month、day是定时按年月日时分执行一次,参数不带year、month、day则是每天按时分循环执行,发送指令不带list参数,则返回当前设备的list参数,key1、key2、key3含义同event指令 | |
| 6 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| 7 | messageId | String | 消息ID字段 | 202201241610366046 |
| 8 | minute | int | 分钟0~60 | 0 |
| 9 | number | int | 任务编号 | 1 |
| 10 | repeat | String | 重复week:按周重复,day:按天重复,oneof:一次任务 | week |
| 11 | source | String | 指令回复“command" | command |
| 12 | type | String | 设备设置固定传"event" | event |
设置倒计时通断任务
setting-timer-countdown
指令简介
设置倒计时任务——指定时长与到点动作(关闭/开启)。
向设备发送指令
服务端向设备订阅topic发送消息
{
"countdownSecond" : 10,
"finishCommand" :
{
"key" : 0,
"type" : "event"
},
"messageId" : "202201241610366046",
"task" : "countdown",
"timerInterval" : 20,
"type" : "setting"
}
"countdownSecond" : 10,
"finishCommand" :
{
"key" : 0,
"type" : "event"
},
"messageId" : "202201241610366046",
"task" : "countdown",
"timerInterval" : 20,
"type" : "setting"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | countdownSecond | int | 倒计时总时长(秒),必须大于 0,最大86400 | 10 |
| 2 | finishCommand | Object | 倒计时结束后自动执行的任务 | |
| 3 | key | int | 插座通断电状态,0:断电,1:通电 | 0 |
| 4 | key | int | 插座通断电状态,0:断电,1:通电 | 0 |
| 5 | key | int | 设备通断电状态,0:断电,1:通电 | 0 |
| 6 | messageId | String | 消息ID字段 | 202201241610366046 |
| 7 | task | String | 固定值“countdown" | countdown |
| 8 | timerInterval | int | 倒计时信息上报时间间隔(单位秒),取值范围1-86400 | 20 |
| 9 | type | String | 设备设置固定传"setting" | setting |
| 10 | type | String | 设备设置固定传"event" | event |
| 11 | type | String | 设备设置固定传"event" | event |
| 12 | type | String | 固定传"event" | event |
设备返回信息
设备向服务端订阅topic上报消息
{
"commandName" : "setting-timer-countdown",
"countdownSecond" : 10
,
"finishCommand" :
{
"key" : 0,
"type" : "event"
},
"mac" : "4CEBD60BFD62",
"messageId" : "202201241610366046",
"source" : "command",
"task" : "countdown",
"timerInterval" : 20,
"type" : "setting"
}
"commandName" : "setting-timer-countdown",
"countdownSecond" : 10
,
"finishCommand" :
{
"key" : 0,
"type" : "event"
},
"mac" : "4CEBD60BFD62",
"messageId" : "202201241610366046",
"source" : "command",
"task" : "countdown",
"timerInterval" : 20,
"type" : "setting"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | commandName | String | 指令名称 | setting-timer-countdown |
| 2 | countdownSecond | int | 倒计时总时长(秒),必须大于 0 | 10 |
| 3 | finishCommand | Object | 完成任务 | |
| 4 | key | int | 插座通断电状态,0:断电,1:通电 | 0 |
| 5 | key | int | 插座通断电状态,0:断电,1:通电 | 0 |
| 6 | key | int | 插座通断电状态,0:断电,1:通电 | 0 |
| 7 | mac | String | wifi设备MAC地址,唯一标识 | 4CEBD60BFD62 |
| 8 | messageId | String | 消息ID字段 | 202201241610366046 |
| 9 | source | String | 指令回复“command" | command |
| 10 | task | String | 固定值“countdown" | countdown |
| 11 | timerInterval | int | 倒计时信息上报时间间隔(单位秒),取值范围1-86400 | 20 |
| 12 | type | String | 设备设置固定传"setting" | setting |
| 13 | type | String | 设备设置固定传"event" | event |
| 14 | type | String | 设备设置固定传"event" | event |
| 15 | type | String | 设备设置固定传"event" | event |
倒计时任务自动上报
setting-timer-countdown-active
指令简介
查看设备倒计时状态上报的 JSON 格式定义,供服务端对接解析设备上报的倒计时状态数据。上报频率由"设置倒计时任务"指令配置,配置后设备按周期将数据发布至约定主题(topic),设备端无订阅行为(仅发布),服务端订阅该发布主题后即可接收上报数据。
向设备发送指令
服务端向设备订阅topic发送消息
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|
设备返回信息
设备向服务端订阅topic上报消息
{
"commandName" : "setting-timer-countdown-active",
"countdownSecond" : 10
,
"mac" : "4CEBD60BFD62",
"remainingSecond" : 9,
"source" : "command",
"state" : 1
}
"commandName" : "setting-timer-countdown-active",
"countdownSecond" : 10
,
"mac" : "4CEBD60BFD62",
"remainingSecond" : 9,
"source" : "command",
"state" : 1
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | commandName | String | 指令名称 | setting-timer-countdown-active |
| 2 | countdownSecond | int | 倒计时总时长(秒),必须大于 0。 | 10 |
| 3 | mac | String | wifi设备MAC地址,唯一标识 | 4CEBD60BFD62 |
| 4 | remainingSecond | int | 倒计时剩余时间,单位S | 9 |
| 5 | source | String | 指令回复“command" | command |
| 6 | state | int | 任务状态:0:待启动,1:正在进行,2:结束 | 1 |
清除倒计时任务
setting-timer-countdown-clear
指令简介
删除设备中已设置的所有倒计时通断电任务,删除为不可逆操作,删除后需重新设置。
向设备发送指令
服务端向设备订阅topic发送消息
{
"messageId" : "202201241610366046",
"task" : "countdown-clear",
"type" : "setting"
}
"messageId" : "202201241610366046",
"task" : "countdown-clear",
"type" : "setting"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | messageId | String | 消息ID字段 | 202201241610366046 |
| 2 | task | String | 固定值"countdown-clear" | countdown-clear |
| 3 | type | String | 设备设置固定传"setting" | setting |
设备返回信息
设备向服务端订阅topic上报消息
{
"commandName" : "setting-timer-countdown-clear",
"mac" : "4CEBD60BFD62",
"message" : "ok",
"messageId" : "202201241610366046",
"source" : "command",
"success" : true
}
"commandName" : "setting-timer-countdown-clear",
"mac" : "4CEBD60BFD62",
"message" : "ok",
"messageId" : "202201241610366046",
"source" : "command",
"success" : true
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | commandName | String | 指令名称 | setting-timer-countdown-clear |
| 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 |
删除定时通断任务
setting-timer-delete
指令简介
删除设备中已设置的单条定时通断电任务,删除为不可逆操作,删除后需重新设置。
向设备发送指令
服务端向设备订阅topic发送消息
{
"action" : "delete",
"messageId" : "202201241610366046",
"number" : 1,
"type" : "setting"
}
"action" : "delete",
"messageId" : "202201241610366046",
"number" : 1,
"type" : "setting"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | action | String | 固定值delete | delete |
| 2 | messageId | String | 消息ID字段 | 202201241610366046 |
| 3 | number | int | 任务编号 | 1 |
| 4 | type | String | 设备设置固定传"setting" | setting |
设备返回信息
设备向服务端订阅topic上报消息
{
"commandName" : "setting-timer-delete",
"mac" : "4CEBD60BFD62",
"message" : "ok",
"messageId" : "202201241610366046",
"source" : "command",
"success" : true
}
"commandName" : "setting-timer-delete",
"mac" : "4CEBD60BFD62",
"message" : "ok",
"messageId" : "202201241610366046",
"source" : "command",
"success" : true
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | commandName | String | 指令名称 | setting-timer-delete |
| 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 |
设置定时通断任务
setting-timer-task
指令简介
新增或编辑定时通断电任务,设置后到点执行开启/关闭操作。
向设备发送指令
服务端向设备订阅topic发送消息
{
"command" :
{
"key" : 0,
"type" : "event"
},
"hour" : 0,
"messageId" : "202201241610366046",
"minute" : 0,
"number" : 1,
"repeat" : "oneof",
"task" : "timer",
"type" : "setting"
}
"command" :
{
"key" : 0,
"type" : "event"
},
"hour" : 0,
"messageId" : "202201241610366046",
"minute" : 0,
"number" : 1,
"repeat" : "oneof",
"task" : "timer",
"type" : "setting"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | command | Object | 定时触发的事件,key为0,触发是断电;key为1,触发是通电 | |
| 2 | hour | int | 小时0~23 | 0 |
| 3 | key | int | 插座通断电状态,0:断电,1:通电 | 0 |
| 4 | key | int | 插座通断电状态,0:断电,1:通电 | 0 |
| 5 | key | int | 插座通断电状态,0:断电,1:通电 | 0 |
| 6 | messageId | String | 消息ID字段 | 202201241610366046 |
| 7 | minute | int | 分钟0~60 | 0 |
| 8 | number | int | 任务编号 | 1 |
| 9 | repeat | String | 重复week:按周重复,day:按天重复,oneof:一次任务 | oneof |
| 10 | task | String | 固定值timer | timer |
| 11 | type | String | 设备设置固定传"setting" | setting |
| 12 | type | String | 设备设置固定传"event" | event |
| 13 | type | String | 设备设置固定传"event" | event |
| 14 | type | String | 设备设置固定传"event" | event |
设备返回信息
设备向服务端订阅topic上报消息
{
"command" :
{
"key" : 0,
"type" : "event"
},
"commandName" : "setting-timer-task",
"hour" : 0,
"mac" : "4CEBD60BFD62",
"messageId" : "202201241610366046",
"minute" : 0,
"number" : 1,
"repeat" : "oneof",
"source" : "command"
}
"command" :
{
"key" : 0,
"type" : "event"
},
"commandName" : "setting-timer-task",
"hour" : 0,
"mac" : "4CEBD60BFD62",
"messageId" : "202201241610366046",
"minute" : 0,
"number" : 1,
"repeat" : "oneof",
"source" : "command"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | command | Object | 指令 | |
| 2 | commandName | String | 指令名称 | setting-timer-task |
| 3 | hour | int | 小时0~23 | 0 |
| 4 | key | int | 插座通断电状态,0:断电,1:通电 | 0 |
| 5 | key | int | 插座通断电状态,0:断电,1:通电 | 0 |
| 6 | key | int | 插座通断电状态,0:断电,1:通电 | 0 |
| 7 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| 8 | messageId | String | 消息ID字段 | 202201241610366046 |
| 9 | minute | int | 分钟0~60 | 0 |
| 10 | number | int | 任务编号 | 1 |
| 11 | repeat | String | 重复week:按周重复,day:按天重复,oneof:一次任务 | oneof |
| 12 | source | String | 指令回复“command" | command |
| 13 | type | String | 设备设置固定传"event" | event |
| 14 | type | String | 设备设置固定传"event" | event |
| 15 | type | String | 设备设置固定传"event" | event |
设备维护
重置设备
controller-reset
指令简介
将设备恢复至出厂状态,清除全部用户数据与配置,并自动重启。
向设备发送指令
服务端向设备订阅topic发送消息
{
"messageId" : "202201241610366046",
"system" : "reset",
"type" : "setting"
}
"messageId" : "202201241610366046",
"system" : "reset",
"type" : "setting"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | messageId | String | 消息ID字段 | 202201241610366046 |
| 2 | system | String | 重置/恢复出厂设置默认填"reset" | reset |
| 3 | type | String | 设备设置固定传”setting" | setting |
设备返回信息
设备向服务端订阅topic上报消息
{
"commandName" : "controller-reset",
"mac" : "4CEBD60BFD62",
"message" : "ok",
"messageId" : "202201241610366046",
"source" : "command",
"success" : true
}
"commandName" : "controller-reset",
"mac" : "4CEBD60BFD62",
"message" : "ok",
"messageId" : "202201241610366046",
"source" : "command",
"success" : true
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | commandName | String | 指令名称 | controller-reset |
| 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 |
重启设备
controller-restart
指令简介
该指令主要用于使需重启生效的配置生效(如自定义MQTT/TCP/HTTP,设置静态IP,设置WiFi信息等),重启后设备自动恢复,重新联网,已保存配置和数据不丢失。
向设备发送指令
服务端向设备订阅topic发送消息
{
"messageId" : "202201241610366046",
"system" : "restart",
"type" : "setting"
}
"messageId" : "202201241610366046",
"system" : "restart",
"type" : "setting"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | messageId | String | 消息ID字段 | 202201241610366046 |
| 2 | system | String | 设备软重启固定传"restart" | restart |
| 3 | type | String | 设备设置固定传"setting" | setting |
设备返回信息
设备向服务端订阅topic上报消息
{
"commandName" : "controller-reset",
"mac" : "4CEBD60BFD62",
"message" : "ok",
"messageId" : "202201241610366046",
"source" : "command",
"success" : true
}
"commandName" : "controller-reset",
"mac" : "4CEBD60BFD62",
"message" : "ok",
"messageId" : "202201241610366046",
"source" : "command",
"success" : true
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | commandName | String | 指令名称 | controller-reset |
| 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 |
累计用电量清零
energy-clear
指令简介
将设备累计用电量清零,清零后从零开始重新累计统计,仅清除累计用电量,不影响其他数据。清零为不可逆操作,清除后累计数据无法恢复!
向设备发送指令
服务端向设备订阅topic发送消息
{
"messageId" : "202201241610366046",
"system" : "energy-clear",
"type" : "setting"
}
"messageId" : "202201241610366046",
"system" : "energy-clear",
"type" : "setting"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | messageId | String | 消息ID字段 | 202201241610366046 |
| 2 | system | String | energy-clear 电量清零 | energy-clear |
| 3 | type | String | 设置设备固定传"setting" | setting |
设备返回信息
设备向服务端订阅topic上报消息
{
"commandName" : "energy-clear",
"mac" : "4CEBD60BFD62",
"message" : "ok",
"messageId" : "202201241610366046",
"source" : "command",
"success" : true
}
"commandName" : "energy-clear",
"mac" : "4CEBD60BFD62",
"message" : "ok",
"messageId" : "202201241610366046",
"source" : "command",
"success" : true
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | commandName | String | 指令名称 | energy-clear |
| 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 |
获取设备通信协议
info-protocol
指令简介
获取当前设备与服务端交互的通信协议及协议配置参数,目前支持MQTT、TCP Client和HTTP Server(固件版本2.0.0以上支持),设备出厂时默认接入GemeOpen厂家MQTT测试服务器,免费提供客户调试使用,如需接入自己的服务器或使用其他协议,请自行搭建服务器。
向设备发送指令
服务端向设备订阅topic发送消息
{
"messageId" : "202201241610366046",
"type" : "protocol"
}
"messageId" : "202201241610366046",
"type" : "protocol"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | messageId | String | 消息ID字段 | 202201241610366046 |
| 2 | type | String | 获取设备通讯协议固定传protocol | protocol |
设备返回信息
设备向服务端订阅topic上报消息
{
"clientId" : "test-iot",
"commandName" : "info-protocol",
"mac" : "4CEBD60BFD62",
"messageId" : "202201241610366046",
"password" : "SUXOihwWNLMTRFKCFL",
"port" : "1883",
"protocol" : "MQTT",
"publish" : "/rqlMqR/GYofdXmMpHQa/4CEBD60BFD62/subscribe",
"server" : "broker.emqx.io",
"source" : "command",
"subcribe" : "/rqlMqR/GYofdXmMpHQa/4CEBD60BFD62/publish",
"username" : "admin
"
}
"clientId" : "test-iot",
"commandName" : "info-protocol",
"mac" : "4CEBD60BFD62",
"messageId" : "202201241610366046",
"password" : "SUXOihwWNLMTRFKCFL",
"port" : "1883",
"protocol" : "MQTT",
"publish" : "/rqlMqR/GYofdXmMpHQa/4CEBD60BFD62/subscribe",
"server" : "broker.emqx.io",
"source" : "command",
"subcribe" : "/rqlMqR/GYofdXmMpHQa/4CEBD60BFD62/publish",
"username" : "admin
"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | clientId | String | 自定义MQTT客户端ID注意:不可重复 | test-iot |
| 2 | commandName | String | 指令名称 | info-protocol |
| 3 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| 4 | messageId | String | 消息ID字段 | 202201241610366046 |
| 5 | password | String | 密码 | SUXOihwWNLMTRFKCFL |
| 6 | port | String | 端口号 | 1883 |
| 7 | protocol | String | 协议类型,MQTT协议固定传"mqtt" | MQTT |
| 8 | publish | String | 自定义MQTT发布主题 注意:不可重复 | /rqlMqR/GYofdXmMpHQa/4CEBD60BFD62/subscribe |
| 9 | server | String | 自定义MQTT服务器地址 | broker.emqx.io |
| 10 | source | String | 指令回复“command" | command |
| 11 | subcribe | String | 自定义MQTT订阅主题注意:不可重复 | /rqlMqR/GYofdXmMpHQa/4CEBD60BFD62/publish |
| 12 | username | String | 自定义MQTT服务器用户名 | admin |
设置按键控制锁
setting-key-lock
指令简介
功能按键锁定后,设备仅能通过MQTT/TCP协议操作,例如控制开关的通断、插座的通断电,都只能通过远程指令下发,不能通过物理按键来控制。
向设备发送指令
服务端向设备订阅topic发送消息
{
"keyLock" : 0,
"messageId" : "202201241610366046",
"type" : "setting"
}
"keyLock" : 0,
"messageId" : "202201241610366046",
"type" : "setting"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | keyLock | int | 按键锁,0:关闭,1:开启 | 0 |
| 2 | messageId | String | 消息ID字段 | 202201241610366046 |
| 3 | type | String | 设备设置固定传’setting" | setting |
设备返回信息
设备向服务端订阅topic上报消息
{
"bssid" : "742ad779046",
"commandName" : "setting-key-lock",
"ip" : "192.168.122.119 ",
"key" : 0,
"keyLock" : 0,
"mac" : "4CEBD60BFD62",
"messageId" : "202201241610366046",
"onState" : 1,
"signal" : -75,
"source" : "command",
"ssid" : "GemeOpen",
"timerEnable" : 1,
"timerInterval" : 15,
"type" : "GSPM1B2",
"version" : "4.1_1.1.1",
"wifiLock" : 0
}
"bssid" : "742ad779046",
"commandName" : "setting-key-lock",
"ip" : "192.168.122.119 ",
"key" : 0,
"keyLock" : 0,
"mac" : "4CEBD60BFD62",
"messageId" : "202201241610366046",
"onState" : 1,
"signal" : -75,
"source" : "command",
"ssid" : "GemeOpen",
"timerEnable" : 1,
"timerInterval" : 15,
"type" : "GSPM1B2",
"version" : "4.1_1.1.1",
"wifiLock" : 0
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | bssid | String | 路由器 MAC 地址 | 742ad779046 |
| 2 | commandName | String | 指令名称 | setting-key-lock |
| 3 | ip | String | 设备连接WIFI后获取的IP | 192.168.122.119 |
| 4 | key | int | 插座通断电状态,0:断电,1:通电 | 0 |
| 5 | keyLock | int | 按键锁,0:关闭,1:开启 | 0 |
| 6 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| 7 | messageId | String | 消息ID字段 | 202201241610366046 |
| 8 | onState | int | 设备上电的默认状态: 0:记忆;是指记忆最后一次设备断电前的状态,如断电前设备是通电状态(指示灯是蓝的),设备下次上电默认是通电状态(指示灯是蓝的)。 1:关闭,即断电状态(指示灯是灭的),如断电前,设备是通电状态(指示灯是蓝的),设备下次上电默认是依旧是断电状态(指示灯是灭的)。需要手动/远程开启通电状态。 2:开启,即通电状态(指示灯是蓝色的),是指设备上电之后,默认是通电状态,此刻需要注意,插在设备上的负载会通电运行,会有安全风险,所以建议是默认上电状态为关闭。 | 1 |
| 9 | signal | int | 信号强度,显示规则为: signal<= 0 && signal>= -50 //信号最好 signal< -50 && signal>= -70 //信号较好 signal< -70 && signal>= -80 //信号一般 signal<-80 && signal>= -100 //信号较差 signal没有在0~(-100)之间,表示无信号 | -75 |
| 10 | source | String | 指令回复“command" | command |
| 11 | ssid | String | 设备当前连接的WIFI名称 | GemeOpen |
| 12 | timerEnable | int | 设备统计信息定时上报状态,0:关闭;1:开启 | 1 |
| 13 | timerInterval | int | 设备统计信息上报时间间隔(单位秒),取值范围5-86400 | 15 |
| 14 | type | String | 设备类型 | GSPM1B2 |
| 15 | version | String | 当前固件版本号 | 4.1_1.1.1 |
| 16 | wifiLock | int | 配网锁,0:关闭,1:开启 | 0 |
自定义MQTT参数
setting-mqtt
指令简介
修改设备的 MQTT 服务器连接参数,使设备接入客户指定的MQTT 服务器(自建服务器、第三方平台等)。
向设备发送指令
服务端向设备订阅topic发送消息
{
"clientId" : "admin",
"messageId" : "202201241610366046",
"password" : "123456",
"port" : "1883",
"protocol" : "mqtt",
"publish" : "/rqlMqR/GYofdXmMpHQa/8cce4e51e2c7/subscribe ",
"server" : "broker.emqx.io",
"subcribe" : "/topic/qos1 ",
"type" : "custom",
"username" : "admin"
}
"clientId" : "admin",
"messageId" : "202201241610366046",
"password" : "123456",
"port" : "1883",
"protocol" : "mqtt",
"publish" : "/rqlMqR/GYofdXmMpHQa/8cce4e51e2c7/subscribe ",
"server" : "broker.emqx.io",
"subcribe" : "/topic/qos1 ",
"type" : "custom",
"username" : "admin"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | clientId | String | 自定义MQTT客户端ID注意:不可重复 | admin |
| 2 | messageId | String | 消息ID字段 | 202201241610366046 |
| 3 | password | String | 密码 | 123456 |
| 4 | port | String | 端口号 | 1883 |
| 5 | protocol | String | 协议类型,MQTT协议固定传"mqtt" | mqtt |
| 6 | publish | String | 自定义MQTT发布主题 注意:不可重复 | /rqlMqR/GYofdXmMpHQa/8cce4e51e2c7/subscribe |
| 7 | server | String | 自定义MQTT服务器地址 | broker.emqx.io |
| 8 | subcribe | String | 自定义MQTT订阅主题注意:不可重复 | /topic/qos1 |
| 9 | type | String | 自定义配置固定传“custom” | custom |
| 10 | username | String | 自定义MQTT服务器用户名 | admin |
设备返回信息
设备向服务端订阅topic上报消息
{
"clientId" : "admin",
"commandName" : "setting-mqtt",
"mac" : "4CEBD60BFD62",
"messageId" : "202201241610366046",
"password" : "123456",
"port" : "1883",
"protocol" : "mqtt",
"publish" : "/rqlMqR/GYofdXmMpHQa/8cce4e51e2c7/subscribe",
"server" : "broker.emqx.io",
"source" : "command",
"subcribe" : "/topic/qos1 ",
"username" : "admin "
}
"clientId" : "admin",
"commandName" : "setting-mqtt",
"mac" : "4CEBD60BFD62",
"messageId" : "202201241610366046",
"password" : "123456",
"port" : "1883",
"protocol" : "mqtt",
"publish" : "/rqlMqR/GYofdXmMpHQa/8cce4e51e2c7/subscribe",
"server" : "broker.emqx.io",
"source" : "command",
"subcribe" : "/topic/qos1 ",
"username" : "admin "
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | clientId | String | 自定义MQTT客户端ID注意:不可重复 | admin |
| 2 | commandName | String | 指令名称 | setting-mqtt |
| 3 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| 4 | messageId | String | 消息ID字段 | 202201241610366046 |
| 5 | password | String | 密码 | 123456 |
| 6 | port | String | 端口号 | 1883 |
| 7 | protocol | String | 协议类型,MQTT协议固定传"mqtt" | mqtt |
| 8 | publish | String | 自定义MQTT发布主题 注意:不可重复 | /rqlMqR/GYofdXmMpHQa/8cce4e51e2c7/subscribe |
| 9 | server | String | 自定义MQTT服务器地址 | broker.emqx.io |
| 10 | source | String | 指令回复“command" | command |
| 11 | subcribe | String | 自定义MQTT订阅主题注意:不可重复 | /topic/qos1 |
| 12 | username | String | 自定义MQTT服务器用户名 | admin |
设置上电默认状态
setting-on-state
指令简介
配置设备断电恢复后输出的默认状态,即断电恢复瞬间设备是通电还是断电。
向设备发送指令
服务端向设备订阅topic发送消息
{
"messageId" : "20260520",
"onState" : 1,
"type" : "setting"
}
"messageId" : "20260520",
"onState" : 1,
"type" : "setting"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 2 | onState | int | 设备上电的默认状态: 0:记忆;是指记忆最后一次设备断电前的状态,如断电前设备是通电状态(指示灯是蓝的),设备下次上电默认是通电状态(指示灯是蓝的)。 1:关闭,即断电状态(指示灯是灭的),如断电前,设备是通电状态(指示灯是蓝的),设备下次上电默认是依旧是断电状态(指示灯是灭的)。需要手动/远程开启通电状态。 2:开启,即通电状态(指示灯是蓝色的),是指设备上电之后,默认是通电状态,此刻需要注意,插在设备上的负载会通电运行,会有安全风险,所以建议是默认上电状态为关闭。 | 1 |
| 3 | type | String | 设备设置固定传"setting" | setting |
设备返回信息
设备向服务端订阅topic上报消息
{
"bssid" : "742ad779046",
"commandName" : "setting-on-state",
"ip" : "192.168.122.119 ",
"key" : 0,
"keyLock" : 0,
"mac" : "4CEBD60BFD62",
"messageId" : "202201241610366046",
"onState" : 1,
"signal" : -75,
"source" : "command",
"ssid" : "GemeOpen",
"timerEnable" : 1,
"timerInterval" : 15,
"type" : "GSPM1B2",
"version" : "4.1_1.1.1",
"wifiLock" : 0
}
"bssid" : "742ad779046",
"commandName" : "setting-on-state",
"ip" : "192.168.122.119 ",
"key" : 0,
"keyLock" : 0,
"mac" : "4CEBD60BFD62",
"messageId" : "202201241610366046",
"onState" : 1,
"signal" : -75,
"source" : "command",
"ssid" : "GemeOpen",
"timerEnable" : 1,
"timerInterval" : 15,
"type" : "GSPM1B2",
"version" : "4.1_1.1.1",
"wifiLock" : 0
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | bssid | String | 路由器 MAC 地址 | 742ad779046 |
| 2 | commandName | String | 指令名称 | setting-on-state |
| 3 | ip | String | 设备连接WIFI后获取的IP | 192.168.122.119 |
| 4 | key | int | 插座通断电状态,0:断电,1:通电 | 0 |
| 5 | keyLock | int | 按键锁,0:关闭,1:开启 | 0 |
| 6 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| 7 | messageId | String | 消息ID字段 | 202201241610366046 |
| 8 | onState | int | 设备上电的默认状态: 0:记忆;是指记忆最后一次设备断电前的状态,如断电前设备是通电状态(指示灯是蓝的),设备下次上电默认是通电状态(指示灯是蓝的)。 1:关闭,即断电状态(指示灯是灭的),如断电前,设备是通电状态(指示灯是蓝的),设备下次上电默认是依旧是断电状态(指示灯是灭的)。需要手动/远程开启通电状态。 2:开启,即通电状态(指示灯是蓝色的),是指设备上电之后,默认是通电状态,此刻需要注意,插在设备上的负载会通电运行,会有安全风险,所以建议是默认上电状态为关闭。 | 1 |
| 9 | signal | int | 信号强度,显示规则为: signal<= 0 && signal>= -50 //信号最好 signal< -50 && signal>= -70 //信号较好 signal< -70 && signal>= -80 //信号一般 signal<-80 && signal>= -100 //信号较差 signal没有在0~(-100)之间,表示无信号 | -75 |
| 10 | source | String | 指令回复“command" | command |
| 11 | ssid | String | 设备当前连接的WIFI名称 | GemeOpen |
| 12 | timerEnable | int | 设备统计信息定时上报状态,0:关闭;1:开启 | 1 |
| 13 | timerInterval | int | 设备统计信息上报时间间隔(单位秒),取值范围5-86400 | 15 |
| 14 | type | String | 设备类型 | GSPM1B2 |
| 15 | version | String | 当前固件版本号 | 4.1_1.1.1 |
| 16 | wifiLock | int | 配网锁,0:关闭,1:开启 | 0 |
自定义TCP参数
setting-tcp
指令简介
设置设备的 TCP 服务器连接参数。设备仅支持 TCP Client 模式,设备作为客户端主动连接客户指定的 TCP 服务器。
向设备发送指令
服务端向设备订阅topic发送消息
{
"messageId" : "202201241610366046",
"port" : "8080",
"protocol" : "tcp",
"server" : "192.168.0.66",
"type" : "custom"
}
"messageId" : "202201241610366046",
"port" : "8080",
"protocol" : "tcp",
"server" : "192.168.0.66",
"type" : "custom"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | messageId | String | 消息ID字段 | 202201241610366046 |
| 2 | port | String | 自定义TCP服务器端口 | 8080 |
| 3 | protocol | String | TCP协议固定传"tcp" | tcp |
| 4 | server | String | 自定义TCP服务器地址 | 192.168.0.66 |
| 5 | type | String | 设备自定义固定传"custom" | custom |
设备返回信息
设备向服务端订阅topic上报消息
{
"commandName" : "setting-tcp",
"mac" : "4CEBD60BFD62",
"messageId" : "202201241610366046",
"port" : "8080",
"protocol" : "tcp",
"server" : "192.168.0.66",
"source" : "command"
}
"commandName" : "setting-tcp",
"mac" : "4CEBD60BFD62",
"messageId" : "202201241610366046",
"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 | 消息ID字段 | 202201241610366046 |
| 4 | port | String | 端口号 | 8080 |
| 5 | protocol | String | TCP协议固定传"tcp" | tcp |
| 6 | server | String | 自定义TCP服务器地址 | 192.168.0.66 |
| 7 | source | String | 指令回复“command" | command |
设置WiFi账号
setting-wifi-config
指令简介
修改设备的 WiFi 连接信息(网络名称与密码),使设备连接至指定的 WiFi 网络。设备仅支持 2.4G WiFi(不支持 5G 频段),请确认目标网络为 2.4G。
向设备发送指令
服务端向设备订阅topic发送消息
{
"password" : "123456",
"ssid" : "GemeOpen",
"type" : "setting"
}
"password" : "123456",
"ssid" : "GemeOpen",
"type" : "setting"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | password | String | 密码 | 123456 |
| 2 | ssid | String | 设备当前连接的WIFI名称 | GemeOpen |
| 3 | type | String | 设备设置固定传"setting" | setting |
设备返回信息
设备向服务端订阅topic上报消息
{
"commandName" : "setting-wifi-config",
"mac" : "4CEBD60BFD62",
"message" : "ok",
"source" : "command",
"success" : true
}
"commandName" : "setting-wifi-config",
"mac" : "4CEBD60BFD62",
"message" : "ok",
"source" : "command",
"success" : true
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | commandName | String | 指令名称 | setting-wifi-config |
| 2 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| 3 | message | String | 执行返回结果 | ok |
| 4 | source | String | 指令回复“command" | command |
| 5 | success | boolean | 执行结果 | true |
设置IP获取方式
setting-wifi-dhcpEnable
指令简介
配置设备的 IP 获取方式,设备出厂时IP获取方式默认为DHCP,静态 IP 需位于路由器网段内且未被占用,否则可能无法联网或冲突。
向设备发送指令
服务端向设备订阅topic发送消息
{
"dhcpEnable" : 0,
"dns" : "192.168.0.1",
"gateway" : "192.168.0.1",
"local_ip" : "192.168.0.118",
"subnet" : "255.255.255.0",
"type" : "setting"
}
"dhcpEnable" : 0,
"dns" : "192.168.0.1",
"gateway" : "192.168.0.1",
"local_ip" : "192.168.0.118",
"subnet" : "255.255.255.0",
"type" : "setting"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | dhcpEnable | int | 自动寻址1:开启, 0:关闭,默认开启 | 0 |
| 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 | subnet | String | 子网掩码 | 255.255.255.0 |
| 6 | type | String | 设备设置固定传"setting" | setting |
设备返回信息
设备向服务端订阅topic上报消息
{
"commandName" : "setting-wifi-dhcpEnable",
"mac" : "4CEBD60BFD62",
"message" : "ok",
"source" : "command",
"success" : true
}
"commandName" : "setting-wifi-dhcpEnable",
"mac" : "4CEBD60BFD62",
"message" : "ok",
"source" : "command",
"success" : true
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | commandName | String | 指令名称 | setting-wifi-dhcpEnable |
| 2 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| 3 | message | String | 执行返回结果 | ok |
| 4 | source | String | 指令回复“command" | command |
| 5 | success | boolean | 执行结果 | true |
设置WiFi配网锁
setting-wifi-lock
指令简介
WiFi配网锁定后,设备无法通过长按配网按钮进入配网操作,仅能通过MQTT/TCP协议解锁配网功能。
向设备发送指令
服务端向设备订阅topic发送消息
{
"messageId" : "202201241610366046",
"type" : "setting",
"wifiLock" : 0
}
"messageId" : "202201241610366046",
"type" : "setting",
"wifiLock" : 0
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | messageId | String | 消息ID字段 | 202201241610366046 |
| 2 | type | String | 设备设置固定传"setting" | setting |
| 3 | wifiLock | int | 配网锁,0:关闭,1:开启 | 0 |
设备返回信息
设备向服务端订阅topic上报消息
{
"bssid" : "742ad779046",
"commandName" : "setting-wifi-lock",
"ip" : "192.168.122.119 ",
"key" : 0,
"keyLock" : 0,
"mac" : "4CEBD60BFD62",
"messageId" : "202201241610366046",
"onState" : 1,
"signal" : -75,
"source" : "command",
"ssid" : "GemeOpen",
"timerEnable" : 1,
"timerInterval" : 15,
"type" : "GSPM1B2",
"version" : "4.1_1.1.1",
"wifiLock" : 0
}
"bssid" : "742ad779046",
"commandName" : "setting-wifi-lock",
"ip" : "192.168.122.119 ",
"key" : 0,
"keyLock" : 0,
"mac" : "4CEBD60BFD62",
"messageId" : "202201241610366046",
"onState" : 1,
"signal" : -75,
"source" : "command",
"ssid" : "GemeOpen",
"timerEnable" : 1,
"timerInterval" : 15,
"type" : "GSPM1B2",
"version" : "4.1_1.1.1",
"wifiLock" : 0
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | bssid | String | 路由器 MAC 地址 | 742ad779046 |
| 2 | commandName | String | 指令名称 | setting-wifi-lock |
| 3 | ip | String | 设备连接WIFI后获取的IP | 192.168.122.119 |
| 4 | key | int | 插座通断电状态,0:断电,1:通电 | 0 |
| 5 | keyLock | int | 按键锁,0:关闭,1:开启 | 0 |
| 6 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| 7 | messageId | String | 消息ID字段 | 202201241610366046 |
| 8 | onState | int | 设备上电的默认状态: 0:记忆;是指记忆最后一次设备断电前的状态,如断电前设备是通电状态(指示灯是蓝的),设备下次上电默认是通电状态(指示灯是蓝的)。 1:关闭,即断电状态(指示灯是灭的),如断电前,设备是通电状态(指示灯是蓝的),设备下次上电默认是依旧是断电状态(指示灯是灭的)。需要手动/远程开启通电状态。 2:开启,即通电状态(指示灯是蓝色的),是指设备上电之后,默认是通电状态,此刻需要注意,插在设备上的负载会通电运行,会有安全风险,所以建议是默认上电状态为关闭。 | 1 |
| 9 | signal | int | 信号强度,显示规则为: signal<= 0 && signal>= -50 //信号最好 signal< -50 && signal>= -70 //信号较好 signal< -70 && signal>= -80 //信号一般 signal<-80 && signal>= -100 //信号较差 signal没有在0~(-100)之间,表示无信号 | -75 |
| 10 | source | String | 指令回复“command" | command |
| 11 | ssid | String | 设备当前连接的WIFI名称 | GemeOpen |
| 12 | timerEnable | int | 设备统计信息定时上报状态,0:关闭;1:开启 | 1 |
| 13 | timerInterval | int | 设备统计信息上报时间间隔(单位秒),取值范围5-86400 | 15 |
| 14 | type | String | 设备类型 | GSPM1B2 |
| 15 | version | String | 当前固件版本号 | 4.1_1.1.1 |
| 16 | wifiLock | int | 配网锁,0:关闭,1:开启 | 0 |









