发送红外码
controller-infrared-emit
指令简介
发送学习过的红外码指令。
向设备发送指令
服务端向设备订阅topic发送消息
{
"action" : "emit",
"data" :
{
"no" : 110
},
"messageId" : "20260520",
"type" : "infrared"
}
字段属性
| # |
字段名称 |
字段类型 |
字段说明 |
示例值 |
| 1 |
action |
String |
此处固定为"emit" |
emit |
| 2 |
data |
Object |
数据 |
|
| 3 |
messageId |
String |
业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。
|
20260520 |
| 4 |
no |
int |
红外码编号,编号范围1~248 |
110 |
| 5 |
type |
String |
红外相关指令默认填"infrared" |
infrared |
{
"success": true,
"imei": "866597072523945",
"source": "command",
"commandName": "controller-infrared-emit",
"messageId": "20260520"
}
字段属性
| # |
字段名称 |
字段类型 |
字段说明 |
示例值 |
| 1 |
commandName |
String |
指令名称 |
controller-infrared-emit |
| 2 |
imei |
String |
设备唯一标识 |
866597072523945 |
| 3 |
messageId |
String |
业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。
|
20260520 |
| 4 |
source |
String |
指令回复“command" |
command |
| 5 |
success |
boolean |
执行结果,执行成功:true;执行失败:false |
true |
擦除红外指令
controller-infrared-erase
指令简介
将全部学习过的擦除。
向设备发送指令
服务端向设备订阅topic发送消息
{
"action" : "erase",
"messageId" : "20260520",
"type" : "infrared"
}
字段属性
| # |
字段名称 |
字段类型 |
字段说明 |
示例值 |
| 1 |
action |
String |
此处固定为"erase" |
erase |
| 2 |
messageId |
String |
业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。
|
20260520 |
| 3 |
type |
String |
红外相关指令默认填"infrared" |
infrared |
{
"success": true,
"imei": "866597072523945",
"source": "command",
"commandName": "controller-infrared-erase",
"messageId": "20260520"
}
字段属性
| # |
字段名称 |
字段类型 |
字段说明 |
示例值 |
| 1 |
commandName |
String |
指令名称 |
controller-infrared-erase |
| 2 |
imei |
String |
设备唯一标识 |
866597072523945 |
| 3 |
messageId |
String |
业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。
|
20260520 |
| 4 |
source |
String |
指令回复“command" |
command |
| 5 |
success |
boolean |
执行结果,执行成功:true;执行失败:false |
true |
学习红外码
controller-infrared-learn
指令简介
通过该指令可以学习遥控器发射出来的红外信号
向设备发送指令
服务端向设备订阅topic发送消息
{
"action" : "learn",
"data" :
{
"no" : 110
},
"messageId" : "20260520",
"type" : "infrared"
}
字段属性
| # |
字段名称 |
字段类型 |
字段说明 |
示例值 |
| 1 |
action |
String |
学习红外码指令默认填"learn" |
learn |
| 2 |
data |
Object |
数据 |
|
| 3 |
messageId |
String |
业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。
|
20260520 |
| 4 |
no |
int |
红外码编号,编号范围1~248 |
110 |
| 5 |
type |
String |
红外相关指令默认填"infrared" |
infrared |
{
"type": "infrared",
"action": "learn",
"commandName": "controller-infrared-learn",
"source": "command",
"imei": "864269069911747",
"success": true,
"messageId": "202201241610366046",
"no": 100
}
字段属性
| # |
字段名称 |
字段类型 |
字段说明 |
示例值 |
| 1 |
action |
String |
学习红外码指令默认填"learn" |
learn |
| 2 |
commandName |
String |
指令名称 |
controller-infrared-learn |
| 3 |
imei |
String |
设备唯一标识 |
866597072523945 |
| 4 |
messageId |
String |
业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。
|
20260520 |
| 5 |
no |
int |
红外码编号,编号范围1~248 |
110 |
| 6 |
source |
String |
指令回复“command" |
command |
| 7 |
success |
boolean |
执行结果,执行成功:true;执行失败:false |
true |
| 8 |
type |
String |
固定值"xxx" |
infrared |
取消学习
controller-infrared-learnCancel
指令简介
对处于学习状态的设备,取消学习状态
向设备发送指令
服务端向设备订阅topic发送消息
{
"action":"learnCancel",
"messageId":"20260520",
"type":"infrared"
}
字段属性
| # |
字段名称 |
字段类型 |
字段说明 |
示例值 |
| 1 |
action |
String |
学习红外码指令默认填"learn" |
learnCancel |
| 2 |
messageId |
String |
业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 |
20260520 |
| 3 |
type |
String |
固定值"xxx" |
infrared |
{
"commandName":"controller-infrared-learn-cancel",
"imei":"866597072523945",
"message":"ok",
"messageId":"20260520",
"source":"command",
"success":true
}
字段属性
| # |
字段名称 |
字段类型 |
字段说明 |
示例值 |
| 1 |
commandName |
String |
指令名称 |
controller-infrared-learn-cancel |
| 2 |
imei |
String |
设备唯一标识 |
866597072523945 |
| 3 |
message |
String |
执行结果描述:对命令执行结果的文本说明。执行完成且无异常:ok ;如果出现异常,返回异常结果描述。 |
ok |
| 4 |
messageId |
String |
业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 |
20260520 |
| 5 |
source |
String |
指令回复“command" |
command |
| 6 |
success |
boolean |
执行结果,执行成功:true;执行失败:false |
true |
读取红外码
controller-infrared-read
指令简介
1.0.5 固件版本支持该接口
向设备发送指令
服务端向设备订阅topic发送消息
{
"action" : "ir_read",
"data" :
{
"no" : 100
},
"messageId" : "API-xxx",
"type" : "infrared"
}
字段属性
| # |
字段名称 |
字段类型 |
字段说明 |
示例值 |
| 1 |
action |
String |
学习红外码指令默认填"learn" |
ir_read |
| 2 |
data |
Object |
数据 |
{"no":100} |
| 3 |
messageId |
String |
业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 |
API-xxx |
| 4 |
no |
int |
红外码编号,编号范围1~248 |
100 |
| 5 |
type |
String |
固定值"xxx" |
infrared |
{
"commandName" : "controller-infrared-read",
"imei" : "866597072523945",
"ir_data" : "e80200004e1a138d530340834e03cd89520341834e0341834f0340834e0342834e0342834d0342834d0342834e0342834d0341834e0341834d0342834f03cd895103418340834e03cd89520341834e0341834f0340834e0342834e0342834d0342834d0342834e0342834d0341834e0341834d0342834f03cd895103418340834e03cd89520341834e0341834f0340834e0342834e0342834d0342834d0342834e0342834d0341834e0341834d0342834f03cd8951034183",
"message" : "ok",
"messageId" : "API-xxx",
"no" : 100,
"source" : "command",
"success" : true
}
字段属性
| # |
字段名称 |
字段类型 |
字段说明 |
示例值 |
| 1 |
commandName |
String |
指令名称 |
controller-infrared-read |
| 2 |
imei |
String |
设备唯一标识 |
866597072523945 |
| 3 |
ir_data |
String |
红外码数据 |
e80200004e1a138d530340834e03cd89520341834e0341834f0340834e0342834e0342834d0342834d0342834e0342834d0341834e0341834d0342834f03cd895103418340834e03cd89520341834e0341834f0340834e0342834e0342834d0342834d0342834e0342834d0341834e0341834d0342834f03cd895103418340834e03cd89520341834e0341834f0340834e0342834e0342834d0342834d0342834e0342834d0341834e0341834d0342834f03cd8951034183 |
| 4 |
message |
String |
执行结果描述:对命令执行结果的文本说明。执行完成且无异常:ok ;如果出现异常,返回异常结果描述。 |
ok |
| 5 |
messageId |
String |
业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 |
API-xxx |
| 6 |
no |
int |
红外码编号,编号范围1~248 |
100 |
| 7 |
source |
String |
指令回复“command" |
command |
| 8 |
success |
boolean |
执行结果,执行成功:true;执行失败:false |
true |
写入红外码
controller-infrared-write
指令简介
1.0.5 固件版本支持该接口
向设备发送指令
服务端向设备订阅topic发送消息
{
"action" : "ir_write",
"ir_data" : "e80200004e1a138d530340834e03cd89520341834e0341834f0340834e0342834e0342834d0342834d0342834e0342834d0341834e0341834d0342834f03cd895103418340834e03cd89520341834e0341834f0340834e0342834e0342834d0342834d0342834e0342834d0341834e0341834d0342834f03cd895103418340834e03cd89520341834e0341834f0340834e0342834e0342834d0342834d0342834e0342834d0341834e0341834d0342834f03cd8951034183",
"messageId" : "API-xxx",
"no" : 110,
"type" : "infrared"
}
字段属性
| # |
字段名称 |
字段类型 |
字段说明 |
示例值 |
| 1 |
action |
String |
默认填"ir_write" |
ir_write |
| 2 |
ir_data |
String |
红外码数据 |
e80200004e1a138d530340834e03cd89520341834e0341834f0340834e0342834e0342834d0342834d0342834e0342834d0341834e0341834d0342834f03cd895103418340834e03cd89520341834e0341834f0340834e0342834e0342834d0342834d0342834e0342834d0341834e0341834d0342834f03cd895103418340834e03cd89520341834e0341834f0340834e0342834e0342834d0342834d0342834e0342834d0341834e0341834d0342834f03cd8951034183 |
| 3 |
messageId |
String |
业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 |
API-xxx |
| 4 |
no |
int |
红外码编号,编号范围1~248 |
110 |
| 5 |
type |
String |
固定值"infrared" |
infrared |
{
"commandName" : "controller-infrared-write",
"imei" : "866597072523945",
"message" : "ok",
"messageId" : "API-xxx",
"no" : 110,
"source" : "command",
"success" : true
}
字段属性
| # |
字段名称 |
字段类型 |
字段说明 |
示例值 |
| 1 |
commandName |
String |
指令名称 |
controller-infrared-write |
| 2 |
imei |
String |
设备唯一标识 |
866597072523945 |
| 3 |
message |
String |
执行结果描述:对命令执行结果的文本说明。执行完成且无异常:ok ;如果出现异常,返回异常结果描述。 |
ok |
| 4 |
messageId |
String |
业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 |
API-xxx |
| 5 |
no |
int |
红外码编号,编号范围1~248 |
110 |
| 6 |
source |
String |
指令回复“command" |
command |
| 7 |
success |
boolean |
执行结果,执行成功:true;执行失败:false |
true |