Control Air Conditioner with Remote Control

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

Control Air Conditioner with Remote Control

API list

Action Description
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.acTestCommand Control a device when pairing with remote control.
infrared.addNormalRemote Add a common remote control.
infrared.acCommand Control an air conditioner with a single command.
infrared.acScenesCommand Control an air conditioner with the scene command.
infrared.acStatus Query current status of an 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"
            }
        ]
    }
    

    Test air conditioner remote control

    API description

    Send a single command that is transmitted by a remote control button based on a remote control index to test whether the remote control matches the air conditioner.

    API endpoint

    action: infrared.acTestCommand
    

    API description

    The following table describes the IR instruction sets dedicated to air conditioners.

    Parameter name Type Description Required
    power Integer The power status. Valid values:
  • 1: On
  • 0: Off
  • No
    mode Integer The mode in which an air conditioner runs. Valid values:
  • 0: cool mode
  • 1: heat mode
  • 2: auto mode
  • 3: fan mode
  • 4: dry mode
  • Some air conditioners do not support all of these modes.
    temp Integer The temperature. Valid values: 16°C to 30°C. No
    wind Integer The wind speed. Valid values:
  • 0: automatic
  • 1: low speed
  • 2: medium speed
  • 3: high speed
  • Some air conditioners do not support all of these speed levels.

    Request parameter

    Parameter name Type Parameter location Description Required
    infrared_id String URI The infrared device ID. Yes
    remote_index String BODY The remote control index. Yes
    category_id Integer BODY The device category ID. Yes
    code String BODY The DP code. Error code if the API call fails. For more information, see API description. Yes
    value Integer BODY The DP value to be sent. For more information, see API description. Yes

    Response parameter

    Parameter name Type Description
    code Integer The response code. For more information, see the Error codes.
    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 request

    {
      "action": "infrared.acTestCommand",
      "params": {
        "infrared_id": "vdevo157924607038167",
          "remote_index":"7273",
          "category_id": 5,
          "code": "temp",
          "value": 26
      }
    }
    

    Sample response

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

    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 air conditioner with single command

    API description

    Send a single command to control an air conditioner.

    API endpoint

    action: infrared.acCommand
    

    API description

    Parameter name Type Description Required
    power Integer The power status. Valid values:
  • 1: On
  • 0: Off
  • No
    mode Integer The mode in which an air conditioner runs. Valid values:
  • 0: cool mode
  • 1: heat mode
  • 2: auto mode
  • 3: fan mode
  • 4: dry mode
  • Some air conditioners do not support all of these modes.
    temp Integer The temperature. Valid values: 16°C to 30°C. No
    wind Integer The wind speed. Valid values:
  • 0: automatic
  • 1: low speed
  • 2: medium speed
  • 3: high speed
  • Some air conditioners do not support all of these speed levels.

    Request parameter

    Parameter name Type Parameter location Description Required
    infrared_id String URI The infrared device ID. Yes
    remote_id String URI The remote control ID. Yes
    code String BODY The DP code to be sent. For more information, see API description. Yes
    value Integer BODY The DP value to be sent. For more information, see API description. Yes

    Response parameter

    Parameter name Type Description
    code Integer The response code. For more information, see the Error codes.
    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 request

    {
      "action": "infrared.acCommand",
      "params": {
        "infrared_id": "vdevo157924607038167",
          "remote_id":"6c014f07yyyyyy",
          "code": "temp",
          "value": 26
      }
    }
    

    Sample response on success

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

    Sample response on failure

    {
        "code": 2050,
        "msg": "The key code library does not exist.",
        "success": false,
        "t": 1586763590514
    }
    

    Error codes

    The following table lists common error codes for the API calls. For more error codes, see Global Error Codes.

    Error codes Description
    500 A system error has occurred while processing your request.
    1109 Invalid parameter.
    2050 The key code library does not exist.

    Control air conditioner with scene command

    API description

    Send a command that specifies multiple conditions to control an air conditioner with a smart scene.

    The combination of certain conditions does not match a key code library. Therefore, an error message will be returned to indicate that the key code library does not exist.

    API endpoint

    action: infrared.acScenesCommand
    

    API description

    Parameter name Type Description Required
    power Integer The power status. Valid values:
  • 1: On
  • 0: Off
  • No
    mode Integer The mode in which an air conditioner runs. Valid values:
  • 0: cool mode
  • 1: heat mode
  • 2: auto mode
  • 3: fan mode
  • 4: dry mode
  • Some air conditioners do not support all of these modes.
    temp Integer The temperature. Valid values: 16°C to 30°C. No
    wind Integer The wind speed. Valid values:
  • 0: automatic
  • 1: low speed
  • 2: medium speed
  • 3: high speed
  • Some air conditioners do not support all of these speed levels.

    Request parameter

    Parameter name Type Parameter location Description Required
    infrared_id String URI The infrared device ID. Yes
    remote_id String URI The remote control ID. Yes
    power Integer BODY The power status. Valid values:
  • 1: On
  • 0: Off
  • Yes
    mode Integer BODY The mode in which an air conditioner runs. Valid values:
  • 0: cool mode
  • 1: heat mode
  • 2: auto mode
  • 3: fan mode
  • 4: dry mode
  • No
    temp Integer BODY The temperature. Valid values: 16°C to 30°C. No
    wind Integer BODY The wind speed. Valid values:
  • 0: automatic
  • 0: low speed
  • 2: medium speed
  • 3: high speed
  • No

    Response parameter

    Parameter name Type Description
    code Integer The response code. For more information, see the Error codes.
    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 request

    {
      "action": "infrared.acScenesCommand",
      "params": {
        "infrared_id": "vdevo157924607038167",
          "remote_id":"6c014f07yyyyyy",
          "power": 1,
          "mode": 2,
          "temp": 20,
          "wind": 1
      }
    }
    

    Sample response on success

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

    Sample response on failure

    {
        "code": 2050,
        "msg": "The key code library does not exist.",
        "success": false,
        "t": 1586763590514
    }
    

    Error codes

    The following table lists common error codes for the API calls. For more error codes, see Global Error Codes.

    Error codes Description
    500 A system error has occurred while processing your request.
    1109 Invalid parameter.
    2050 The key code library does not exist.

    Query current status of air conditioner

    API endpoint

    action: infrared.acStatus
    

    Request parameter

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

    Sample request

    {
      "action": "infrared.acStatus",
      "params": {
        "infrared_id": "vdevo157924607038167",
        "remote_id": "6cb2fb33541a44967fxqhy"
      }
    }
    

    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 message that is returned if the request failed. The response is empty if the request is successful.
    result Object The returned result.

    Description of result

    Parameter name Type Description
    mode String The mode in which the air conditioner runs.
    temp String The temperature.
    wind String The air speed.
    power String The power status.
    remote_id String The remote control ID.

    Sample response

    {
        "success": true,
        "t": 1543927305251,
        "result": {
            "mode": "0",
            "temp": "20",
            "remote_id": "6cb2fb33541a44967fxqhy",
            "wind": "3"
        }
    }