Universal IR Remote Control

Last Updated on : 2023-10-09 01:57:20download

Control process diagram

Universal IR Remote Control

API list

Action Description
infrared.category Get the device categories supported by a universal IR remote control.
infrared.categoryBrand Get the list of brands supported by a specified device category.
infrared.categoryBrandRemote Get the list of default remote control indexes that are supported by the brands dedicated to a specified device category.
infrared.testStandardCommand Control a device in the phase of pairing with a remote control.
infrared.remoteIndexKeys Get non-standard instructions.
infrared.testRawCommand Test sending non-standard instructions in the phase of pairing.
infrared.addNormalRemote Add a common remote control.
infrared.standardCommand Control a device with standard instructions from a common remote control.
infrared.rawCommand Control a device with non-standard instructions from a common remote control.

Get device categories supported by universal IR remote control

API description

Get the device categories supported by a universal IR remote control. Typical devices include TV sets, set-top boxes, air conditioners, and fans.

API endpoint

action: infrared.category

Request parameter

Parameter name Type Description Required
infrared_id String The infrared device ID. Yes

Sample request

{
  "action": "infrared.category",
  "params": {
    "infrared_id": "vdevo157924607038167"
  }
}

Response parameter

Parameter name Type Description
code Integer The response code.
success Boolean Indicates whether the operation is successful. Valid values:
  • true: success.
  • false: failure.
  • msg String The error message that is returned if the API call fails. This parameter value is empty if the API call succeeds.
    result List The returned result.

    Description of result

    Parameter name Type Description
    category_id String The device category ID.
    category_name String The name of the device.

    Sample response

    {
        "success": true,
        "t": 1539776581583,
        "result": [
            {
                "category_id": "1",
                "category_name": "Set-top box",
            },
            {
                "category_id": "2",
                "category_name": "TV set"
            },
            {
                "category_id": "5",
                "category_name": "Air conditioner"
            }
        ]
    }
    

    Get list of brands supported by specified device category

    API description

    Get information about brands that are supported by a device category dedicated to an IR remote control. TV sets and air conditioners are supported.

    API endpoint

    action: infrared.categoryBrand
    

    Request parameter

    Parameter name Type Description Required
    infrared_id String The infrared device ID. Yes
    category_id String The device category ID. Yes

    Sample request

    {
      "action": "infrared.categoryBrand",
      "params": {
        "infrared_id": "vdevo157924607038167",
        "category_id": "2"
      }
    }
    

    Response parameter

    Parameter name Type Description
    code Integer The response code.
    success Boolean Indicates whether the operation is successful. Valid values:
  • true: success.
  • false: failure.
  • msg String The error message that is returned if the API call fails. This parameter value is empty if the API call succeeds.
    result List The returned result.

    Description of result

    Parameter name Type Description
    brand_id String The brand ID.
    brand_name String The name of the brand.

    Sample response

    {
        "success": true,
        "result": [
            {
                "brand_id": "907",
                "brand_name": "Denon"
            },
            {
                "brand_id": "3080",
                "brand_name": "ENVISION"
            },
            {
                "brand_id": "472",
                "brand_name": "Feilu"
            },
            {
                "brand_id": "352",
                "brand_name": "Optoma"
            },
            {
                "brand_id": "2427",
                "brand_name": "RICHINFO"
            },
            {
                "brand_id": "232",
                "brand_name": "SANYO"
            },
            {
                "brand_id": "1216",
                "brand_name": "Kaisui"
            }
         ]
    }
    

    Get remote control indexes

    API description

    Get the list of default remote control indexes that are supported by the brands dedicated to a specified device category.

    API endpoint

    action: infrared.categoryBrandRemote
    

    Request parameter

    Parameter name Type Description Required
    infrared_id String The infrared device ID. Yes
    category_id String The device category ID. Yes
    brand_id String The brand ID. Yes

    Sample request

    {
      "action": "infrared.categoryBrandRemote",
      "params": {
        "infrared_id": "vdevo157924607038167",
        "category_id": "2",
        "brand_id": "907"
      }
    }
    

    Response parameter

    Parameter name Type Description
    code Integer The response code.
    success Boolean Indicates whether the operation is successful. Valid values:
  • true: success.
  • false: failure.
  • msg String The error message that is returned if the API call fails. This parameter value is empty if the API call succeeds.
    result List The returned result.

    Description of result

    Parameter name Type Description
    remote_index String The remote control index.

    Sample response

    {
        "success": true,
        "result": [
            {
                "remote_index": "1092"
            },
            {
                "remote_index": "1102"
            },
            {
                "remote_index": "1107"
            },
            {
                "remote_index": "1112"
            },
            {
                "remote_index": "1117"
            }
        ]
    }
    

    Control device when pairing with remote control

    API description

    Send an IR instruction and test whether an IR device can be controlled as expected in the stage of pairing with a remote control.

    API endpoint

    action: infrared.testStandardCommand
    

    Request parameter

    Parameter name Type Description Required
    infrared_id String The infrared device ID. Yes
    remote_index String The remote control index. Yes
    category_id String The device category ID. Yes
    key String The standard key. Yes

    Sample request

    {
      "action": "infrared.testStandardCommand",
      "params": {
        "infrared_id": "vdevo157924607038167",
        "remote_index": "5129",
        "category_id": 1,
        "key" : "power"
      }
    }
    

    Response parameter

    Parameter name Type Description
    code Integer The response code.
    success Boolean Indicates whether the operation is successful. Valid values:
  • true: success.
  • false: failure.
  • msg String The error message that is returned if the API call fails. This parameter value is empty if the API call succeeds.
    result Boolean The returned result.

    Sample response

    {
      "success": true,
      "result": true
    }
    

    Get non-standard instructions

    API description

    Get pairing rules that match a remote control ID, and get the key for sending an IR code.

    You can make this API request to implement the features that are not covered by standard IR instructions.

    API endpoint

    action: infrared.remoteIndexKeys
    

    Request parameter

    Parameter name Type Description Required
    infrared_id String The infrared device ID. Yes
    category_id String The device category ID. Yes
    brand_id String The brand ID. Yes
    remote_index String The remote control index. Yes

    Sample request

    {
      "action": "infrared.remoteIndexKeys",
      "params": {
        "infrared_id": "vdevo157924607038167",
        "remote_index": "3054",
        "category_id": 2,
        "brand_id": 27
      }
    }
    

    Response parameter

    Parameter name Type Description
    code Integer The response code.
    success Boolean Indicates whether the operation is successful. Valid values:
  • true: success.
  • false: failure.
  • msg String The error message that is returned if the API call fails. This parameter value is empty if the API call succeeds.
    result Boolean The returned result.

    Sample response

    Sample response on success (common remote control)

    {
        "success": true,
        "result": [
              {
                "key": "1",
                "desc": "Power",
                "key_name": "power",
                "code":"5jCCYZ55TmdmWoKreGWbE2HGP9BFG9QuaLUVy6jVNsU="
            },
            {
                "key": "42",
                "desc": "OK",
                "key_name": "ok",
                "code":"54CYZ55TmdmWoKreGWbE2HGP9BFG9QuaLUVy6jVNsU="
            },
            {
                "key": "43",
                "desc": "Channel up",
                "key_name": "channel_up",
                "code":"09CCYZ55TmdmWoKreGWbE2HGP9BFG9QuaLUVy6jVNsU="
            }
       ]
    }
    

    Sample response on success (remote control of air conditioner)

    {
        "success": true,
        "result": [
            {
                "key": "0",
                "desc": null,
                "key_name": "M0_T16_S0",
                "code":"5jCCYZ55TmdmWoKreGWbE2HGP9BFG9QuaLUVy6jVNsU="
            },
            {
                "key": "0",
                "desc": null,
                "key_name": "M0_T16_S1",
                "code":"11CCYZ55TmdmWoKreGWbE2HGP9BFG9QuaLUVy6jVNsU="
            },
            {
                "key": "0",
                "desc": null,
                "key_name": "M0_T16_S2",
                "code":"90sCCYZ55TmdmWoKreGWbE2HGP9BFG9QuaLUVy6jVNsU="
            },
            {
                "key": "0",
                "desc": null,
                "key_name": "M0_T16_S3",
                "code":"7dCCYZ55TmdmWoKreGWbE2HGP9BFG9QuaLUVy6jVNsU="
            },
            {
                "key": "0",
                "desc": null,
                "key_name": "M0_T17_S0",
                "code":"6vbCCYZ55TmdmWoKreGWbE2HGP9BFG9QuaLUVy6jVNsU="
            }
         ]
    }
    

    Sample response on failure

    {
      "success": false,
      "code": 500,
      "msg": "system error,please contact the admin"
    }
    

    Test sending non-standard instructions during pairing

    API description

    Test whether a remote control matches a device. Send an IR code by setting the key in the request parameters. You can get the value of the key when you make an API request to get the pairing rules. Dedicated instructions, rather than non-standard instructions, support air conditioners.

    API endpoint

    action: infrared.testRawCommand
    

    Request parameter

    Parameter name Type Description Required
    infrared_id String The infrared device ID. Yes
    remote_index String The remote control index. Yes
    category_id String The device category ID. Yes
    raw_key String The key of the IR code. You can get the value of the key when you make an API request to get the pairing rules. Yes

    Sample request

    {
      "action": "infrared.testRawCommand",
      "params": {
        "infrared_id": "vdevo157924607038167",
        "remote_index": "5129",
        "category_id": 1,
        "raw_key" : 1
      }
    }
    

    Response parameter

    Parameter name Type Description
    code Integer The response code.
    success Boolean Indicates whether the operation is successful. Valid values:
  • true: success.
  • false: failure.
  • msg String The error message that is returned if the API call fails. This parameter value is empty if the API call succeeds.
    result Boolean The returned result.

    Sample response

    {
      "success": true,
      "result": true
    }
    

    Add common remote control

    API description

    Add a common remote control that is inapplicable to set-top boxes and air conditioners.

    API endpoint

    action: infrared.addNormalRemote
    

    Request parameter

    Parameter name Type Description Required
    infrared_id String The infrared device ID. Yes
    category_id String The device category ID. Yes
    brand_id String The brand ID. Yes
    brand_name String The name of the brand. Yes
    remote_index String The remote control index. Yes
    remote_name String The name of the remote control. Yes

    Sample request

    {
      "action": "infrared.addNormalRemote",
      "params": {
        "infrared_id": "vdevo157924607038167",
        "category_id": "2",
        "category_name": "TV set",
        "brand_id": "27",
        "brand_name": "TCL",
        "remote_index": "10982",
        "remote_name" : "Name of remote control"
      }
    }
    

    Response parameter

    Parameter name Type Description
    code Integer The response code.
    success Boolean Indicates whether the operation is successful. Valid values:
  • true: success.
  • false: failure.
  • msg String The error message that is returned if the API call fails. This parameter value is empty if the API call succeeds.
    result List The returned result.

    Description of result

    Parameter name Type Description
    remote_id String The device ID of the remote control.

    Sample response

    {
        "success": true,
        "result": {
            "remote_id": "6cb9e4eaf1e462b3d4ihh7"
        }
    }
    

    Control device with standard instructions from common remote control

    API description

    Send an instruction that matches a standard key for an added remote control. For more information about keys, see Standard Instructions for Infrared Devices. Users can send standard instructions to control air conditioners and control channels of TV sets and set-top boxes.

    API endpoint

    action: infrared.standardCommand
    

    Request parameter

    Parameter name Type Description Required
    infrared_id String The infrared device ID. Yes
    remote_id String The remote control ID. Yes
    key String The standard key. Yes

    Sample request

    {
      "action": "infrared.standardCommand",
      "params": {
        "infrared_id": "vdevo157924607038167",
        "remote_id": "6c014f07yyyyyy",
        "key" : "power"
      }
    }
    

    Response parameter

    Parameter name Type Description
    code Integer The response code.
    success Boolean Indicates whether the operation is successful. Valid values:
  • true: success.
  • false: failure.
  • msg String The error message that is returned if the API call fails. This parameter value is empty if the API call succeeds.
    result Boolean The returned result.

    Sample response

    {
      "success": true,
      "result": true
    }
    

    Control device with non-standard commands from common remote control

    API description

    Control an associated remote control to send an instruction and send an IR code that matches raw_key. You can get the value of raw_key when you make an API request to get the pairing rules. Currently, only TV sets and set-top boxes are supported. Dedicated instructions are used for air conditioners.

    API endpoint

    action: infrared.rawCommand
    

    Request parameter

    Parameter name Type Description Required
    infrared_id String The infrared device ID. Yes
    remote_id String The remote control ID. Yes
    raw_key String The standard key. Yes

    Sample request

    {
      "action": "infrared.rawCommand",
      "params": {
        "infrared_id": "vdevo157924607038167",
        "remote_id": "6c014f07yyyyyy",
        "raw_key" : "43"
      }
    }
    

    Response parameter

    Parameter name Type Description
    code Integer The response code.
    success Boolean Indicates whether the operation is successful. Valid values:
  • true: success.
  • false: failure.
  • msg String The error message that is returned if the API call fails. This parameter value is empty if the API call succeeds.
    result Boolean The returned result.

    Sample response

    {
      "success": true,
      "result": true
    }