发射学习过的红外码
统一指令:controller-infrared-emit
发射学习的红外码,即实现远程遥控,需要注意受控设备的距离与角度
向设备发送指令 服务端向设备订阅topic发送消息
{
"action" : "emit",
"data" :
{
"no" : 110
},
"messageId" : "20260520",
"type" : "infrared"
}
设备返回信息 设备向服务端订阅topic上报消息
{
"commandName" : "controller-infrared-emit",
"mac" : "2026bb16aa14",
"message" : "ok",
"messageId" : "20260520",
"no" : 110,
"source" : "command",
"success" : true
}
擦除红外码
统一指令:controller-infrared-erase
删除所有已学习的红外
向设备发送指令 服务端向设备订阅topic发送消息
{
"action" : "erase",
"messageId" : "20260520",
"type" : "infrared"
}
设备返回信息 设备向服务端订阅topic上报消息
{
"commandName" : "controller-infrared-erase",
"mac" : "2026bb16aa14",
"message" : "ok",
"messageId" : "20260520",
"source" : "command",
"success" : true
}
学习红外码
统一指令:controller-infrared-learn
发送学习红外码指令,设备进入学习状态,将遥控器对准设备点击需要学习的按钮,开始学习,学习完成后设备触发“滴”声音反馈
向设备发送指令 服务端向设备订阅topic发送消息
{
"action" : "learn",
"data" :
{
"no" : 110
},
"messageId" : "20260520",
"type" : "infrared"
}
设备返回信息 设备向服务端订阅topic上报消息
{
"commandName" : "controller-infrared-learn",
"mac" : "2026bb16aa14",
"message" : "ok",
"messageId" : "20260520",
"no" : 110,
"source" : "command",
"success" : true
}
取消学习指令
统一指令:controller-infrared-learn-cancel
一般当完成学习指令后,给设备发送取消学习指令,即进入工作状态
向设备发送指令 服务端向设备订阅topic发送消息
{
"action" : "learnCancel",
"messageId" : "20260520",
"type" : "infrared"
}
设备返回信息 设备向服务端订阅topic上报消息
{
"commandName" : "controller-infrared-learn-cancel",
"mac" : "2026bb16aa14",
"message" : "ok",
"messageId" : "20260520",
"source" : "command",
"success" : true
}
读取红外码
统一指令:controller-infrared-read
读取红外码信息id_data,可复制写入到其它设备
向设备发送指令 服务端向设备订阅topic发送消息
{
"action" : "controller-infrared-read",
"data" :
{
"no" : 110
},
"messageId" : "20260520",
"type" : "infrared"
}
设备返回信息 设备向服务端订阅topic上报消息
{
"commandName" : "controller-infrared-read",
"mac" : "2026bb16aa14",
"message" : "ok",
"messageId" : "20260520",
"no" : 110,
"source" : "command",
"success" : true
}
写入红外码
统一指令:controller-infrared-write
向指定编号写入红外码
向设备发送指令 服务端向设备订阅topic发送消息
{
"action" : "ir_write",
"ir_data" : "e80200004e1a138d530340834e03cd89520341834e0341834f0340834e0342834e0342834d0342834d0342834e0342834d0341834e0341834d0342834f03cd895103418340834e03cd89520341834e0341834f0340834e0342834e0342834d0342834d0342834e0342834d0341834e0341834d0342834f03cd895103418340834e03cd89520341834e0341834f0340834e0342834e0342834d0342834d0342834e0342834d0341834e0341834d0342834f03cd8951034183",
"messageId" : "20260520",
"no" : 110,
"type" : "infrared"
}
设备返回信息 设备向服务端订阅topic上报消息
{
"commandName" : "controller-infrared-write",
"mac" : "2026bb16aa14",
"message" : "ok",
"messageId" : "20260520",
"no" : 110,
"source" : "command",
"success" : true
}
获取设备信息
统一指令:info-all
获取设备信息一般会包含:设备通断电状态、MAC/IMEI、固件版本、设备内网IP地址、设备WIFI网络名称等信息,不同的产品返回的信息有所差异
向设备发送指令 服务端向设备订阅topic发送消息
{
"messageId" : "20260520",
"type" : "info"
}
设备返回信息 设备向服务端订阅topic上报消息
{
"bssid" : "742ad779046",
"code" : "GSCU2B",
"commandName" : "info-all",
"ip" : "192.168.122.119",
"mac" : "2026bb16aa14",
"messageId" : "20260520",
"signal" : -75,
"source" : "command",
"ssid" : "gemeopen",
"tempOffset" : 0,
"timerEnable" : 1,
"timerInterval" : 15,
"version" : "1.0.0",
"wifiLock" : 0
}