RM IR code related API

RM Product introduction

The basic function of RM product is to receive and send Ircode. Because of the limitation of storage space, it does not have the function of saving Ircode .Therefore, all current RM products save Ircodes in APP or cloud.

RM usage

you will get which device type does RM support by Cloud API,like AC,TV,STB,FAN ect.;and get brand list by device type,like Aux,TCL ect.,then you will get ircode list. and then you can match ircodes with the device which you will control,once it matches, app will save the ircode.

After years of accumulation, BroadLink has built the world’s largest Ircode library of all categories, covering all the world’s well-known brands. At the same time, the functions of each category have been standardized to facilitate the interaction design of UI.

Process introduction

  1. Get device type list
  2. Get device type list which RM supports currently by cloud API

  3. Get brand list

    Get Brand list which RM supports currently by cloud API

  4. Get ircode and panel infos by cloud API

  5. Test ircode by SDK interface

    After sending the Ircode to RM in the required format by SDK, the user can observe if his device has a response and judge if the match is successful. If it is successful, the generated panel information will be returned.

Cloud API

Get device type list

URL: https://xxxbizopenplatform.ibroadlink.com/openproxy/v2/ircode/info

header: 
body:
    {
        "directive": {
            "header": {
                "namespace": "DNA.IrcodeInfo",
                "name": "getdevtype",
                "messageId": "1bd5d003-31b9-476f-ad03-71d471922820",
                "interfaceVersion": "2"
            },
            "payload": {
            }
        }
    }
                    
return:
   {
      "context": {
      },
      "event": {
        "header": {
           "namespace": "DNA.IrcodeInfo",
           "name": "Response",
           "interfaceVersion": "2",
           "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
        },
        "payload": {
            "devtype": [{"devtypeid":int,"devtypename":string}]
        }
      }
    }

Get brand list

URL: https://xxxbizopenplatform.ibroadlink.com/openproxy/v2/ircode/info

header: 
body:
    {
        "directive": {
            "header": {
                "namespace": "DNA.IrcodeInfo",
                "name": "getbrand",
                "messageId": "1bd5d003-31b9-476f-ad03-71d471922820",
                "interfaceVersion": "2"
            },
            "payload": {
                "devtypeid":0
            }
        }
    }
                    
return:
   {
      "context": {
      },
      "event": {
        "header": {
           "namespace": "DNA.IrcodeInfo",
           "name": "Response",
           "interfaceVersion": "2",
           "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
        },
        "payload": {
            "brand": [{"brandid":int,"brand":string,"enbrand":string,"famousstatus":int}]
        }
      }
    }

Get model list(this is just for cloud motor)

URL: https://xxxbizopenplatform.ibroadlink.com/openproxy/v2/ircode/info

header: 
body:
    {
        "directive": {
            "header": {
                "namespace": "DNA.IrcodeInfo",
                "name": "getversion",
                "messageId": "1bd5d003-31b9-476f-ad03-71d471922820",
                "interfaceVersion": "2"
            },
            "payload": {
                "devtypeid":0,
                "brandid":1
            }
        }
    }
                    
return:
   {
      "context": {
      },
      "event": {
        "header": {
           "namespace": "DNA.IrcodeInfo",
           "name": "Response",
           "interfaceVersion": "2",
           "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
        },
        "payload": {
            "version": [{"versionid":0,"version":"","devtypeid":0,brandid:0}]
        }
      }
    }

Get Ircode list

URL: https://xxxbizopenplatform.ibroadlink.com/openproxy/v2/ircode/info

header: 
body:
    {
        "directive": {
            "header": {
                "namespace": "DNA.IrcodeInfo",
                "name": "getircode",
                "messageId": "1bd5d003-31b9-476f-ad03-71d471922820",
                "interfaceVersion": "2"
            }
            "payload": {
                "devtypeid":0,
                "brandid":1,//(TV/AC/FAN)
                "providerid":1//(STB)
            }
        }
    }
                    
return:
{
    "context":{},
    "event":{
        "header":{
            "namespace":"DNA.IrcodeInfo",
            "name":"Response",
            "interfaceVersion":"2",
            "messageId":"5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4"
        },
        "payload":{
            "ircode":[
                {
                    "pid":"",
                    "ircodeid":"",
                    "timestamp":1514736000000,
                    "ircode":[
                        {
                            "function":"on",
                            "name":"Open AC",
                            "desc":"Open AC,Heat mode,23 degrees Celsius,Auto windspeed",
                            "code":"2600121343241325243521342342141"
                        }
                    ]
                }
            ]
        }
    }
}

match AC Ircode with Cloud

URL: https://xxxbizopenplatform.ibroadlink.com/openproxy/v2/ircode/info

   Request

   body:
   
       {
   
           "directive": {
   
               "header": {
   
                   "namespace": "DNA.IrcodeInfo",
   
                   "name": "matchircode",
   
                   "messageId": "1bd5d003-31b9-476f-ad03-71d471922820",
   
                   "interfaceVersion": "2"
   
               },
   
               "payload": {
   
                  "dnacode":"xxxxx"
   
               }
   
           }
   
       }
   
   Response:

   

    {
       "context":{},
   
       "event":{
   
           "header":{
   
               "namespace":"DNA.IrcodeInfo",
   
               "name":"Response",
   
               "interfaceVersion":"2",
   
               "messageId":"5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4"
   
           },
   
           "payload":{
   
               "retdata":[
   
                   {
   
                       "irid":int,
   
                       "name":"xxxx"
   
                   }
   
               ]
   
           }
   
       }  
     }
   

Get channel list

URL: https://xxxbizopenplatform.ibroadlink.com/openproxy/v2/ircode/info

header: 
body:
    {
        "directive": {
            "header": {
                "namespace": "DNA.IrcodeInfo",
                "name": "getchannel",
                "messageId": "1bd5d003-31b9-476f-ad03-71d471922820",
                "interfaceVersion": "2"
            },
            "payload": {
                "locateid":0,
                "providerid":1,
            }
        }
    }
                    
return:
{
    "context":{},
    "event":{
        "header":{
            "namespace":"DNA.IrcodeInfo",
            "name":"Response",
            "interfaceVersion":"2",
            "messageId":"5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4"
        },
        "payload":{
            "tvchannel":[
                {
                    "name":"xxx",
                    "famousstatus":0,
                    "channelid":11,
                    "serialnum":123
                }
            ]
        }
    }
}

Control API by passthrough ircode

POST https://(OpenproxyURL)/openproxy/v2/opencontrol?license=(license)、

Request:
{
  "directive": {
    "header": {
       "namespace": "DNA.FreeControl",
       "name": "DnaCodeControl",
       "interfaceVersion": "2",
       "messageId": "1bd5d003-31b9-476f-ad03-71d471922820"
    },
    "endpoint": {
      "endpointId": "Some-Device-ID",
       "devicePairedInfo":{}
    },
    "payload": {
        "dnaCode":"b445sdfafad112224sdf...."
    }
  }
}
Response:
{
  "context": {
    "properties": [ {
       "namespace": "DNA.FreeControl",
       "name": "DnaCodeControl",
       "value": "b445sdfafad112224sdf",
       "timeOfSample": "2017-02-03T16:20:50.52Z",
    } ]
  },
  "event": {
    "header": {
       "namespace": "DNA.FreeControl",
       "name": "Response",
       "interfaceVersion": "2",
       "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
    },
    "endpoint": {
      "endpointId": "appliance-001"
      cookie:{}
    },
    "payload": {
    }
  }
}

RM enter into Ircode learning state

POST https://(OpenproxyURL)/openproxy/v2/learncode?license=(license)
Request:
{
  "directive": {
    "header": {
       "namespace": "DNA.RMControl",
       "name": "StudyIrCode",
       "interfaceVersion": "2",
       "messageId": "1bd5d003-31b9-476f-ad03-71d471922820"
    },
    "endpoint": {
      "endpointId": "Some-Device-ID",
      "devicePairedInfo":{}
    },
    "payload": {
    }
  }
}
Response:
{
  "context": {
  },
  "event": {
    "header": {
       "namespace": "DNA.RMControl",
       "name": "Response",
       "interfaceVersion": "2",
       "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
    },
    "endpoint": {
      "endpointId": "appliance-001"
    },
    "payload": {
    }
  }
}

Get the Ircode you just learned

POST https://(OpenproxyURL)/openproxy/v2/opencontrol?license=(license)
Request:
{
  "directive": {
    "header": {
       "namespace": "DNA.RMControl",
       "name": "GetIrCode",
       "interfaceVersion": "2",
       "messageId": "1bd5d003-31b9-476f-ad03-71d471922820"
    },
    "endpoint": {
      "endpointId": "Some-Device-ID",
       "devicePairedInfo":{}
    },
    "payload": {
    }
  }
}

Response:
{
    "context":{
    },
    "event":{
        "header":{
            "namespace":"DNA.RMControl",
            "messageId":"30d2cd1a-ce4f-4542-aa5e-04bd0a6492d5",
            "name":"GetIrCode",
            "interfaceVersion":"2"
        },
        "endpoint":{
            "endpointId":"appliance-001"
        },
        "payload":{
            "code":"2600ac000700059e0001158911121211"
        }
    }
}

Get Ircode match tree

URL: https://xxxbizopenplatform.ibroadlink.com/openproxy/v2/ircode/info

header: 
body:
    {
        "directive": {
            "header": {
                "namespace": "DNA.IrcodeInfo",
                "name": "getircodetree",
                "messageId": "1bd5d003-31b9-476f-ad03-71d471922820",
                "interfaceVersion": "2"
            }
            "payload": {
                "devtypeid":0,
                "brandid":1,//(TV、STB)
            }
        }
    }
                    
return:
{
    "context":{},
    "event":{
        "header":{
            "namespace":"DNA.IrcodeInfo",
            "name":"Response",
            "interfaceVersion":"2",
            "messageId":"5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4"
        },
        "payload":{
            "hotircode": {
			"ircodeid": ["1234","343"],
            "ircode":{
                "1234":[{"key":"","codestr":"xxxxxxxxx"}],
                "343":[{"key":"","codestr":"xxxxxxxxx"}]
                }
            },
		"matchtree": {
			"key": "power",
			"codeList": [{
					"codestr":"xxxxxxxxx",
					"ircodeid": "",
					"chirdren": {
						"key": "volume_down",
						"codeList": [{
							"codestr":"xxxxxxxxx",
							"ircodeid": "1179"
						}]
					}
				},
				{
					"codestr":"xxxxxxxxx",
					"ircodeid": "",
					"chirdren": {
						"key": "volume_down",
						"codeList": [{
							"codestr":"xxxxxxxxx",
							"ircodeid": "1180"
						}]
					}
				},
				{
					"codestr":"xxxxxxxxx",
					"ircodeid": "",
					"chirdren": {
						"key": "volume_down",
						"codeList": [{
							"codestr":"xxxxxxxxx",
							"ircodeid": "1175"
						}]
					}
				},
				{
					"codestr":"xxxxxxxxx",
					"ircodeid": "",
					"chirdren": {
						"key": "tv_av",
						"codeList": [{
							"codestr":"xxxxxxxxx",
							"ircodeid": "",
							"chirdren": {
								"key": "menu",
								"codeList": [{
										"codestr":"xxxxxxxxx",
										"ircodeid": "",
										"chirdren": {
											"key": "volume_down",
											"codeList": [{
													"code": [20,38],
													"ircodeid": "1198"
												},
												{
													"code": [20,38],
													"ircodeid": "15582"
												}
											]
										}
									},
									{
										"codestr":"xxxxxxxxx",
										"ircodeid": "",
										"chirdren": {
											"key": "volume_down",
											"codeList": [{
												"codestr":"xxxxxxxxx",
												"ircodeid": "1212"
											}]
										}
									}
								]
							}
						}]
					}
				},

				{
					"codestr":"xxxxxxxxx",
					"ircodeid": "",
					"chirdren": {
						"key": "volume_down",
						"codeList": [{
							"codestr":"xxxxxxxxx",
							"ircodeid": "TV_0264"
						}]
					}
				},
				{
					"codestr":"xxxxxxxxx",
					"ircodeid": "",
					"chirdren": {
						"key": "tv_av",
						"codeList": [{
							    "codestr":"xxxxxxxxx",
								"ircodeid": "",
								"chirdren": {
									"key": "volume_down",
									"codeList": [{
									"codestr":"xxxxxxxxx",
										"ircodeid": "971"
									}]
								}
							},
							{
								"codestr":"xxxxxxxxx",
								"ircodeid": "",
								"chirdren": {
									"key": "volume_down",
									"codeList": [{
										"codestr":"xxxxxxxxx",
										"ircodeid": "TV_0178"
									}]
								}
							}
						]
					}
				}
			]
		}
        }
    }
}

Get Function list

URL: https://xxxbizopenplatform.ibroadlink.com/openproxy/v2/ircode/info

header
body:
    {
        "directive": {
            "header": {
                "namespace": "DNA.IrcodeInfo",
                "name": "getircodesupport",
                "messageId": "1bd5d003-31b9-476f-ad03-71d471922820",
                "interfaceVersion": "2"
            }
            "payload": {
                "devtypeid":1,
                "ircodeid":"123"
            }
        }
    }
response:
   {
      "context": {},
      "event": {
        "header": {
           "namespace": "DNA.IrcodeInfo",
           "name": "Response",
           "interfaceVersion": "2",
           "messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
        },
        "payload": {
                  "ircode":[
                        {
                            "ircodeid":"1236",
                            "allfunction":["power","up"]
                        }
                ]   
        }
      }
    }

rently supported panel category

  1. AC
  2. TV
  3. STB
  4. FAN
  5. LAMP