GemeOpen 智能转换器插座10A-S1 Plus-WiFi (型号:GSPM1B2) - 开发者指令
# 智能转换器插座10A-S1 Plus-WiFi (型号:GSPM1B2) - 开发者指令
## 产品基本描述
主控芯片升级为ESP32,增加过零检测
## 产品主要特点
热销10000+稳定可靠
WiFi网络,电流电压视在功率电量采集
AC110-250V,最大负载电流10A
WiFi网络,电流电压视在功率电量采集
AC110-250V,最大负载电流10A
## 官网产品资料
### 产品详细信息
https://www.smart-bird.cn/smart-plug-mini.html
### 淘宝购买网址
https://item.taobao.com/item.htm?ft=t&id=728813143446
### 京东购买网址
### 开发者文档
https://www.smart-bird.cn/doc/product/GSPM/device/GSPM1B2/command
## 产品电气参数
---
| 参数名 | 参数值 |
|------|------|
|
品牌
| GemeOpen
|
|
上市日期
| 2025年
|
|
产品类型
| 智能转换器插座10A-S1 Plus-WiFi
|
|
产品型号
| GSPM1B2
|
|
产品尺寸
| 49mm*59mm*28mm
|
|
输入电压
| AC 85~265V
|
|
最大负载电流
| 10A
|
|
额定功率
| MAX 2500W
|
|
待机功率
| <3W
|
|
继电器
| 16A宏发继电器 HF32FV-16
|
|
工作温度
| -5℃ ~ +40℃
|
|
通讯方式
| 2.4GHz WiFi
|
|
通讯模块
| 乐鑫ESP32
|
|
传输距离
| 物联网云平台可全球远程控制
|
|
屏幕显示
| 无
|
|
3C证书编号
| 2025010201786528
|
---
## 控制采集
### 远程控制设备通断电
*controller-event*
远程控制设备的通断电状态(通电/断电),指令执行后,设备立即切换继电器状态。
**向设备发送指令(服务端向设备订阅topic发送消息)**
```json
{
"key" : 0,
"messageId" : "202201241610366046",
"type" : "event"
}
"key" : 0,
"messageId" : "202201241610366046",
"type" : "event"
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
|
key
| int
| 插座通断电状态,0:断电,1:通电
| 0
|
|
messageId
| String
| 消息ID字段
| 202201241610366046
|
|
type
| String
| 控制设备开关固定传"event"
| event
|
---
**设备返回信息(设备向服务端订阅topic上报消息)**
```json
{
"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
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
|
bssid
| String
| 路由器 MAC 地址
| 742ad779046
|
|
commandName
| String
| 指令名称
| controller-event
|
|
ip
| String
| 设备连接WIFI后获取的IP
| 192.168.1.200
|
|
key
| int
| 继电器通断电状态,0:断电,1:通电
| 1
|
|
keyLock
| int
| 按键锁,0:关闭,1:开启
| 0
|
|
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
|
|
source
| String
| 指令回复“command"
| command
|
|
ssid
| String
| 设备当前连接的WIFI名称
| GemeOpen
|
|
timerEnable
| int
| 设备电量信息定时上报状态,0:关闭;1:开启
| 1
|
|
timerInterval
| int
| 电量信息上报时间间隔(单位秒),取值范围5-86400
| 15
|
|
type
| String
| 控制继电器通断,固定返回"event"
| event
|
|
version
| String
| 当前固件版本号
| 4.1_1.1.1
|
|
wifiLock
| int
| 配网锁,0:关闭,1:开启
| 0
|
---
### 设置用电数据上报频率
*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
{
"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"
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
|
bssid
| String
| 路由器 MAC 地址
| 742ad779046
|
|
code
| String
| 设备型号代码
| GSCW1B-4G
|
|
commandName
| String
| 指令名称
| device-timer-interval
|
|
iccid
| String
| SIM-卡ICCID值
| 89861125208093419602
|
|
imei
| String
| 设备唯一标识
| 866965087693583
|
|
ip
| String
| 设备连接WIFI后获取的IP
| 192.168.122.119
|
|
key
| int
| 插座通断电状态,0:断电,1:通电
| 0
|
|
key2
| 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
|
|
resetLock
| int
| 重置锁,0:关闭,1:开启
| 0
|
|
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
|
|
timerInterval
| int
| 设备统计信息上报时间间隔(单位秒),取值范围5-86400
| 15
|
|
type
| String
| 设备类型
| GSPM1B2
|
|
version
| String
| 当前固件版本号
| 4.1_1.1.1
|
|
wifiLock
| int
| 配网锁,0:关闭,1:开启
| 0
|
---
### 用电数据定时上报
*device-timer-task*
查看设备定时上报数据的 JSON 格式,供服务器端对接解析设备上报的数据。是否上报与上报频率由"设置数据定时上报频率"指令配置,配置后设备按周期将数据发布至约定主题(topic),设备端无订阅行为(仅发布),服务端订阅该发布主题后即可接收上报数据。
**向设备发送指令(服务端向设备订阅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
|
---
### 获取设备基础信息
*info-all*
查询当前设备的基础信息,如设备MAC地址、设备型号、固件版本号、当前连接的WiFi名称(ssid)、当前设备被分配的IP地址、WiFi信号强度及相关配置信息。<br/>
**向设备发送指令(服务端向设备订阅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" : "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
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
|
ip
| String
| 设备连接WIFI后获取的IP
| 192.168.122.119
|
|
key
| int
| 设备通断电状态,0:断电,1:通电
| 1
|
|
keyLock
| int
| 按键锁,0:关闭,1:开启
| 0
|
|
mac
| String
| wifi设备MAC地址或4G设备的IMEI号,唯一标识
| 4CEBD60BFD62
|
|
messageId
| String
| 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。
| Abcd123456
|
|
onState
| int
| 设备上电的默认状态,0:记忆;1:关闭;2:开启,即通电,默认=1
| 0
|
|
signal
| int
| 设备网络信号强度,
| -47
|
|
ssid
| String
| 设备当前连接的WIFI名称
| GeekOpen
|
|
timerEnable
| int
| 设备统计信息定时上报状态,0:关闭;1:开启
| 1
|
|
type
| String
| 固定值"xxx"
| Socket-86
|
|
version
| String
| 当前固件版本号
| 1.2.3
|
|
wifiLock
| int
| 配网锁,0:关闭,1:开启
| 0
|
---
### 获取设备用电信息
*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
|
---
### 设置倒计时通断任务
*setting-timer-countdown*
设置倒计时任务——指定时长与到点动作(关闭/开启)。
**向设备发送指令(服务端向设备订阅topic发送消息)**
```json
{
"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"
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
|
countdownSecond
| int
| 倒计时总时长(秒),必须大于 0,最大86400
| 10
|
|
finishCommand
| Object
| 倒计时结束后自动执行的任务
| |
|
key
| int
| 插座通断电状态,0:断电,1:通电
| 0
|
|
key
| int
| 插座通断电状态,0:断电,1:通电
| 0
|
|
key
| int
| 设备通断电状态,0:断电,1:通电
| 0
|
|
messageId
| String
| 消息ID字段
| 202201241610366046
|
|
task
| String
| 固定值“countdown"
| countdown
|
|
timerInterval
| int
| 倒计时信息上报时间间隔(单位秒),取值范围1-86400
| 20
|
|
type
| String
| 设备设置固定传"setting"
| setting
|
|
type
| String
| 设备设置固定传"event"
| event
|
|
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
| 倒计时总时长(秒),必须大于 0
| 10
|
|
finishCommand
| Object
| 完成任务
| |
|
key
| int
| 插座通断电状态,0:断电,1:通电
| 0
|
|
key
| int
| 插座通断电状态,0:断电,1:通电
| 0
|
|
key
| int
| 插座通断电状态,0:断电,1:通电
| 0
|
|
mac
| String
| wifi设备MAC地址,唯一标识
| 4CEBD60BFD62
|
|
messageId
| String
| 消息ID字段
| 202201241610366046
|
|
source
| String
| 指令回复“command"
| command
|
|
task
| String
| 固定值“countdown"
| countdown
|
|
timerInterval
| int
| 倒计时信息上报时间间隔(单位秒),取值范围1-86400
| 20
|
|
type
| String
| 设备设置固定传"setting"
| setting
|
|
type
| String
| 设备设置固定传"event"
| event
|
|
type
| String
| 设备设置固定传"event"
| event
|
|
type
| String
| 设备设置固定传"event"
| event
|
---
### 倒计时任务自动上报
*setting-timer-countdown-active*
查看设备倒计时状态上报的 JSON 格式定义,供服务端对接解析设备上报的倒计时状态数据。上报频率由"设置倒计时任务"指令配置,配置后设备按周期将数据发布至约定主题(topic),设备端无订阅行为(仅发布),服务端订阅该发布主题后即可接收上报数据。<br/>
**向设备发送指令(服务端向设备订阅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
| 倒计时总时长(秒),必须大于 0。
| 10
|
|
mac
| String
| wifi设备MAC地址,唯一标识
| 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,触发是通电
| |
|
hour
| int
| 小时0~23
| 0
|
|
key
| int
| 插座通断电状态,0:断电,1:通电
| 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
|
|
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
|
|
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
|
|
type
| String
| 设备设置固定传"event"
| event
|
---
## 设备维护
### 重置设备
*controller-reset*
将设备恢复至出厂状态,清除全部用户数据与配置,并自动重启。
**向设备发送指令(服务端向设备订阅topic发送消息)**
```json
{
"messageId" : "202201241610366046",
"system" : "reset",
"type" : "setting"
}
"messageId" : "202201241610366046",
"system" : "reset",
"type" : "setting"
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
|
messageId
| String
| 消息ID字段
| 202201241610366046
|
|
system
| String
| 重置/恢复出厂设置默认填"reset"
| reset
|
|
type
| String
| 设备设置固定传”setting"
| setting
|
---
**设备返回信息(设备向服务端订阅topic上报消息)**
```json
{
"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
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
|
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-reset",
"mac" : "4CEBD60BFD62",
"message" : "ok",
"messageId" : "202201241610366046",
"source" : "command",
"success" : true
}
"commandName" : "controller-reset",
"mac" : "4CEBD60BFD62",
"message" : "ok",
"messageId" : "202201241610366046",
"source" : "command",
"success" : true
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
|
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
|
---
### 累计用电量清零
*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-protocol*
获取当前设备与服务端交互的通信协议及协议配置参数,目前支持MQTT、TCP Client和HTTP Server(固件版本2.0.0以上支持),设备出厂时默认接入GemeOpen厂家MQTT测试服务器,免费提供客户调试使用,如需接入自己的服务器或使用其他协议,请自行搭建服务器。<br/>
**向设备发送指令(服务端向设备订阅topic发送消息)**
```json
{
"messageId" : "202201241610366046",
"type" : "protocol"
}
"messageId" : "202201241610366046",
"type" : "protocol"
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
|
messageId
| String
| 消息ID字段
| 202201241610366046
|
|
type
| String
| 获取设备通讯协议固定传protocol
| protocol
|
---
**设备返回信息(设备向服务端订阅topic上报消息)**
```json
{
"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
"
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
|
clientId
| String
| 自定义MQTT客户端ID注意:不可重复
| test-iot
|
|
commandName
| String
| 指令名称
| info-protocol
|
|
mac
| String
| wifi设备MAC地址或4G设备的IMEI号,唯一标识
| 4CEBD60BFD62
|
|
messageId
| String
| 消息ID字段
| 202201241610366046
|
|
password
| String
| 密码
| SUXOihwWNLMTRFKCFL
|
|
port
| String
| 端口号
| 1883
|
|
protocol
| String
| 协议类型,MQTT协议固定传"mqtt"
| MQTT
|
|
publish
| String
| 自定义MQTT发布主题 注意:不可重复
| /rqlMqR/GYofdXmMpHQa/4CEBD60BFD62/subscribe
|
|
server
| String
| 自定义MQTT服务器地址
| broker.emqx.io
|
|
source
| String
| 指令回复“command"
| command
|
|
subcribe
| String
| 自定义MQTT订阅主题注意:不可重复
| /rqlMqR/GYofdXmMpHQa/4CEBD60BFD62/publish
|
|
username
| String
| 自定义MQTT服务器用户名
| admin
|
---
### 设置按键控制锁
*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
{
"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
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
|
bssid
| String
| 路由器 MAC 地址
| 742ad779046
|
|
commandName
| String
| 指令名称
| setting-key-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
|
|
timerInterval
| int
| 设备统计信息上报时间间隔(单位秒),取值范围5-86400
| 15
|
|
type
| String
| 设备类型
| GSPM1B2
|
|
version
| String
| 当前固件版本号
| 4.1_1.1.1
|
|
wifiLock
| int
| 配网锁,0:关闭,1:开启
| 0
|
---
### 自定义MQTT参数
*setting-mqtt*
修改设备的 MQTT 服务器连接参数,使设备接入客户指定的MQTT 服务器(自建服务器、第三方平台等)。
**向设备发送指令(服务端向设备订阅topic发送消息)**
```json
{
"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"
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
|
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
|
|
subcribe
| String
| 自定义MQTT订阅主题注意:不可重复
| /topic/qos1
|
|
type
| String
| 自定义配置固定传“custom”
| custom
|
|
username
| String
| 自定义MQTT服务器用户名
| admin
|
---
**设备返回信息(设备向服务端订阅topic上报消息)**
```json
{
"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 "
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
|
clientId
| String
| 自定义MQTT客户端ID注意:不可重复
| admin
|
|
commandName
| String
| 指令名称
| setting-mqtt
|
|
mac
| String
| wifi设备MAC地址或4G设备的IMEI号,唯一标识
| 4CEBD60BFD62
|
|
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
|
|
source
| String
| 指令回复“command"
| command
|
|
subcribe
| String
| 自定义MQTT订阅主题注意:不可重复
| /topic/qos1
|
|
username
| String
| 自定义MQTT服务器用户名
| admin
|
---
### 设置上电默认状态
*setting-on-state*
配置设备断电恢复后输出的默认状态,即断电恢复瞬间设备是通电还是断电。
**向设备发送指令(服务端向设备订阅topic发送消息)**
```json
{
"messageId" : "20260520",
"onState" : 1,
"type" : "setting"
}
"messageId" : "20260520",
"onState" : 1,
"type" : "setting"
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
|
messageId
| String
| 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。
| 20260520
|
|
onState
| int
| 设备上电的默认状态:
0:记忆;是指记忆最后一次设备断电前的状态,如断电前设备是通电状态(指示灯是蓝的),设备下次上电默认是通电状态(指示灯是蓝的)。
1:关闭,即断电状态(指示灯是灭的),如断电前,设备是通电状态(指示灯是蓝的),设备下次上电默认是依旧是断电状态(指示灯是灭的)。需要手动/远程开启通电状态。
2:开启,即通电状态(指示灯是蓝色的),是指设备上电之后,默认是通电状态,此刻需要注意,插在设备上的负载会通电运行,会有安全风险,所以建议是默认上电状态为关闭。
| 1
|
|
type
| String
| 设备设置固定传"setting"
| setting
|
---
**设备返回信息(设备向服务端订阅topic上报消息)**
```json
{
"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
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
|
bssid
| String
| 路由器 MAC 地址
| 742ad779046
|
|
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
|
|
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
|
|
timerInterval
| int
| 设备统计信息上报时间间隔(单位秒),取值范围5-86400
| 15
|
|
type
| String
| 设备类型
| GSPM1B2
|
|
version
| String
| 当前固件版本号
| 4.1_1.1.1
|
|
wifiLock
| int
| 配网锁,0:关闭,1:开启
| 0
|
---
### 自定义TCP参数
*setting-tcp*
设置设备的 TCP 服务器连接参数。设备仅支持 TCP Client 模式,设备作为客户端主动连接客户指定的 TCP 服务器。
**向设备发送指令(服务端向设备订阅topic发送消息)**
```json
{
"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"
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
|
messageId
| String
| 消息ID字段
| 202201241610366046
|
|
port
| String
| 自定义TCP服务器端口
| 8080
|
|
protocol
| String
| TCP协议固定传"tcp"
| tcp
|
|
server
| String
| 自定义TCP服务器地址
| 192.168.0.66
|
|
type
| String
| 设备自定义固定传"custom"
| custom
|
---
**设备返回信息(设备向服务端订阅topic上报消息)**
```json
{
"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"
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
|
commandName
| String
| 指令名称
| setting-tcp
|
|
mac
| String
| wifi设备MAC地址或4G设备的IMEI号,唯一标识
| 4CEBD60BFD62
|
|
messageId
| String
| 消息ID字段
| 202201241610366046
|
|
port
| String
| 端口号
| 8080
|
|
protocol
| String
| TCP协议固定传"tcp"
| tcp
|
|
server
| String
| 自定义TCP服务器地址
| 192.168.0.66
|
|
source
| String
| 指令回复“command"
| command
|
---
### 设置WiFi账号
*setting-wifi-config*
修改设备的 WiFi 连接信息(网络名称与密码),使设备连接至指定的 WiFi 网络。设备仅支持 2.4G WiFi(不支持 5G 频段),请确认目标网络为 2.4G。<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
|
---
### 设置IP获取方式
*setting-wifi-dhcpEnable*
配置设备的 IP 获取方式,设备出厂时IP获取方式默认为DHCP,静态 IP 需位于路由器网段内且未被占用,否则可能无法联网或冲突。
**向设备发送指令(服务端向设备订阅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
{
"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
}
```
#### 字段属性
---
| 字段名称 | 字段类型 | 字段说明 | 示例值 |
|------|------|------|------|
|
bssid
| String
| 路由器 MAC 地址
| 742ad779046
|
|
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
|
|
timerInterval
| int
| 设备统计信息上报时间间隔(单位秒),取值范围5-86400
| 15
|
|
type
| String
| 设备类型
| GSPM1B2
|
|
version
| String
| 当前固件版本号
| 4.1_1.1.1
|
|
wifiLock
| int
| 配网锁,0:关闭,1:开启
| 0
|
---





