# 延长线智能插座 计量通断 10A-WiFi版 (型号:GSPE1B) - 开发者指令
## 产品基本描述
本设备是一款支持二次开发的延长线智能插座,220V工作电压,10A输入电流,最大负载2500W,计量通断款支持远程控制设备通断电及用电数据监测采集,可在医疗、实验室/工厂车间等多种场景使用。
2.4GHz WiFi 通信方式,可在内网、专网环境使用。支持MQTT/TCP协议连接,用户只需几行指令就能远程控制设备。用户还可通过API接口调用进行自定义应用程序和系统集成,接入到自建业务系统;阿里云、腾讯云、华为云等第三方物联网云平台;ThingsBoard平台及HomeAssistant等。
2.4GHz WiFi 通信方式,可在内网、专网环境使用。支持MQTT/TCP协议连接,用户只需几行指令就能远程控制设备。用户还可通过API接口调用进行自定义应用程序和系统集成,接入到自建业务系统;阿里云、腾讯云、华为云等第三方物联网云平台;ThingsBoard平台及HomeAssistant等。
## 产品主要特点
WiFi网络,
远程通断,电流/电压/视在功率电量采集
AC110-250V,宏发继电器
最大阻性负载2500W
小巧不占位
远程通断,电流/电压/视在功率电量采集
AC110-250V,宏发继电器
最大阻性负载2500W
小巧不占位
## 产品图
<https://smart-bird-oss.smart-bird.cn/images/2026/09/16/1603482659098008.png>
<https://smart-bird-oss.smart-bird.cn/images/2026/09/16/160357406697074.png>
<https://smart-bird-oss.smart-bird.cn/images/2026/09/16/1604044602394849.png>
<https://smart-bird-oss.smart-bird.cn/images/2025/07/24/1123586396228069.png>
<https://smart-bird-oss.smart-bird.cn/images/2025/07/24/1124016184475479.png>
## 官网产品资料
### 品牌信息说明
品牌LOGO <https://smart-bird-oss.smart-bird.cn/images/2026/02/18/1722133698642421.png>
智鸟科技GemeOpen专注为软件开发者提供商用智能设备,软件工程师通过简单的测试即可完成项目设备选型,使用标准的MQTT/TCP协议,发送JSON指令控制设备通断电、查询设备用电信息。能够极大节省项目实施时间与自研设备风险,与厂商云解耦,搭建私有化MQTT服务,完全掌控设备且无任何捆绑与隐性成本!
### 如何购买产品
全网搜索 智鸟科技、GemeOpen 可查询官网信息,或者 京东搜索 **GEMEOPEN官方旗舰店** 、淘宝搜索 **GemeOpen** 、 **智鸟科技**
### 产品详细信息
<https://www.smart-bird.cn/Short-term%20socket-10A.html>
### 淘宝购买网址
<>
### 京东购买网址
<null>
### 开发者文档
<https://www.smart-bird.cn/doc/product/GSPE/device/GSPE1B/command>
## 客户常见问题
### 设备可以连接到自己的阿里云服务器吗,数据不需要通过您那边中转吧?
是的,配置MQTT参数,即可连接到指定的服务器,数据完全不经过厂商
### 二次开发对接要额外收费吗?
不收费。接入自己的平台没有额外费用。
### 自定义 MQTT 配置好了为什么不生效?
自定义 MQTT 必须重启设备后才生效(拔插电源,或在配置首页点「重新启动」)。只在配置页点保存不会生效。
### 设备是否支持连接TSL加密服务器?是否支持mqtts?
该功能正在研发中,即将更新。可在自定义 MQTT 中配置 mqtts / TLS 加密连接,端口与证书参数按开发文档设置,配置后重启设备生效。
### 为什么控制台上一直显示设备离线/未激活?
请先确认:
1、设备是否已经配置了单频的2.4G WiFi,或者4G物联网卡是否正常;
2、是否进行过自定义MQTT操作,自定义MQTT的设备会和控制台MQTT断开连接,此时控制台显示设备离线或未激活是正常的
### 支持二次开发写入我们自己内部的运维平台吗?
支持。设备开放 MQTT / TCP协议与指令文档,可直接连接用户自有服务器平台,接入不收取额外费用。
### 能接入哪些系统或平台?支持接入米家/华为生态/涂鸦吗?
1、【支持】自建服务器 / 自建平台:你自己的 MQTT Broker(Mosquitto、EMQX、HiveMQ 等)+ 自研业务系统;
2、【支持】第三方物联网云平台:阿里云 IoT、华为云 IoT、腾讯云 IoT等;
3、【支持】开源 / 第三方平台:ThingsBoard、Home Assistant、
4、【不支持】暂不支持接入米家、华为 HiLink、涂鸦等第三方公有生态;
总结:设备面向开发者免费开放MQTT/TCP协议,适合接入自建平台做深度集成。
### 可不可以连接我们的内网服务器?
可以。
1、WiFi设备:连接您的内网WiFi后,自定义 MQTT 直连您的内网服务器;
2、4G设备:可安装使用您自己专网卡,自定义MQTT后直连您的内网服务器。
配置完成后重启设备生效,数据不经过厂商。
### 能不能按我提供的MQTT信息批量写入到设备里?
支持。可联系工作人员获取批量配置表格。在表单内填写您的服务器参数信息后,由技术人员上传表格至智鸟ERP系统生效。
后续我们还将提供客户运维管理系统(vip.smart-bird.cn),企业客户可通过该平台自己批量维护。
### 是否需要连接网关?
不需要。设备WiFi/4G正常通信后,通过协议直连您的服务器平台,无需网关。
### 支持API调用吗?
可通过HTTP调用GemeOpen控制台接口。控制台仅供用户测试使用,不能保证稳定性,常会因为其他用户极限测试,影响平台设备正常使用。
如果您是做商用项目,建议通过MQTT/TCP接入您自己搭建的服务器平台,更稳定,更便于后续二次开发。
### 我们是做商用项目的,GemeOpen可不可以提供中性产品?
开关、插座类强制认证过的产品,不支持提供中性产品。所有信息均在认证机构做过照片备案,无法修改。
其他非强制认证类产品,外壳支持自定义打标,可修改为用户自有品牌型号信息。
### 自定义mqtt后,客户端发布消息,为什么收不到订阅回复?
常见原因:
①订阅/发布的主题与开发文档定义不一致,可尝试将订阅主题发布主题交换位置填写;
②修改自定义 MQTT 后未重启设备;
③服务器参数填写错误,服务器端 ACL 未放行。
## 产品电气参数
---
| 参数名 | 参数值 |
|------|------|
| 品牌 | GemeOpen |
| 上市日期 | 预计2026年6月 |
| 产品类型 | 延长线智能插座 计量通断 10A-WiFi版 |
| 产品型号 | GSPE1B |
| 外观尺寸 | 46mm*252mm*32mm |
| 输入电压 | 85Vac-265Vac |
| 最大负载电流 | 10A |
| 额定功率 | MAX 2500W |
| 待机功率 | <3W |
| 工作温度 | -5℃ ~ +40℃ |
| 通信方式 | 2.4GHz WiFi |
| 通讯模块 | 乐鑫ESP32 |
| 控制协议 | MQTT、TCP、HTTP、蓝牙 |
| 3C证书编号 | 2026010201897355 |
---
## 全部指令
### 设备通断控制
*controller-event*
通断器、空开、10A-86插座、16A-86插座、10A转换器插座、16A转换器插座等单路设备的通电或断电操作
**向设备发送指令(服务端向设备订阅topic发送消息)**
```json
{
"key" : 1,
"messageId" : "geekopen1234",
"type" : "event"
}
"key" : 1,
"messageId" : "geekopen1234",
"type" : "event"
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
| key | int | 继电器通断电状态,0:断电,1:通电 | 1 |
| messageId | String | 如果发送json中,发送了messageId,返回的json中就返回发送时确定的值,如果发送json中没有值,此处为空 | geekopen1234 |
| type | String | 控制继电器通断,固定传"event" | event |
---
**设备返回信息(设备向服务端订阅topic上报消息)**
```json
{
"ip" : "192.168.1.200",
"key" : 1,
"mac" : "28372fcbbbb8",
"messageId" : "geekopen1234",
"onState" : 1,
"signal" : -75,
"ssid" : "GemeOpen",
"timerEnable" : 1,
"type" : "event",
"version" : "v1.01",
"wifiLock" : 0
}
"ip" : "192.168.1.200",
"key" : 1,
"mac" : "28372fcbbbb8",
"messageId" : "geekopen1234",
"onState" : 1,
"signal" : -75,
"ssid" : "GemeOpen",
"timerEnable" : 1,
"type" : "event",
"version" : "v1.01",
"wifiLock" : 0
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
| ip | String | 设备连接WIFI后获取的IP | 192.168.1.200 |
| key | int | 继电器通断电状态,0:断电,1:通电 | 1 |
| mac | String | 设备MAC,唯一标识 | 28372fcbbbb8 |
| messageId | String | 如果发送json中,发送了messageId,返回的json中就返回发送时确定的值,如果发送json中没有值,此处为空 | geekopen1234 |
| onState | int | 设备上电的默认状态,0:记忆;1:关闭;2:开启,即通电,默认=1 | 1 |
| signal | int | 信号强度,显示规则为: signal<= 0 && signal>= -50
//信号最好 signal< -50 && signal>= -70
//信号较好 signal< -70 && signal>= -80
//信号一般 signal<-80 && signal>= -100
//信号较差 signal没有在0~(-100)之间,表示无信号 | -75 |
| ssid | String | 设备当前连接的WIFI名称 | GemeOpen |
| timerEnable | int | 设备电量信息定时上报状态,0:关闭;1:开启 | 1 |
| type | String | 控制继电器通断,固定返回"event" | event |
| version | String | 当前固件版本号 | v1.01 |
| wifiLock | int | 配网锁,0:关闭,1:开启 | 0 |
---
### 重置/恢复出厂设置
*controller-reset*
恢复出厂设置后配网信息和自定义信息都会清空,请谨慎操作!
**向设备发送指令(服务端向设备订阅topic发送消息)**
```json
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
| messageId | String | 消息ID字段 | 202201241610366046 |
| system | String | 重置/恢复出厂设置默认填"reset" | reset |
| type | String | 设备设置固定传”setting" | setting |
---
**设备返回信息(设备向服务端订阅topic上报消息)**
```json
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
| commandName | String | 指令名称 | controller-reset |
| mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| message | String | 执行返回结果 | ok |
| messageId | String | 消息ID字段 | 202201241610366046 |
| source | String | 指令回复“command" | command |
| success | boolean | 执行结果 | true |
---
### 设备软重启
*controller-restart*
该指令主要用于使需重启生效的配置生效(如自定义MQTT/TCP/HTTP,设置静态IP,设置WiFi信息等),重启后设备自动恢复,重新联网,已保存配置和数据不丢失。
**向设备发送指令(服务端向设备订阅topic发送消息)**
```json
{
"messageId" : "202201241610366046",
"system" : "restart",
"type" : "setting"
}
"messageId" : "202201241610366046",
"system" : "restart",
"type" : "setting"
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
| messageId | String | 消息ID字段 | 202201241610366046 |
| system | String | 设备软重启固定传"restart" | restart |
| type | String | 设备设置固定传"setting" | setting |
---
**设备返回信息(设备向服务端订阅topic上报消息)**
```json
{
"commandName" : "controller-restart",
"mac" : "4CEBD60BFD62",
"message" : "ok",
"messageId" : "202201241610366046",
"source" : "command",
"success" : true
}
"commandName" : "controller-restart",
"mac" : "4CEBD60BFD62",
"message" : "ok",
"messageId" : "202201241610366046",
"source" : "command",
"success" : true
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
| commandName | String | 指令名称 | controller-restart |
| mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| message | String | 执行返回结果 | ok |
| messageId | String | 消息ID字段 | 202201241610366046 |
| source | String | 指令回复“command" | command |
| success | boolean | 执行结果 | true |
---
### 设置定时上报任务
*device-timer-interval*
设置定时上报电量信息
**向设备发送指令(服务端向设备订阅topic发送消息)**
```json
{
"messageId" : "202201241610366046",
"timerEnable" : 1,
"timerInterval" : 15,
"type" : "setting"
}
"messageId" : "202201241610366046",
"timerEnable" : 1,
"timerInterval" : 15,
"type" : "setting"
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
| messageId | String | 消息ID字段 | 202201241610366046 |
| timerEnable | int | 设备电量信息定时上报状态,0:关闭;1:开启 | 1 |
| timerInterval | int | 电量信息上报时间间隔(单位秒),取值范围5-86400 | 15 |
| type | String | 设备设置固定传"setting" | setting |
---
**设备返回信息(设备向服务端订阅topic上报消息)**
```json
{
"commandName" : "device-timer-interval",
"ip" : "192.168.122.119",
"key" : 0,
"keyLock" : 0,
"mac" : "4CEBD60BFD62",
"messageId" : "202201241610366046",
"onState" : 1,
"signal" : -75,
"source" : "command",
"ssid" : "GemeOpen",
"timerEnable" : 1,
"type" : "GSPE1B",
"version" : "1.1.2",
"wifiLock" : 0
}
"commandName" : "device-timer-interval",
"ip" : "192.168.122.119",
"key" : 0,
"keyLock" : 0,
"mac" : "4CEBD60BFD62",
"messageId" : "202201241610366046",
"onState" : 1,
"signal" : -75,
"source" : "command",
"ssid" : "GemeOpen",
"timerEnable" : 1,
"type" : "GSPE1B",
"version" : "1.1.2",
"wifiLock" : 0
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
| commandName | String | 指令名称 | device-timer-interval |
| ip | String | 设备连接WIFI后获取的IP | 192.168.122.119 |
| key | int | 插座通断电状态,0:断电,1:通电 | 0 |
| keyLock | int | 按键锁,0:关闭,1:开启 | 0 |
| mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| messageId | String | 消息ID字段 | 202201241610366046 |
| onState | int | 设备上电的默认状态:
0:记忆;是指记忆最后一次设备断电前的状态,如断电前设备是通电状态(指示灯是蓝的),设备下次上电默认是通电状态(指示灯是蓝的)。
1:关闭,即断电状态(指示灯是灭的),如断电前,设备是通电状态(指示灯是蓝的),设备下次上电默认是依旧是断电状态(指示灯是灭的)。需要手动/远程开启通电状态。
2:开启,即通电状态(指示灯是蓝色的),是指设备上电之后,默认是通电状态,此刻需要注意,插在设备上的负载会通电运行,会有安全风险,所以建议是默认上电状态为关闭。 | 1 |
| signal | int | 信号强度,显示规则为: signal<= 0 && signal>= -50
//信号最好 signal< -50 && signal>= -70
//信号较好 signal< -70 && signal>= -80
//信号一般 signal<-80 && signal>= -100
//信号较差 signal没有在0~(-100)之间,表示无信号 | -75 |
| source | String | 指令回复“command" | command |
| ssid | String | 设备当前连接的WIFI名称 | GemeOpen |
| timerEnable | int | 设备电量信息定时上报状态,0:关闭;1:开启 | 1 |
| type | String | 设备类型 | GSPE1B |
| version | String | 当前固件版本号 | 1.1.2 |
| wifiLock | int | 配网锁,0:关闭,1:开启 | 0 |
---
### 自动上报任务(定时上报)
*device-timer-task*
此项非主动下发的指令,只展示用户开启定时上报任务后,定时返回的消息样式
**向设备发送指令(服务端向设备订阅topic发送消息)**
```json
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
---
**设备返回信息(设备向服务端订阅topic上报消息)**
```json
{
"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
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
| commandName | String | 指令名称 | device-timer-interval |
| current | float | 当前电流,单位A,保留三位小数 | 15.027 |
| energy | float | 累计用电量,单位KW*H,保留三位小数,断电后不会归零,重置后会归零 | 25.047 |
| key | int | 设备通断电状态,0:断电,1:通电 | 0 |
| mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 2026bb16aa14 |
| power | float | 当前功率,单位W,保留三位小数 | 2921.511 |
| source | String | 指令回复“command" | command |
| voltage | float | 当前电压,单位V,保留三位小数 | 226.024
|
---
### 累计用电量清零
*energy-clear*
将设备累计用电量清零,清零后从零开始重新累计统计,仅清除累计用电量,不影响其他数据。清零为不可逆操作,清除后累计数据无法恢复!
**向设备发送指令(服务端向设备订阅topic发送消息)**
```json
{
"messageId" : "202201241610366046",
"system" : "energy-clear",
"type" : "setting"
}
"messageId" : "202201241610366046",
"system" : "energy-clear",
"type" : "setting"
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
| messageId | String | 消息ID字段 | 202201241610366046 |
| system | String | energy-clear 电量清零 | energy-clear |
| type | String | 设置设备固定传"setting" | setting |
---
**设备返回信息(设备向服务端订阅topic上报消息)**
```json
{
"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
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
| commandName | String | 指令名称 | energy-clear |
| mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| message | String | 执行返回结果 | ok |
| messageId | String | 消息ID字段 | 202201241610366046 |
| source | String | 指令回复“command" | command |
| success | boolean | 执行结果 | true |
---
### 获取设备信息
*info-all*
包含设备的网络状态、继电器状态、自动上报设置、版本号等信息
**向设备发送指令(服务端向设备订阅topic发送消息)**
```json
{
"messageId" : "Abcd123456",
"type" : "info"
}
"messageId" : "Abcd123456",
"type" : "info"
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
| messageId | String | 如果发送json中,发送了messageId,返回的json中就返回发送时确定的值,如果发送json中没有值,此处为空 | Abcd123456 |
| type | String | 获取设备基本信息固定传"info" | info |
---
**设备返回信息(设备向服务端订阅topic上报消息)**
```json
{
"ip" : "192.168.122.119",
"key" : 1,
"keyLock" : 0,
"mac" : "4CEBD60BFD62",
"messageId" : "Abcd123456",
"onState" : 0,
"signal" : -47,
"ssid" : "GemeOpen",
"timerEnable" : 1,
"type" : "GSPE1B",
"version" : "1.2.3",
"wifiLock" : 0
}
"ip" : "192.168.122.119",
"key" : 1,
"keyLock" : 0,
"mac" : "4CEBD60BFD62",
"messageId" : "Abcd123456",
"onState" : 0,
"signal" : -47,
"ssid" : "GemeOpen",
"timerEnable" : 1,
"type" : "GSPE1B",
"version" : "1.2.3",
"wifiLock" : 0
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
| ip | String | 设备连接WIFI后获取的IP | 192.168.122.119 |
| key | int | 插座通断电状态,0:断电,1:通电 | 1 |
| keyLock | int | 按键锁,0:关闭,1:开启 | 0 |
| mac | String | 设备MAC,唯一标识 | 4CEBD60BFD62 |
| messageId | String | 如果发送json中,发送了messageId,返回的json中就返回发送时确定的值,如果发送json中没有值,此处为空 | Abcd123456 |
| onState | int | 设备上电的默认状态,0:记忆;1:关闭;2:开启,即通电,默认=1 | 0 |
| signal | int | 设备网络信号强度, | -47 |
| ssid | String | 设备当前连接的WIFI名称 | GemeOpen |
| timerEnable | int | 设备电量信息定时上报状态,0:关闭;1:开启 | 1 |
| type | String | 设备类型 | GSPE1B |
| version | String | 当前固件版本号 | 1.2.3 |
| wifiLock | int | 配网锁,0:关闭,1:开启 | 0 |
---
### 获取设备通讯协议
*info-protocol*
获取当前设备与服务端交互的通信协议及协议配置参数,目前支持MQTT、TCP Client和HTTP Server(固件版本2.0.0以上支持),设备出厂时默认接入GemeOpen厂家MQTT测试服务器,免费提供客户调试使用,如需接入自己的服务器或使用其他协议,请自行搭建服务器。
**向设备发送指令(服务端向设备订阅topic发送消息)**
```json
{
"messageId" : "202201241610366046",
"type" : "protocol"
}
"messageId" : "202201241610366046",
"type" : "protocol"
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
| messageId | String | 消息ID字段 | 202201241610366046 |
| type | String | 获取设备通讯协议固定传protocol | protocol |
---
**设备返回信息(设备向服务端订阅topic上报消息)**
```json
{
"clientId" : "test-iot",
"messageId" : "202201241610366046",
"port" : "1883",
"protocol" : "MQTT",
"publish" : "/rqlMqR/GYofdXmMpHQa/8cce4e51e2c7/subscribe",
"server" : "broker.emqx.io",
"subscribe" : "/rqlMqR/GYofdXmMpHQa/8cce4e51e2c7/publish",
"username" : "admin"
}
"clientId" : "test-iot",
"messageId" : "202201241610366046",
"port" : "1883",
"protocol" : "MQTT",
"publish" : "/rqlMqR/GYofdXmMpHQa/8cce4e51e2c7/subscribe",
"server" : "broker.emqx.io",
"subscribe" : "/rqlMqR/GYofdXmMpHQa/8cce4e51e2c7/publish",
"username" : "admin"
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
| clientId | String | 自定义MQTT客户端ID注意:不可重复
| test-iot |
| messageId | String | 消息ID字段 | 202201241610366046 |
| port | String | 端口号 | 1883 |
| protocol | String | 协议类型,MQTT协议固定传"mqtt" | MQTT |
| publish | String | 自定义MQTT发布主题 注意:不可重复 | /rqlMqR/GYofdXmMpHQa/8cce4e51e2c7/subscribe |
| server | String | 自定义MQTT服务器地址 | broker.emqx.io |
| subscribe | String | 自定义设备MQTT订阅主题 注意:不可与发布主题重复 | /rqlMqR/GYofdXmMpHQa/8cce4e51e2c7/publish |
| username | String | 自定义MQTT服务器用户名 | admin |
---
### 获取实时用电信息
*info-statistic*
获取设备当前的运行状态与电气数据:开关状态、瞬时电流、瞬时电压、瞬时功率、累计用电量设备用电相关信息。
**向设备发送指令(服务端向设备订阅topic发送消息)**
```json
{
"messageId" : "202201241610366046",
"type" : "statistic"
}
"messageId" : "202201241610366046",
"type" : "statistic"
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
| messageId | String | 消息ID字段 | 202201241610366046 |
| type | String | 获取设备电量信息固定传"statistic" | statistic |
---
**设备返回信息(设备向服务端订阅topic上报消息)**
```json
{
"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
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
| commandName | String | 指令名称 | info-statistic |
| current | float | 当前电流,单位A,保留三位小数 | 15.027 |
| energy | float | 累计用电量,单位KW*H,保留三位小数,断电后不会归零,重置后会归零 | 25.047 |
| key | int | 插座通断电状态,0:断电,1:通电 | 0 |
| mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| messageId | String | 消息ID字段 | 202201241610366046 |
| power | float | 当前功率,单位W,保留三位小数 | 2921.511 |
| source | String | 指令回复“command" | command |
| voltage | float | 当前电压,单位V,保留三位小数 | 226.024 |
---
### 查询定时通断任务
*info-timer-task-query*
查询设备已设置的定时通断电任务列表及详情。
**向设备发送指令(服务端向设备订阅topic发送消息)**
```json
{
"action" : "timerTaskQuery",
"messageId" : "202201241610366046",
"type" : "event"
}
"action" : "timerTaskQuery",
"messageId" : "202201241610366046",
"type" : "event"
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
| action | String | 固定值timerTaskQuery | timerTaskQuery |
| messageId | String | 消息ID字段 | 202201241610366046 |
| type | String | 设备设置固定传"event" | event |
---
**设备返回信息(设备向服务端订阅topic上报消息)**
```json
{
"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"
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
| action | String | 固定值timerTaskQuery | timerTaskQuery |
| command | Object | 指令 | { "key":1, "type":"event" } |
| commandName | String | 指令名称 | info-timer-task-query |
| hour | int | 小时0~23 | 0 |
| list | List | list为列表,参数带year、month、day是定时按年月日时分执行一次,参数不带year、month、day则是每天按时分循环执行,发送指令不带list参数,则返回当前设备的list参数,key1、key2、key3含义同event指令 | |
| mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| messageId | String | 消息ID字段 | 202201241610366046 |
| minute | int | 分钟0~60 | 0 |
| number | int | 任务编号 | 1 |
| repeat | String | 重复week:按周重复,day:按天重复,oneof:一次任务 | week |
| source | String | 指令回复“command" | command |
| type | String | 设备设置固定传"event" | event |
---
### 自定义HTTP
*setting-http*
用于配置http回调地址,用来设备事件推送地址
**向设备发送指令(服务端向设备订阅topic发送消息)**
```json
{
"messageId" : "20260123",
"protocol" : "http",
"type" : "custom",
"url" : "http://192.168.0.240:8080"
}
"messageId" : "20260123",
"protocol" : "http",
"type" : "custom",
"url" : "http://192.168.0.240:8080"
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
| messageId | String | 消息ID字段 | 20260123 |
| protocol | String | 协议类型 | http |
| type | String | 消息类型 | custom |
| url | String | http回调地址 | http://192.168.0.240:8080 |
---
**设备返回信息(设备向服务端订阅topic上报消息)**
```json
{
"commandName" : "setting-http",
"mac" : "4CEBD60BFD62",
"messageId" : "20260123",
"protocol" : "http",
"source" : "command",
"url" : "http://192.168.0.240:8080"
}
"commandName" : "setting-http",
"mac" : "4CEBD60BFD62",
"messageId" : "20260123",
"protocol" : "http",
"source" : "command",
"url" : "http://192.168.0.240:8080"
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
| commandName | String | 指令名称 | setting-http |
| mac | String | wifi设备MAC地址,唯一标识 | 4CEBD60BFD62 |
| messageId | String | 消息ID字段 | 20260123 |
| protocol | String | 协议类型 | http |
| source | String | 消息来源,指令回复“command",自动上报"auto" | command |
| url | String | http回调地址 | http://192.168.0.240:8080 |
---
### 设置按键控制锁
*setting-key-lock*
功能按键锁定后,设备仅能通过MQTT/TCP协议操作,例如控制开关的通断、插座的通断电,都只能通过指令操作
**向设备发送指令(服务端向设备订阅topic发送消息)**
```json
{
"keyLock" : 0,
"messageId" : "202201241610366046",
"type" : "setting"
}
"keyLock" : 0,
"messageId" : "202201241610366046",
"type" : "setting"
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
| keyLock | int | 按键锁,0:关闭,1:开启 | 0 |
| messageId | String | 消息ID字段 | 202201241610366046 |
| type | String | 设备设置固定传’setting" | setting |
---
**设备返回信息(设备向服务端订阅topic上报消息)**
```json
{
"commandName" : "setting-key-lock",
"ip" : "192.168.122.119",
"key" : 0,
"mac" : "4CEBD60BFD62",
"messageId" : "202201241610366046",
"onState" : 1,
"signal" : -75,
"source" : "command",
"ssid" : "GemeOpen",
"timerEnable" : 1,
"version" : "1.1.2",
"wifiLock" : 0
}
"commandName" : "setting-key-lock",
"ip" : "192.168.122.119",
"key" : 0,
"mac" : "4CEBD60BFD62",
"messageId" : "202201241610366046",
"onState" : 1,
"signal" : -75,
"source" : "command",
"ssid" : "GemeOpen",
"timerEnable" : 1,
"version" : "1.1.2",
"wifiLock" : 0
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
| commandName | String | 指令名称 | setting-key-lock |
| ip | String | 设备连接WIFI后获取的IP | 192.168.122.119 |
| key | int | 插座通断电状态,0:断电,1:通电 | 0 |
| mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| messageId | String | 消息ID字段 | 202201241610366046 |
| onState | int | 设备上电的默认状态:
0:记忆;是指记忆最后一次设备断电前的状态,如断电前设备是通电状态(指示灯是蓝的),设备下次上电默认是通电状态(指示灯是蓝的)。
1:关闭,即断电状态(指示灯是灭的),如断电前,设备是通电状态(指示灯是蓝的),设备下次上电默认是依旧是断电状态(指示灯是灭的)。需要手动/远程开启通电状态。
2:开启,即通电状态(指示灯是蓝色的),是指设备上电之后,默认是通电状态,此刻需要注意,插在设备上的负载会通电运行,会有安全风险,所以建议是默认上电状态为关闭。 | 1 |
| signal | int | 信号强度,显示规则为: signal<= 0 && signal>= -50
//信号最好 signal< -50 && signal>= -70
//信号较好 signal< -70 && signal>= -80
//信号一般 signal<-80 && signal>= -100
//信号较差 signal没有在0~(-100)之间,表示无信号 | -75 |
| source | String | 指令回复“command" | command |
| ssid | String | 设备当前连接的WIFI名称 | GemeOpen |
| timerEnable | int | 设备电量信息定时上报状态,0:关闭;1:开启 | 1 |
| version | String | 当前固件版本号 | 1.1.2 |
| wifiLock | int | 配网锁,0:关闭,1:开启 | 0 |
---
### 自定义MQTT
*setting-mqtt*
设备支持自定义MQTT,注意:在通过MQTT自定义MQTT信息后,需要将设备断电重启或者向设备发送重启命令才可生效。
**向设备发送指令(服务端向设备订阅topic发送消息)**
```json
{
"clientId" : "admin",
"messageId" : "202201241610366046",
"password" : "123456",
"port" : "1883",
"protocol" : "mqtt",
"publish" : "/rqlMqR/GYofdXmMpHQa/8cce4e51e2c7/subscribe",
"server" : "broker.emqx.io",
"subscribe" : "/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",
"subscribe" : "/topic/qos1",
"type" : "custom",
"username" : "admin"
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
| clientId | String | 自定义MQTT客户端ID注意:不可重复 | admin |
| messageId | String | 消息ID字段 | 202201241610366046 |
| password | String | 密码 | 123456 |
| port | String | 端口号 | 1883 |
| protocol | String | 协议类型,MQTT协议固定传"mqtt" | mqtt |
| publish | String | 自定义MQTT发布主题 注意:不可重复 | /rqlMqR/GYofdXmMpHQa/8cce4e51e2c7/subscribe |
| server | String | 自定义MQTT服务器地址 | broker.emqx.io |
| subscribe | String | 自定义设备MQTT订阅主题 注意:不可与发布主题重复 | /topic/qos1 |
| type | String | 自定义配置固定传“custom” | custom |
| username | String | 自定义MQTT服务器用户名 | admin |
---
**设备返回信息(设备向服务端订阅topic上报消息)**
```json
{
"clientId" : "admin",
"messageId" : "202201241610366046",
"password" : "123456",
"port" : "1883",
"protocol" : "mqtt",
"publish" : "/rqlMqR/GYofdXmMpHQa/8cce4e51e2c7/subscribe",
"server" : "broker.emqx.io",
"subscribe" : "/topic/qos1",
"username" : "admin"
}
"clientId" : "admin",
"messageId" : "202201241610366046",
"password" : "123456",
"port" : "1883",
"protocol" : "mqtt",
"publish" : "/rqlMqR/GYofdXmMpHQa/8cce4e51e2c7/subscribe",
"server" : "broker.emqx.io",
"subscribe" : "/topic/qos1",
"username" : "admin"
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
| clientId | String | 自定义MQTT客户端ID注意:不可重复
| admin |
| messageId | String | 消息ID字段 | 202201241610366046 |
| password | String | 密码 | 123456 |
| port | String | 端口号 | 1883 |
| protocol | String | 协议类型,MQTT协议固定传"mqtt" | mqtt |
| publish | String | 自定义MQTT发布主题 注意:不可重复 | /rqlMqR/GYofdXmMpHQa/8cce4e51e2c7/subscribe |
| server | String | 自定义MQTT服务器地址 | broker.emqx.io |
| subscribe | String | 自定义设备MQTT订阅主题 注意:不可与发布主题重复 | /topic/qos1 |
| username | String | 自定义MQTT服务器用户名 | admin |
---
### 设置上电默认状态
*setting-on-state*
配置设备断电恢复后输出的默认状态,即断电恢复瞬间设备是通电还是断电。
**向设备发送指令(服务端向设备订阅topic发送消息)**
```json
{
"messageId" : "202201241610366046",
"onState" : 1,
"type" : "setting"
}
"messageId" : "202201241610366046",
"onState" : 1,
"type" : "setting"
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
| messageId | String | 消息ID字段 | 202201241610366046 |
| onState | int | 设备上电的默认状态:
0:记忆;是指记忆最后一次设备断电前的状态,如断电前设备是通电状态(指示灯是蓝的),设备下次上电默认是通电状态(指示灯是蓝的)。
1:关闭,即断电状态(指示灯是灭的),如断电前,设备是通电状态(指示灯是蓝的),设备下次上电默认是依旧是断电状态(指示灯是灭的)。需要手动/远程开启通电状态。
2:开启,即通电状态(指示灯是蓝色的),是指设备上电之后,默认是通电状态,此刻需要注意,插在设备上的负载会通电运行,会有安全风险,所以建议是默认上电状态为关闭。 | 1 |
| type | String | 设备设置固定传"setting" | setting |
---
**设备返回信息(设备向服务端订阅topic上报消息)**
```json
{
"commandName" : "setting-on-state",
"ip" : "192.168.122.119",
"key" : 0,
"keyLock" : 0,
"mac" : "4CEBD60BFD62",
"messageId" : "202201241610366046",
"signal" : -75,
"source" : "command",
"ssid" : "GemeOpen",
"timerEnable" : 1,
"version" : "1.1.2",
"wifiLock" : 0
}
"commandName" : "setting-on-state",
"ip" : "192.168.122.119",
"key" : 0,
"keyLock" : 0,
"mac" : "4CEBD60BFD62",
"messageId" : "202201241610366046",
"signal" : -75,
"source" : "command",
"ssid" : "GemeOpen",
"timerEnable" : 1,
"version" : "1.1.2",
"wifiLock" : 0
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
| commandName | String | 指令名称 | setting-on-state |
| ip | String | 设备连接WIFI后获取的IP | 192.168.122.119 |
| key | int | 插座通断电状态,0:断电,1:通电 | 0 |
| keyLock | int | 按键锁,0:关闭,1:开启 | 0 |
| mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| messageId | String | 消息ID字段 | 202201241610366046 |
| signal | int | 信号强度,显示规则为: signal<= 0 && signal>= -50
//信号最好 signal< -50 && signal>= -70
//信号较好 signal< -70 && signal>= -80
//信号一般 signal<-80 && signal>= -100
//信号较差 signal没有在0~(-100)之间,表示无信号 | -75 |
| source | String | 指令回复“command" | command |
| ssid | String | 设备当前连接的WIFI名称 | GemeOpen |
| timerEnable | int | 设备电量信息定时上报状态,0:关闭;1:开启 | 1 |
| version | String | 当前固件版本号 | 1.1.2 |
| wifiLock | int | 配网锁,0:关闭,1:开启 | 0 |
---
### 自定义TCP参数
*setting-tcp*
设置设备的 TCP 服务器连接参数。设备仅支持 TCP Client 模式,设备作为客户端主动连接客户指定的 TCP 服务器。
**向设备发送指令(服务端向设备订阅topic发送消息)**
```json
{
"messageId" : "202201241610366046",
"port" : "1883",
"protocol" : "tcp",
"server" : "192.168.0.66",
"type" : "custom"
}
"messageId" : "202201241610366046",
"port" : "1883",
"protocol" : "tcp",
"server" : "192.168.0.66",
"type" : "custom"
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
| messageId | String | 消息ID字段 | 202201241610366046 |
| port | String | 端口号 | 1883 |
| protocol | String | TCP协议固定传"tcp" | tcp |
| server | String | 自定义TCP服务器地址 | 192.168.0.66 |
| type | String | 设备自定义固定传"custom" | custom |
---
**设备返回信息(设备向服务端订阅topic上报消息)**
```json
{
"messageId" : "202201241610366046",
"port" : "1883",
"protocol" : "tcp",
"server" : "192.168.0.66"
}
"messageId" : "202201241610366046",
"port" : "1883",
"protocol" : "tcp",
"server" : "192.168.0.66"
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
| messageId | String | 消息ID字段 | 202201241610366046 |
| port | String | 端口号 | 1883 |
| protocol | String | TCP协议固定传"tcp" | tcp |
| server | String | 自定义TCP服务器地址 | 192.168.0.66 |
---
### 设置倒计时通断任务
*setting-timer-countdown*
设置倒计时任务——指定时长与到点动作(关闭/开启)。
**向设备发送指令(服务端向设备订阅topic发送消息)**
```json
{
"countdownSecond" : 10,
"finishCommand" :
{
"key" : 0,
"type" : "event"
},
"messageId" : "202201241610366046",
"task" : "countdown",
"timerInterval" : 1,
"type" : "setting"
}
"countdownSecond" : 10,
"finishCommand" :
{
"key" : 0,
"type" : "event"
},
"messageId" : "202201241610366046",
"task" : "countdown",
"timerInterval" : 1,
"type" : "setting"
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
| countdownSecond | int | 倒计时总时间 | 10 |
| finishCommand | Object | 完成任务 | |
| key | int | 插座通断电状态,0:断电,1:通电 | 0 |
| key | int | 插座通断电状态,0:断电,1:通电 | 0 |
| messageId | String | 消息ID字段 | 202201241610366046 |
| task | String | 固定值“countdown" | countdown |
| timerInterval | int | 倒计时信息上报时间间隔(单位秒),取值范围1-86400 | 1 |
| type | String | 设备设置固定传"setting" | setting |
| type | String | 设备设置固定传"event" | event |
| type | String | 设备设置固定传"event" | event |
---
**设备返回信息(设备向服务端订阅topic上报消息)**
```json
{
"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"
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
| commandName | String | 指令名称 | setting-timer-countdown |
| countdownSecond | int | 倒计时总时间 | 10
|
| finishCommand | Object | 完成任务 | |
| key | int | 插座通断电状态,0:断电,1:通电 | 0 |
| key | int | 插座通断电状态,0:断电,1:通电 | 0 |
| mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| messageId | String | 消息ID字段 | 202201241610366046 |
| source | String | 指令回复“command" | command |
| task | String | 固定值“countdown" | countdown |
| timerInterval | int | 倒计时信息上报时间间隔(单位秒),取值范围5-86400 | 20 |
| type | String | 设备设置固定传"setting" | setting |
| type | String | 设备设置固定传"event" | event |
| type | String | 设备设置固定传"event" | event |
---
### 倒计时任务自动上报
*setting-timer-countdown-active*
查看设备倒计时状态上报的 JSON 格式定义,供服务端对接解析设备上报的倒计时状态数据。上报频率由"设置倒计时任务"指令配置,配置后设备按周期将数据发布至约定主题(topic),设备端无订阅行为(仅发布),服务端订阅该发布主题后即可接收上报数据
**向设备发送指令(服务端向设备订阅topic发送消息)**
```json
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
---
**设备返回信息(设备向服务端订阅topic上报消息)**
```json
{
"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
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
| commandName | String | 指令名称 | setting-timer-countdown-active |
| countdownSecond | int | 倒计时总时间 | 10
|
| mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| remainingSecond | int | 倒计时剩余时间,单位S | 9 |
| source | String | 指令回复“command" | command |
| state | int | 任务状态:0:待启动,1:正在进行,2:结束 | 1 |
---
### 清除倒计时通断任务
*setting-timer-countdown-clear*
删除设备中已设置的单条定时通断电任务,删除为不可逆操作,删除后需重新设置。
**向设备发送指令(服务端向设备订阅topic发送消息)**
```json
{
"messageId" : "202201241610366046",
"task" : "countdown-clear",
"type" : "setting"
}
"messageId" : "202201241610366046",
"task" : "countdown-clear",
"type" : "setting"
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
| messageId | String | 消息ID字段 | 202201241610366046 |
| task | String | 固定值"countdown-clear" | countdown-clear |
| type | String | 设备设置固定传"setting" | setting |
---
**设备返回信息(设备向服务端订阅topic上报消息)**
```json
{
"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
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
| commandName | String | 指令名称 | setting-timer-countdown-clear |
| mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| message | String | 执行返回结果 | ok |
| messageId | String | 消息ID字段 | 202201241610366046 |
| source | String | 指令回复“command" | command |
| success | boolean | 执行结果 | true |
---
### 删除定时通断任务
*setting-timer-delete*
删除设备中已设置的单条定时通断电任务,删除为不可逆操作,删除后需重新设置。
**向设备发送指令(服务端向设备订阅topic发送消息)**
```json
{
"action" : "delete",
"messageId" : "202201241610366046",
"number" : 1,
"type" : "setting"
}
"action" : "delete",
"messageId" : "202201241610366046",
"number" : 1,
"type" : "setting"
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
| action | String | 固定值delete | delete |
| messageId | String | 消息ID字段 | 202201241610366046 |
| number | int | 任务编号 | 1 |
| type | String | 设备设置固定传"setting" | setting |
---
**设备返回信息(设备向服务端订阅topic上报消息)**
```json
{
"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
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
| commandName | String | 指令名称 | setting-timer-delete |
| mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| message | String | 执行返回结果 | ok |
| messageId | String | 消息ID字段 | 202201241610366046 |
| source | String | 指令回复“command" | command |
| success | boolean | 执行结果 | true |
---
### 设置定时通断任务
*setting-timer-task*
新增或编辑定时通断电任务,设置后到点执行开启/关闭操作。
**向设备发送指令(服务端向设备订阅topic发送消息)**
```json
{
"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"
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
| command | Object | 定时触发的事件,key为0,触发是断电;key为1,触发是通电 | 0 |
| hour | int | 小时0~23 | 0 |
| key | int | 插座通断电状态,0:断电,1:通电 | 0 |
| key | int | 插座通断电状态,0:断电,1:通电 | 0 |
| messageId | String | 消息ID字段 | 202201241610366046 |
| minute | int | 分钟0~60 | 0 |
| number | int | 任务编号 | 1 |
| repeat | String | week:按周重复,
day:按天重复
oneof:一次任务 | oneof |
| task | String | 固定值timer | timer |
| type | String | 设备设置固定传"setting" | setting |
| type | String | 设备设置固定传"event" | event |
| type | String | 设备设置固定传"event" | event |
---
**设备返回信息(设备向服务端订阅topic上报消息)**
```json
{
"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"
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
| command | Object | 指令 | |
| commandName | String | 指令名称 | setting-timer-task |
| hour | int | 小时0~23 | 0 |
| key | int | 插座通断电状态,0:断电,1:通电 | 0 |
| key | int | 插座通断电状态,0:断电,1:通电 | 0 |
| mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| messageId | String | 消息ID字段 | 202201241610366046 |
| minute | int | 分钟0~60 | 0 |
| number | int | 任务编号 | 1 |
| repeat | String | week:按周重复,
day:按天重复,
oneof:一次任务 | oneof |
| source | String | 指令回复“command" | command |
| type | String | 设备设置固定传"event" | event |
| type | String | 设备设置固定传"event" | event |
---
### 设置设备WiFi信息
*setting-wifi-config*
重启才会连接新设置的wifi信息<br/>
**向设备发送指令(服务端向设备订阅topic发送消息)**
```json
{
"password" : "123456",
"ssid" : "GemeOpen",
"type" : "setting"
}
"password" : "123456",
"ssid" : "GemeOpen",
"type" : "setting"
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
| password | String | 密码 | 123456 |
| ssid | String | 设备当前连接的WIFI名称 | GemeOpen |
| type | String | 设备设置固定传"setting" | setting |
---
**设备返回信息(设备向服务端订阅topic上报消息)**
```json
{
"commandName" : "setting-wifi-config",
"mac" : "4CEBD60BFD62",
"message" : "ok",
"source" : "command",
"success" : true
}
"commandName" : "setting-wifi-config",
"mac" : "4CEBD60BFD62",
"message" : "ok",
"source" : "command",
"success" : true
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
| commandName | String | 指令名称 | setting-wifi-config |
| mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| message | String | 执行返回结果 | ok |
| source | String | 指令回复“command" | command |
| success | boolean | 执行结果 | true |
---
### 设置WiFi静态IP
*setting-wifi-dhcpEnable*
设备默认为动态获取ip,通过该接口开启静态IP,需重启生效<br/>配置的静态IP需和路由器处于同一网段下<br/>
**向设备发送指令(服务端向设备订阅topic发送消息)**
```json
{
"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"
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
| dhcpEnable | int | 自动寻址1:开启, 0:关闭,默认开启 | 0 |
| dns | String | DNS服务器地址 | 192.168.0.1 |
| gateway | String | 默认网关 | 192.168.0.1 |
| local_ip | String | IP地址 | 192.168.0.118 |
| subnet | String | 子网掩码 | 255.255.255.0 |
| type | String | 设备设置固定传"setting" | setting |
---
**设备返回信息(设备向服务端订阅topic上报消息)**
```json
{
"commandName" : "setting-wifi-dhcpEnable",
"mac" : "4CEBD60BFD62",
"message" : "ok",
"source" : "command",
"success" : true
}
"commandName" : "setting-wifi-dhcpEnable",
"mac" : "4CEBD60BFD62",
"message" : "ok",
"source" : "command",
"success" : true
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
| commandName | String | 指令名称 | setting-wifi-dhcpEnable |
| mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| message | String | 执行返回结果 | ok |
| source | String | 指令回复“command" | command |
| success | boolean | 执行结果 | true |
---
### 设置WiFi配网锁
*setting-wifi-lock*
wifi配网锁定后,设备无法通过长按配网按钮进入配网操作,仅能通过MQTT/TCP协议解锁配网功能<br/>
**向设备发送指令(服务端向设备订阅topic发送消息)**
```json
{
"messageId" : "202201241610366046",
"type" : "setting",
"wifiLock" : 0
}
"messageId" : "202201241610366046",
"type" : "setting",
"wifiLock" : 0
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
| messageId | String | 消息ID字段 | 202201241610366046 |
| type | String | 设备设置固定传"setting" | setting |
| wifiLock | int | 配网锁,0:关闭,1:开启 | 0 |
---
**设备返回信息(设备向服务端订阅topic上报消息)**
```json
{
"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,
"version" : "1.2.3"
}
"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,
"version" : "1.2.3"
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
| commandName | String | 指令名称 | setting-wifi-lock |
| ip | String | 设备连接WIFI后获取的IP | 192.168.122.119 |
| key | int | 插座通断电状态,0:断电,1:通电 | 0 |
| keyLock | int | 按键锁,0:关闭,1:开启 | 0 |
| mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| messageId | String | 消息ID字段 | 202201241610366046 |
| onState | int | 设备上电的默认状态:
0:记忆;是指记忆最后一次设备断电前的状态,如断电前设备是通电状态(指示灯是蓝的),设备下次上电默认是通电状态(指示灯是蓝的)。
1:关闭,即断电状态(指示灯是灭的),如断电前,设备是通电状态(指示灯是蓝的),设备下次上电默认是依旧是断电状态(指示灯是灭的)。需要手动/远程开启通电状态。
2:开启,即通电状态(指示灯是蓝色的),是指设备上电之后,默认是通电状态,此刻需要注意,插在设备上的负载会通电运行,会有安全风险,所以建议是默认上电状态为关闭。 | 1 |
| signal | int | 信号强度,显示规则为: signal<= 0 && signal>= -50
//信号最好 signal< -50 && signal>= -70
//信号较好 signal< -70 && signal>= -80
//信号一般 signal<-80 && signal>= -100
//信号较差 signal没有在0~(-100)之间,表示无信号 | -75 |
| source | String | 指令回复“command" | command |
| ssid | String | 设备当前连接的WIFI名称 | GemeOpen |
| timerEnable | int | 设备电量信息定时上报状态,0:关闭;1:开启 | 1 |
| version | String | 当前固件版本号 | 1.2.3 |
---






