Communication protocol description of X12 firmware software package
【重要通知】自2023年起x12固件不在通过本页面发布,转到论坛下载,跳转地址(x12智能插座 – Shane技术之家论坛 (zhangyuqing.cn))
-------------------------V0.1.0-------------------------
Mqtt protocol:
Listening topic:
[mac_address] is your device address, for example: ecfabc6a3ef8
device/x12/[mac_address]/sensor
(This topic reports the switch status regularly)
device/x12/[mac_address]/set
(This topic is about sending control information)
device/x12/[mac_address]/status
(This topic is to report device-related information)
device/x12/[mac_address]/ir
(This topic is to report your ir receive info,this topic is very important to everyone.)
CMD info:
Device Information:
send:
{"cmd":"device report"}
response:
{"type":"x11","mac":[mac_address],"ip":"192.168.3.21","version":"0.1.0"}
restart your device:
send:
{"cmd":"reboot"}
configure your mqtt server:
{"mac" : mac_address,"setting":{"mqtt_server":"1.0.0.0","mqtt_port":1883,"mqtt_username":"","mqtt_password":""}}
(You should use the udp method to configure your information of mqtt server)
look your firmware version:
{"mac" : mac_address,"version":'null'}
control your device to send ir code:
{"mac" : mac_address,"action":{"id":137}}
(You must enter your infrared code first to get the coded id)
mqtt ota upgrade:
{"mac" : mac_address,"ota":"http://10.0.0.1/x12.bin"}
auto check ota upgrade:
{"cmd":"checkAutoUpgrade"}
search task of your device:
{"mac" : mac_address,"task":"1"}
{"mac" : mac_address,"task":"2"}
{"mac" : mac_address,"task":"3"}
{"mac" : mac_address,"task":"4"}
setting the task of your device:
{"mac" : mac_address,"task_0":{"hour":23,"minute":51,"repeat":127,"action":1,"ircode_id":0}}
{"mac" : mac_address,"task_1":{"hour":20,"minute":30,"repeat":127,"action":1,"ircode_id":0}}
{"mac" : mac_address,"task_2":{"hour":10,"minute":18,"repeat":127,"action":1,"ircode_id":1}}
{"mac" : mac_address,"task_3":{"hour":6,"minute":30,"repeat":127,"action":1,"ircode_id":1}}
(repeat is Every day of the week, like 1111111,First representative Monday)
search your delay settings:
{"mac" : mac_address,"delay":{"status":-1}}
setting your delay settings info:
{"mac" : mac_address,"delay":{"status":1,"action":1,"times":10,"ircode_id":0}}
(times The unit is minutes)
UDP protocol:
The device listening port is: 10182
The device sending information port is: 10181 0.0.0.0
You can send all the above json to port 10182
-------------------------V0.1.0 bugfix----------------------
fix mqtt large messge send failure
-------------------------V0.1.1 bugfix----------------------
fix sending ircode failure.
-------------------------V0.1.2-----------------------------
Configure mqtt information while adding network configuration
-------------------------V0.1.3-----------------------------
fix mqtt reconnecting bug
-------------------------V0.1.4-----------------------------
Add code output logic for power statistics
-------------------------V0.1.5-----------------------------
1.fix mqtt reconnected failure when the network was down.
2.Add filter to filter code of unknown type
3.add view mqtt info json command
send:
{"cmd":"view_mqtt_info"}
-------------------------V0.1.6-----------------------------
1.fix wifi hotspots always showing up