Universal infrared

Last Updated on : 2023-12-07 03:02:49download

Normal Remote Control Pairing

Request MethodAPIDescription
GET/v1.0/infrareds/{infrared_id}/categoriesGet device types which are infrared supported
GET/v1.0/infrareds/{infrared_id}/categories/
{category_id}/brands
Get a list of brands under the infrared device type
GET/v1.0/infrareds/{infrared_id}/categories/
{category_id}/brands/{brand_id}
Add normal remote control
POST/v1.0/infrareds/{infrared_id}/normal/add-remoteAdd normal remote control

Get device types which are infrared supported

Function Description

The purpose of this interface is to obtain the types of devices that support infrared devices. Currently, only TVs, set-top boxes, air conditioners, fans, etc. are supported.

Interface Address

GET /v1.0/infrareds/{infrared_id}/categories

Request Parameters

ParameterTypeParameter PositionDescriptionRequired
infrared_idStringURIInfrared Device IdYes

Return Message

ParameterTypeDescription
successbooleanWhether it was successful
resultarraySpecific parameters returned

result description

ParameterTypeDescription
category_idStringDevice Type Id
category_nameStringDevice name

Return success example

{
  "success": true,
  "t": 1539776581583,
  "result": [{
      "category_id": "1",
      "category_name": "机顶盒 "
    },
    {
      "category_id": "2",
      "category_name": "电视"
    },
    {
      "category_id": "5",
      "category_name": "空调"
    }
  ]
}

Return failure example

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

Get a list of brands of a specified type

Function Description

According to the device category supported by the infrared device, this interface can obtain the brand information supported by this device type, and currently supports TV and air conditioner.

Interface Address

GET /v1.0/infrareds/{infrared_id}/categories/{category_id}/brands

Request Parameters

ParameterTypeParameter PositionDescriptionRequired
infrared_idStringURIInfrared Device IdYes
category_idStringURIDevice Type IdYes

Return Message

ParameterTypeDescription
successbooleanWhether it was successful
resultarraySpecific parameters returned

result Description

ParameterTypeDescription
brand_idStringBrand Id
brand_nameStringBrand Name

Return success example

{
  "success": true,
  "result": [{
      "brand_id": "907",
      "brand_name": "天龙"
    },
    {
      "brand_id": "3080",
      "brand_name": "易美逊"
    },
    {
      "brand_id": "472",
      "brand_name": "飞鹿"
    },
    {
      "brand_id": "352",
      "brand_name": "奥图码"
    },
    {
      "brand_id": "2427",
      " brand_name": "彩讯"
    },
    {
      "brand_id": "232",
      "brand_name": "三洋"
    },
    {
      "brand_id": "1216",
      "brand_name": "Kaisui"
    }
  ]
}

Return failure example

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

Get brand support remote control index list

Function Description

This interface is used to obtain the remote control index

Interface Address

GET /v1.0/infrareds/{infrared_id}/categories/{category_id}/brands/{brand_id}

Request Parameters

ParameterTypeParameter PositionDescriptionRequired
infrared_idStringURIInfrared Device IdYes
category_idStringURIDevice Type IdYes
brand_idStringURIBrand IdYes

Return Message

ParameterTypeDescription
successbooleanWhether it was successful
resultarraySpecific parameters returned

result description

ParameterTypeDescription
remote_indexStringRemote control index

Return success example

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

Return failure example

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

Add normal remote control

Function Description

Add normal remote control

Interface Address

POST /v1.0/infrareds/{infrared_id}/normal/add-remote

Request Parameters

ParameterTypeParameter PositionDescriptionRequired
infrared_idStringURIInfrared Device IdYes
category_idStringBODYDevice Type IdYes
brand_idStringBODYbrand IdNO
brand_nameStringBODYBrand NameNo
remote_indexStringBODYRemote control indexYes
remote_nameStringBODYName of the remote controlNO

Request Example

{
  "category_id": "2",
  "category_name": "电视",
  "brand_id": "27",
  "brand_name": "TCL",
  "remote_index": "10982",
  "remote_name": "遥控器名称"
}

Return Message

ParameterTypeDescription
successbooleanWhether it was successful
resultjsonSpecific parameters returned

result Description

ParameterTypeDescription
remote_idStringRemote control device ID

Return success example

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

Return failure example

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

Pairing of the set-top box's remote control

APIRequest MethodDescription
/v1.0/infrareds/{infrared_id}/provincesGETGet a list of provinces
/v1.0/infrareds/{infrared_id}/provinces/
{province_id}/cities
GETGet a list of cities
/v1.0/infrareds/{infrared_id}/provinces/
{province_id}/cities/{city_id}/areas
GETGet a list of provinces
/v1.0/infrareds/{infrared_id}/areas/{area_id}/iptvsGETThis interface can only be used if the device type is a set-top box. Other device types cannot be called
/v1.0/infrareds/{infrared_id}/operators/
{operator_id}/brands?country_code=
GETThis interface can only be used if the device type is a set-top box. Other device types cannot be called
/v1.0/infrareds/{infrared_id}/operators/
{operator_id}/brands/{brand_id}/iptvs
GETThis interface is used to obtain the remote control index
/v1.0/infrareds/{infrared_id}/operators/
{operator_id}/areas/{area_id}
GETThis interface is used to obtain the remote control index
/v1.0/infrareds/{infrared_id}/box/add-remoteGETThis interface is used to add set-top box remote control
/v1.0/infrareds/{infrared_id}/{remote_id}/channelGETThis interface is used to query TV channel list
/v1.0/infrareds/{infrared_id}/channel/switchGETThis interface is used to switch TV channels
/v1.0/infrareds/{infrared_id}/remotes/{remote_id}/send-batch-keysPOSTissue control command

Get a list of provinces

Function Description

Get a list of provinces

Interface Address

GET /v1.0/infrareds/{infrared_id}/provinces

Request Parameters

ParameterTypeParameter PositionDescriptionRequired
infrared_idStringURIInfrared Device IdYes

Return Message

ParameterTypeDescription
successbooleanWhether it was successful
resultarraySpecific parameters returned

result Description

ParameterTypeDescription
province_idIntegerProvince Id
province_nameStringName of province

Return success example

{
  "success": true,
  "result": [{
      "province_id": 120000,
      "province_name": "天津市"
    },
    {
      "province_id": 320000,
      "province_name": "江苏省"
    }
  ]
}

Return failure example

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

Get a list of cities

Function Description

Get a list of cities

Interface Address

GET /v1.0/infrareds/{infrared_id}/provinces/{province_id}/cities

Request Parameters

ParameterTypeParameter PositionDescriptionRequired
infrared_idStringURIInfrared Device IdYes
province_idIntegerURIProvince idYes

Return Message

ParameterTypeDescription
successbooleanWhether it was successful
resultarraySpecific parameters returned

result Description

ParameterTypeDescription
province_idIntegerProvince Id
city_idIntegerCity id
city_nameStringCity Name

Return success example

{
  "success": true,
  "result": [{
      "province_id": 330000,
      "city_id": 330700,
      "city_name": "金华市"
    },
    {
      "province_id": 330000,
      "city_id": 330800,
      "city_name": "温州市"
    }
  ]
}

Return failure example

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

Get a list of regions

Function Description

Get a list of provinces

Interface Address

GET /v1.0/infrareds/{infrared_id}/provinces/{province_id}/cities/{city_id}/areas

Request Parameters

ParameterTypeParameter PositionDescriptionRequired
infrared_idStringURIInfrared Device IdYes
province_idIntegerURIProvince idYes
city_idIntegerURICity idYes

Return Message

ParameterTypeDescription
successbooleanWhether it was successful
resultarraySpecific parameters returned

result Description

ParameterTypeDescription
province_idIntegerProvince Id
city_idIntegerCity id
area_idIntegerArea id
area_nameStringZone name

Return success example

{
  "success": true,
  "result": [{
      "province_id": 330000,
      "city_id": 30500,
      "area_id": 330523,
      "area_name": "安吉县"
    },
    {
      "province_id": 330000,
      "city_id": 30500,
      "area_id": 330522,
      "area_name": "长兴县"
    }
  ]
}

Return failure example

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

Get a list of carriers by region

Function Description

This interface can only be used if the device type is a set-top box. 
Other device types cannot be called

Interface Address

GET /v1.0/infrareds/{infrared_id}/areas/{area_id}/iptvs

Request Parameters

ParameterTypeParameter PositionDescriptionRequired
infrared_idStringURIInfrared Device IdYes
area_idStringURIZone Id,accurate to zoneYes

Retrun message

ParameterTypeDescription
successbooleanWhether it was successful
resultarraySpecific parameters returned

result Description

ParameterTypeDescription
operator_idStringCarrier Id
operator_nameStringCarrier name
country_codeStringCountry code
iptv_typeIntegerIptv type(1:IPTV; 0:Not IPTV)

Return success example

{
  "success": true,
  "result": [{
    "operator_id": "1062",
    "operator_name": "成都电信IPTV",
    "country_code": "CN",
    "iptv_type": 1
  }]
}

Return failure example

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

Get Brand List: According to Carrier

Function Description

This interface can only be used if the device type is a set-top box. 
Other device types cannot be called

Interface Address

GET /v1.0/infrareds/{infrared_id}/operators/{operator_id}/brands?country_code=

Request Parameters

ParameterTypeParameter PositionDescriptionRequired
infrared_idStringURIInfrared Device IdYes
operator_idStringURICarrier idYes
country_codeStringURLInternational Code (China:CN)Yes

Return Message

ParameterTypeDescription
successbooleanWhether it was successful
resultarraySpecific parameters returned

result Description

ParameterTypeDescription
brand_idStringBrand Id
brand_nameStringBrand Name

Return success example

{
  "success": true,
  "result": [{
      "brand_id": "907",
      "brand_name": "天龙"
    },
    {
      "brand_id": "3080",
      "brand_name": "易美逊"
    },
    {
      "brand_id": "472",
      "brand_name": "飞鹿 "
    },
    {
      "brand_id": "352",
      "brand_name": "奥图码"
    }
  ]
}

Return failure example

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

Get Remote Control Index List: According to IPTV Carrier

Function Description

This interface is used to obtain the remote control index

Interface Address

GET /v1.0/infrareds/{infrared_id}/operators/{operator_id}/brands/{brand_id}/iptvs

Request Parameters

ParameterTypeParameter PositionDescriptionRequired
infrared_idStringURIInfrared Device IdYes
operator_idStringURICarrier IdYes
brand_idStringURIBrand IdYes

Return Message

ParameterTypeDescription
successbooleanWhether it was successful
resultarraySpecific parameters returned

result Description

ParameterTypeDescription
remote_indexStringRemote control index

Return success example

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

Return failure example

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

Get Remote Control Index List: According to Non-IPTV Carrier

Function Description

This interface is used to obtain the remote control index

Interface Address

GET /v1.0/infrareds/{infrared_id}/operators/{operator_id}/areas/{area_id}

Request Parameters

ParameterTypeParameter PositionDescriptionRequired
infrared_idStringURIInfrared Device IdYes
operator_idStringURICarrier IdYes
area_idStringURIArea IdYes

Return Message

ParameterTypeDescription
successbooleanWhether it was successful
resultarraySpecific parameters returned

result Description

ParameterTypeDescription
remote_indexStringRemote control index

Return success example

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

Return failure example

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

Add set-top box remote control

Function Description

This interface is used to add set-top box remote control

Interface Address

POST /v1.0/infrareds/{infrared_id}/box/add-remote

Request Parameters

ParameterTypeParameter PositionDescriptionRequired
infrared_idStringURIInfrared Device IdYes

Body parameter

ParameterTypeDescriptionRequired
category_idStringDevice Type IdYes
brand_idStringbrand IdYes
brand_nameStringBrand NameNo
remote_indexStringRemote control indexYes
remote_nameStringName of the remote controlNo
iptv_typeIntegerWhether it is IPTV(1:yes;0:not)No
operator_idStringCarrier IdYes
operator_nameStringCarrier nameNo
area_idStringArea idNo
area_nameStringZone nameNo

Return Message

ParameterTypeDescription
successbooleanWhether it was successful
resultjsonSpecific parameters returned

result Description

ParameterTypeDescription
remote_idStringRemote control device ID

Request Example

{
  "category_id": "1",
  "category_name": "机顶盒",
  "brand_id": "97",
  "brand_name": "机顶盒",
  "remote_index": "592",
  "remote_name": "浙江电信iptv",
  "operator_id": "0",
  "operator_name": "浙江电信 iptv",
  "area_id": "110107",
  "area_name": "北京"
}

Return success example

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

Return failure example

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

Query TV channel list

Function Description

This interface is used to query TV channel list

Interface Address

GET /v1.0/infrareds/{infrared_id}/{remote_id}/channel

Request Parameters

ParameterTypeParameter PositionDescriptionRequired
infrared_idStringURIInfrared Device IdYes
remote_idStringURIRemote control device IDYes

Return Message

ParameterTypeDescription
successbooleanWhether it was successful
resultarraySpecific parameters returned

result description

ParameterTypeDescription
channel_nameStringChannel name
channel_aliasStringAlias
channel_numStringChannel No.
hdIntegerWhether it is HD(0:SD 1:HD)

Return success example

{
  "success": true,
  "t": 1543927305251,
  "result": [{
      "channel_name": "湖南卫视",
      "channel_alias": "芒果台",
      "channel_num": "15",
      "hd": 1
    },
    {
      "channel_name": "CCTV-1",
      "channel_alias": "中央一台",
      "channel_num": "1",
      "hd": 1
    }
  ]
}

Return failure example

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

Switch TV channels

Function Description

This interface is used to switch TV channels

Interface Address

POST  /v1.0/infrareds/{infrared_id}/channel/switch

Request Parameters

ParameterTypeParameter PositionDescriptionRequired
infrared_idStringURIInfrared Device IdYes
remote_idStringURLRemote control device IDYes
remote_indexStringURLRemote control indexYes
channel_numStringURLChannel No.Yes

Return Message

ParameterTypeDescription
successbooleanWhether it was successful
resultObjectSpecific parameters returned

Return success example

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

Return failure example

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

Infrared code learning

APIRequest MethodDescription
/v1.0/infrareds/{infrared_id}/learning-state?state=truePUTupdate learning status
/v1.0/infrareds/{infrared_id}/learning-codes?learning_time=xxxxGETquery learned infrared code
/v1.0/infrareds/{infrared_id}/remotes/{remote_id}/learning-codesPOSTinfrared code that is learned under the next
/v1.0/infrareds/{infrared_id}/learning-codesPOSTsave the infrared code learned
/v1.0/infrareds/{infrared_id}/learning-remotes/{remote_index}PUTupdate the infrared code learned
/v1.0/infrareds/{infrared_id}/remotes/{remote_id}/learning-codesGETget saved learning infrared code
/v1.0/infrareds/{infrared_id}/learning-codes/{learn_id}DELETEdelete the infrared code learned

Update learning status

Function Description

update learning status

Interface Address

PUT /v1.0/infrareds/{infrared_id}/learning-state?state=true

Request Parameters

ParameterTypeParameter PositionDescriptionRequired
infrared_idStringURIInfrared Device IdYes
stateStringURLLearning mode , true learning mode,false non-learning modeYes

Return Message

ParameterTypeDescription
successbooleanWhether it was successful
resultObjectSpecific parameters returned

Return success example

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

Return failure example

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

Query learned infrared code

Function Description

query learned infrared code

Interface Address

GET /v1.0/infrareds/{infrared_id}/learning-codes?learning_time=xxxx

Request Parameters

ParameterParameter PositionTypeDescriptionRequired
infrared_idURIStringInfrared Device IDYes
learning_timeURLLongTime to enter learning modeYes

Return Message

ParameterTypeDescription
codeIntegerResponse code (details see error code section)
successBooleanwhether succeed(true:success,false:fail)
msgStringRequest failed information, success is empty
resultObjectReturn results

result Description

ParameterTypeDescription
successBooleanWhether to learn infrared code
codeStringLearned infrared code(the parameter ‘code’ is empty if the parameter ‘success’ is false,)

Return success example

{
  "success": true,
  "t": 1545135036437,
  "result": {
    "success": true,
    "code": "xxxxx"
  }
}

Return failure example

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

Infrared code that is learned under the next

Function Description

 infrared code that is learned under the next

Interface Address

POST /v1.0/infrareds/{infrared_id}/remotes/{remote_id}/learning-codes

Request Parameters

ParameterParameter PositionTypeDescriptionRequired
infrared_idURIStringInfrared Device IDYes
remote_idURLStringDevice Id(if not,fill in ‘TUYA’)Yes
codeBODYStringThe infrared code you learnedYes

Return Message

ParameterTypeDescription
successbooleanWhether it was successful
resultObjectSpecific parameters returned

Return success example

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

Return failure example

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

Save the infrared code learned

Function Description

save the infrared code learned

Interface Address

POST /v1.0/infrareds/{infrared_id}/learning-codes

Request Parameters

ParameterParameter PositionTypeDescriptionRequired
infrared_idURIStringInfrared Device IDYes
remote_idBODYStringRemote control id (value when it is for replication)No
remote_indexBODYStringRemote control index (value when it is for replication)No
brand_idBODYStringBrand ID (value when it is a copy function)No
brand_nameBODYStringBrand name (value when it comes to copying feature)No
codesBODYArraySaved infrared informationYes

codes Description

ParameterTypeDescription
nameStringThe name of the infrared code learned
key_nameStringLearned infrared code key key name
codeStringThe infrared code you learned

Request Example

{
  "codes": [{
      "code": "xxxxxxxx",
      "name": "wer123"
    },
    {
      "code": "xxxxxxxx",
      "name ": "123"
    }
  ]
}

Return Message

ParameterTypeDescription
codeIntegerResponse code (details see error code section)
successBooleanwhether succeed(true:success,false:fail)
msgStringRequest failed information, success is empty
resultObjectReturn results

result Description

ParameterTypeDescription
remote_idStringRemote control id

Return success example

{
  "success": true,
  "t": 1545135036437,
  "result": {
    "remote_id": "xxxx"
  }
}

Return failure example

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

Update the infrared code learned

Function Description

update the infrared code learned

Interface Address

PUT /v1.0/infrareds/{infrared_id}/learning-remotes/{remote_index}

Request Parameters

ParameterParameter PositionTypeDescriptionRequired
infrared_idURIStringInfrared Device IDYes
remote_indexURIStringRemote control idYes
codesBODYArraySaved infrared informationYes

codes Description

ParameterTypeDescription
nameStringThe name of the infrared code learned
key_nameStringInfrared code key name
codeStringThe infrared code you learned

Request Example

{
  "codes": [{
      "code": "xxxxxxxx",
      "name": "wer123"
    },
    {
      "code": "xxxxxxxx",
      "name": "123"
    }
  ]
}

Return Message

ParameterTypeDescription
codeIntegerResponse code (details see error code section)
successBooleanwhether succeed(true:success,false:fail)
msgStringRequest failed information, success is empty
resultObjectReturn results

result Description

ParameterTypeDescription
remote_idStringRemote control id

Return success example

{
  "success": true,
  "t": 1545135036437,
  "result": {
    "remote_id": "xxxx"
  }
}

Return failure example

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

Get saved learning infrared code

Function Description

get saved learning infrared code

Interface Address

GET /v1.0/infrareds/{infrared_id}/remotes/{remote_id}/learning-codes

Request Parameters

ParameterParameter PositionTypeDescriptionRequired
infrared_idURIStringInfrared Device IDYes
remote_idURIStringRemote control IDYes

Return Message

ParameterTypeDescription
codeIntegerResponse code (details see error code section)
successBooleanwhether succeed(true:success,false:fail)
msgStringRequest failed information, success is empty
resultObjectReturn results

result Description

ParameterTypeDescription
codeStringThe infrared code you learned
nameStringThe name of the infrared code
key_nameStringLearned infrared code keys
idLongLearned infrared code id
remote_idStringRemote control id

Response Example

{
  "success": true,
  "t": 1545375286851,
  "result": [{
      "name": "123",
      "key_name": "1",
      "code": "xxxxxxxx",
      "id": 253006,
      "remote_id": "6c2949716ca8f52c01aquk"
    },
    {
      "name": "456",
      "key_name": "2",
      "code": "xxxxxxx",
      "id": 253007,
      "remote_id": "6c2949716ca8f52c01aquk"
    }
  ]
}

Return failure example

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

Delete the infrared code learned

Function Description

delete the infrared code learned

Interface Address

DELETE /v1.0/infrareds/{infrared_id}/learning-codes/{learn_id}

Request Parameters

ParameterParameter PositionTypeDescriptionRequired
infrared_idURIStringInfrared Device IDYes
learn_idURILongLearned infrared code idYes

Return Message

ParameterTypeDescription
codeIntegerResponse code (details see error code section)
successBooleanwhether succeed(true:success,false:fail)
msgStringRequest failed information, success is empty
resultBooleanReturn results

Response Example

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

Return failure example

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

Infrared Timed Mission

APIRequest MethodDescription
/v1.0/infrareds/{infrared_id}/timersPOSTadd infrared timing tasks
/v1.0/infrareds/{infrared_id}/timers/
categories/{category_id}/remotes/{remote_index}
GETget infrared timing mission
/v1.0/infrareds/{infrared_id}/timers/
groups/{group_id}
PUTupdate infrared timing task
/v1.0/infrareds/{infrared_id}/timers
groups/{group_id}
DELETEdelete infrared timing task
/v1.0/infrareds/{infrared_id}/timersDELETEdelete all scheduled tasks
/v1.0/infrareds/{infrared_id}/timers/groups/{group_id}/statusPUTUpdate infrared packet timing status

Add infrared timing tasks

Function Description

add infrared timing tasks

Interface Address

POST  /v1.0/infrareds/{infrared_id}/timers

Request Parameters

ParameterParameter PositionTypeDescriptionRequired
infrared_idURIStringInfrared Device IDYes
category_idBODYStringType of deviceYes
remote_indexBODYStringRemote control indexYes
loopsBODYStringSeven digits consisting of 0 and 1, 0 for off,1 generation table on, for example : 0000010 on behalf of Sunday, Monday, Tuesday, Wednesday, Thursday, Saturday scheduled mission closed, Saturday scheduled task startYes
time_zoneBODYStringTime Zone, China Pass UTC+08:00Yes
timezone_idBODYStringZoneId ,eg. Asia/shanghaiYes
instructBODYArrayTime-specific time and equipment instructions for timing tasks, support and set up multiple timed tasks at the same timeYes

instruct Description

ParameterTypeDescriptionRequired
timeStringTime to schedule task executionYes
dateStringDate of timed task executionNo(if loops is 0000000,date format: 20181212)
keyStringKey obtained by pairing rulesYes

Request Example

{
  "instruct":[
    {
      "key": "43",
      "time":  "17:42",
      "date":"20181218"
    },
    {
      "key" : "43",
      "time": "17:43",
      "date":"20181218"
     } 
  ],
  "loops":"0000000",
  "category_id": "1", 
  "remote_index": "5129",
  "timezone_id": "Asiz/Shanghai",
  "time_ zone": "+8:00"
}

Return Message

ParameterTypeDescription
codeIntegerResponse code (details see error code section)
successBooleanwhether succeed(true:success,false:fail)
msgStringRequest failed information, success is empty
resultObjectReturn results

result Description

ParameterTypeDescription
group_idStringThe id of the timed task

Response Example

{
    "success": true,
    "result": {
        "group_id": "0000002ftg"
     }
}

Return failure example

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

Get infrared timing mission

Function Description

get infrared timing mission

Interface Address

GET /v1.0/infrareds/{infrared_id}/timers/categories/{category_id}/remotes/{remote_index}

Request Parameters

ParameterParameter PositionTypeDescriptionRequired
infrared_idURIStringInfrared Device IDYes
category_idURIStringType of deviceYes
remote_indexURIStringRemote control indexYes

Return Message

ParameterTypeDescription
codeIntegerResponse code (details see error code section)
successBooleanwhether succeed(true:success,false:fail)
msgStringRequest failed information, success is empty
resultObjectReturn results

result Description

ParameterTypeDescription
groupsArrayTimed task information
categoryObjectTimed task classification

group Description

ParameterTypeDescription
timersArrayTimed task information
idStringTimed task number

category Description

ParameterTypeDescription
categoryStringClassification of scheduled tasks
statusIntegerStatus of the classification of scheduled tasks

timers Description

ParameterTypeDescription
dateStringSet a date for a time
timezone_idStringTime zone id
loopsStringLoop timing information
timeStringSet time
statusIntegerStatus of scheduled tasks(0:off;1:on;2:deleted)
keyStringTimed instructions

Response Example

{
	"success": true,
	"t": 1545135036437,
	"result": {
		"category": {
			"category": "1",
			"status": "1"
		},
		"groups": [{
			"id": "1",
			"timers": [{
				"date": "20181218",
				"timezone_id": "Asiz/Shanghai",
				"loops": "0000000",
				"time": "17:42",
				"status": 1,
				"key": "43"
			}]
		}]
	}
}

Update infrared timing task

Function Description

update infrared timing task

Interface Address

PUT /v1.0/infrareds/{infrared_id}/timers/groups/{group_id}

Request Parameters

ParameterParameter PositionTypeDescriptionRequired
infrared_idURIStringInfrared Device IDYes
group_idURIStringTimed task idYes
category_idBODYStringType of deviceYes
remote_indexBODYStringRemote Control Index
loopsBODYStringSeven digits consisting of 0 and 1, 0 for off,1 generation table on, for example : 0000010 on behalf of Sunday, Monday, Tuesday, Wednesday, Thursday, Saturday scheduled mission closed, Saturday scheduled task startYes
time_zoneBODYStringTime Zone, China Pass edgy .00Yes
timezone_idBODYStringTime zone id ,eg.Asia/shanghaiYes
instructBODYArrayTime-specific time and equipment instructions for timing tasks, support and set up multiple timed tasks at the same timeYes

instruct Description

ParameterTypeDescriptionRequired
timeStringTime to time a task to execute a lineYes
dateStringThe day date of the scheduled task to execute the lineNo(if loops is 0000000,date format: 20181212)
keyStringKey obtained by pairing rulesYes

Request Example

{
  "instruct": [{
    "key": "43",
    "time": "17:42",
    "date": "20181218"
  }, {
    "key": "43",
    "time": "17:43",
    "date": "20181218"
  }],
  "loops": "0000000",
  "category_id": "1",
  "remote_index": "5129",
  "timezone_id": "Asiz/Shanghai",
  "time_zone": "+8:00"
}

Return Message

ParameterTypeDescription
codeIntegerResponse code (details see error code section)
successBooleanwhether succeed(true:success,false:fail)
msgStringRequest failed information, success is empty
resultObjectReturn results

Response Example

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

Return failure example

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

Delete infrared timing task

Function Description

delete infrared timing task

Interface Address

DELETE /v1.0/infrareds/{infrared_id}/timers/groups/{group_id} 

Request Parameters

ParameterParameter PositionTypeDescriptionRequired
infrared_idURIStringInfrared Device IDYes
group_idURIStringTimed Task Group IdYes

Return Message

ParameterTypeDescription
codeIntegerResponse code (details see error code section)
successBooleanwhether succeed(true:success,false:fail)
msgStringRequest failed information, success is empty
resultObjectReturn results

Response Example

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

Return failure example

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

Delete all scheduled tasks

Function Description

delete all scheduled tasks

Interface Address

DELETE /v1.0/infrareds/{infrared_id}/timers

Request Parameters

ParameterParameter PositionTypeDescriptionRequired
infrared_idURIStringInfrared Device IDYes
group_idURIStringTimed Task Group IdYes

Return Message

ParameterTypeDescription
codeIntegerResponse code (details see error code section)
successBooleanwhether succeed(true:success,false:fail)
msgStringRequest failed information, success is empty
resultObjectReturn results

Response Example

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

Return failure example

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

Update infrared packet timing status

Function Description

Update infrared packet timing status

Interface Address

PUT /v1.0/infrareds/{infrared_id}/timers/groups/{group_id}/status

Request Parameters

ParameterTypeParameter PositionDescriptionRequired
infrared_idURIStringinfrared id
group_idURIStringgroup Id

BODY Parameter

ParameterTypeParameter PositionDescriptionRequired
valuebodyStringvalue

Return Message

ParameterTypeDescription
codeIntegerResponse code (see the error code section for details)
successBooleanWhether it is successful: (true: success, false: failure)
msgStringRequest failed information, successfully empty
resultListResult

Request Example

PUT /v1.0/infrareds/{infrared_id}/timers/groups/{group_id}/status

{
  "value": "1"
}

Response Example

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

Air conditioning class remote control

APIRequest MethodDescription
/v1.0/infrareds/{infrared_id}/ac/send-keysPOSTThe combined air conditioner delivery command is mainly related to four states: power mode temp fan
/v1.0/infrareds/{infrared_id}/remotes/{remote_id}/ac/statusGETquery air conditioning status

Control air conditioning

Function Description

The combined air conditioner delivery command is mainly related to four states: power mode temp fan

1, open the air conditioning command to pass parameters: power = 1, other values are null;

2, turn off the air conditioning command pass parameters: power = 0, other values are null;

3, control air conditioning mode pass parameters: power = 1, mode = [0 - 4], other values are null;

4, control the specific temperature of the air conditioning parameters: power = 1, temp = specific temperature value, other values are null;

5, increase the air conditioning temperature parameters: power = 1, temp = 1, other values are null;

6, reduce the air conditioning temperature parameters: power = 1, temp = -1, other values are null;

7, control air conditioning wind speed parameters: power = 1, fan = [0 - 3], other values are null;

8, increase the air conditioning wind speed transmission parameters: power = 1, fan = 100, other values are null;

9, reduce the air conditioning wind speed transmission parameters: power = 1, fan = -100, other values are null;

Modes 0-4 represent: cooling, heating, automatic, air supply, dehumidification

Wind speed 0-3: automatic, low speed, medium speed, high speed

Temp = specific temperature value, - > temperature range 16 - 31

Interface Address

POST /v1.0/infrareds/{infrared_id}/ac/send-keys

Request Parameters

ParameterTypeParameter PositionDescriptionRequired
infrared_idStringURIInfrared Device IdYes

body parameter

ParameterTypeDescriptionRequired
remote_idStringRemote control id(empty string stomps other fields for test mode)Yes
remote_indexStringRemote control indexYes
powerStringSwitch (1: On 0: Off)Yes
modeStringMode (0: cooling, 1: heating, 2: automatic, 3: air supply, 4: dehumidification)No
tempStringTemperature (16-30)No
windStringWind speed (0: automatic, 1: low, 2: medium, 3: high)No
swingStringWind direction (0-2) not supported at this timeNo

Return Message

ParameterTypeDescription
successbooleanWhether it was successful
resultbooleanSpecific parameters returned

Request Example

{
  "remote_id": "6cb2fb33541a44967fxqhy",
  "remote_index": "11842",
  "power": "1",
  "mode": "2",
  "temp": "20",
  "wind": "1"
}

Return success example

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

Return failure example

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

Query air conditioning status

Function Description

query air conditioning status

Interface Address

GET /v1.0/infrareds/{infrared_id}/remotes/{remote_id}/ac/status

Request Parameters

ParameterTypeParameter PositionDescriptionRequired
infrared_idStringURIInfrared Device IdYes
remote_idStirngURIRemote control idYes

Return Message

ParameterTypeDescription
successbooleanWhether it was successful
resultarraySpecific parameters returned

**result description **

ParameterTypeDescription
modeStringMode
tempStringTemperature
windStringWind speed
powerStringSwitch
remote_idStringAir conditioning remote control id

Return success example

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

Return failure example

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

Universal Interface

APIRequest MethodDescription
/v1.0/infrareds/{infrared_id}/remotesGETobtain a list of remote controls bound under the infrared device
/v1.0/infrareds/{infrared_id}/add-remotePOSTAdd remote controls
/v1.0/infrareds/{infrared_id}/remotes/{remote_id}DELETEremove remote control
/v1.0/infrareds/{infrared_id}PUTset remote control alias
/v1.0/infrareds/{infrared_id}/categories/{category_id}/brands/
{brand_id}/remotes/{remote_index}/rules
GETThis interface is used to get the pairing rules for the remote control, and the key in the return value is the key of the interface that issues the infrared code according to the key
/v1.0/infrareds/{infrared_id}/send-keysPOSTThis interface is based on the key to issue an infrared code, the key in the request parameter is obtained from the get pairing rule key,currently this interface only supports tv and set-top box, Air conditioning has its own separate release rules.
/v1.0/infrareds/{infrared_id}/remotes/{remote_id}/send-keys.POSTKey release based on common rules,key can refer to Appendix

Get a list of remote controls bound under infrared devices

Function Description

This interface is based on the infrared device Id to obtain a list of remote controls bound under the infrared device

Interface Address

GET /v1.0/infrareds/{infrared_id}/remotes

Request Parameters

ParameterTypeParameter PositionDescriptionRequired
infrared_idStringURIInfrared Device IdYes

Return Message

ParameterTypeDescription
successbooleanWhether it was successful
resultarraySpecific parameters returned

result description

ParameterTypeDescription
category_idStringDevice Type Id
brand_idStringbrand Id
brand_nameStringBrand Name
remote_idStringRemote control device ID
remote_nameStringName of the remote control
remote_indexStringRemote control index
operator_idStringCarrier Id(value when device type is set-top box)
operator_nameStringCarrier name (value when device type is set-top box)
area_idStringZone Id(value when device type is set-top box)
area_nameStringZone name (value when device type is set-top box)
iptv_typeIntegerIPTV type(1:Yes;0:No has value when device type is set-top box)
tLongAdd time (thirteen-digit standard timestamp)

Return success example

{
  "success": true,
  "result": [{
      "category_id": "5",
      "brand_id": "97",
      "remote_id": "6cf1fd8b5fb7e090c97mqf",
      "remote_name": "格力空调",
      "remote_index": "10727",
      "t": 1539776581583
    },
    {
      "category_id": "1",
      "brand_id": "1017",
      "brand_name": "中兴",
      "remote_id": "6c9a93cdaf677cfd151q3t",
      "operator_id": "42",
      "operator_name": "浙江电信IPTV",
      "area_id": "330106",
      "area_name": "浙江省杭州市西湖区",
      "remote_name": "机顶盒 11",
      "remote_index": "5129",
      "iptv_type": 1,
      "t": 1539776581583
    }
  ]
}

Request failed return example

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

Add remote control

Function Description

This interface can be added to the remote control of devices such as STB, TVs, air conditioners

Interface Address

POST /v1.0/infrareds/{infrared_id}/add-remote

Request Parameters

ParameterTypeParameter PositionDescriptionRequired
infrared_idStringURIInfrared Device IdYes

body parameter

ParameterTypeDescription
category_idStringDevice Type Id
brand_idStringbrand Id
brand_nameStringBrand Name
remote_indexStringRemote control index
remote_nameStringName of the remote control
operator_idStringCarrier Id(value when device type is set-top box)
operator_nameStringCarrier name (value when device type is set-top box)
area_idStringZone Id(value when device type is set-top box)
area_nameStringZone name (value when device type is set-top box)
iptv_typeIntegerIPTV type(1:Yes;0:No has value when device type is set-top box)

Return Message

ParameterTypeDescription
successbooleanWhether it was successful
resultjsonSpecific parameters returned

result description

ParameterTypeDescription
remote_idStringRemote control device ID

Request Example

{
	"category_id":"5",
	"brand_id":"37",
	"brand_name":"海尔",
	"remote_index":"657",
	"remote_name":"海尔空调遥控器",
	"operator_id":"",
	"operator_name":"",
	"area_id":"",
	"area_name":"",
	"iptv_type":""
}

Return success example

{
    "result": {
        "remote_id": "6ca8ff6dcaf9bf7f40x45x"
    },
    "success": true,
    "t": 1580962693233
}

Request failed return example

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

Remove remote control

Function Description

remove remote control

Interface Address

DELETE /v1.0/infrareds/{infrared_id}/remotes/{remote_id}

Request Parameters

ParameterTypeParameter PositionDescriptionRequired
infrared_idStringURIInfrared Device IdYes
remote_idStringURIRemote control device IDYes

Return Message

ParameterTypeDescription
successbooleanWhether it was successful
resultbooleanSpecific parameters returned

Return success example

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

Request failed return example

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

Set remote control alias

Function Description

set remote control alias

Interface Address

PUT /v1.0/infrareds/{infrared_id}

Request Parameters

ParameterTypeParameter PositionDescriptionRequired
infrared_idStringURIInfrared Device IdYes

body parameter

ParameterTypeDescriptionRequired
remote_idStringRemote control device IDYes
remote_nameStringRemote control aliasYes

Return Message

ParameterTypeDescription
successbooleanWhether it was successful
resultbooleanSpecific parameters returned

Request Example

{
  "remote_id": "6cb5e6ed55541f4320eeyf",
  "remote_name": "空调 1"
}

Return success example

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

Request failed return example

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

Get remote control pairing rules

Function Description

This interface is used to get the pairing rules for the remote control, and the key in the return value is the key of the interface that issues the infrared code according to the key

Interface Address

GET /v1.0/infrareds/{infrared_id}/categories/{category_id}/brands/{brand_id}/remotes/{remote_index}/rules

Request Parameters

ParameterTypeParameter PositionDescriptionRequired
infrared_idStringURIInfrared Device IdYes
category_idStringURIDevice Type IdYes
brand_idStringURIbrand Id,If there is no brand, pass 0Yes
remote_indexStringURIRemote control indexYes

Return Message

ParameterTypeDescription
successbooleanWhether it was successful
resultarraySpecific parameters returned

result Description

ParameterTypeDescription
key_nameStringKey name
keyStringMatch Id
descStringKey description
codeStringInfrared code

Successful return of data example (normal remote control)

{
  "success": true,
  "result": [{
      "key": "1",
      "desc": "电源",
      "key_name": "power",
      "code": "5jCCYZ55TmdmWoKreGWbE2HGP9BFG9QuaLUVy6jVNsU="
    },
    {
      "key ": "42",
      "desc": "确认",
      "key_name": "ok",
      "code": "54CYZ55TmdmWoKreGWbE2HGP9BFG9QuaLUVy6jVNsU="
    },
    {
      "key": "43",
      "desc": "频道+",
      "key_ name": "channel_up",
      "code": "09CCYZ55TmdmWoKreGWbE2HGP9BFG9QuaLUVy6jVNsU="
    }
  ]
}

Successful return data example (air conditioning remote control)

{
  "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": "7dCCYZ55TmdmWoKreGWbE2HGP9 BFG9QuaLUVy6jVNsU="
    },
    {
      "key": "0",
      " desc": null,
      "key_name": "M0_T17_S0",
      "code": "6vbCCYZ55TmdmWoKreGWbE2HGP9BFG9QuaLUVy6jVNsU="
    }
  ]
}

Request failed return example

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

Control Remote Control: Based on Pairing Rules

Function Description

This interface is based on the key to issue an infrared code, the key in the request parameter  is obtained from the get pairing rule key,currently this interface only supports tv and set-top box, Air conditioning has its own separate release rules. 

Interface Address

POST /v1.0/infrareds/{infrared_id}/send-keys

Request Parameters

ParameterTypeParameter PositionDescriptionRequired
infrared_idStringURIInfrared Device IdYes

body parameter

ParameterTypeDescriptionDescriptionRequired
keyStringInfrared code keyThis key is from getting pairing rules to get keyYes
remote_indexStringRemote control indexRemote control indexYes

Return Message

ParameterTypeDescription
successbooleanWhether it was successful
resultbooleanSpecific parameters returned

Request Example

{
  "remote_index": "5129",
  "key": "43"
}

Return success example

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

Request failed return example

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

Control Remote Control: Based on the added remote

Function Description

Key release based on the added remote,key can refer to Appendix

Interface Address

POST /v1.0/infrareds/{infrared_id}/remotes/{remote_id}/send-keys

Request Parameters

ParameterTypeParameter PositionDescriptionRequired
infrared_idStringURIInfrared Device IdYes
remote_idStringURIRemote control idYes
keyStringBODYUniversal keys,body parametersYes

Return Message

ParameterTypeDescription
successbooleanWhether it was successful
resultbooleanSpecific parameters returned

Request Example

{
  "key": "Power"
}

Return success example

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

Request failed return example

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

Appendix

TV

keyDescription
PowerPower
OKConfirm
Channel+Channels . . .
Channel-Channel -
MenuMenu
UpOn
DownNext
LeftLeft
RightRight
Volume+Volume s. . .
Volume-Volume -
ReturnReturn
HomepageHome
11
22
33
44
55
66
77
88
99

Stb

keyDescription
PowerPower
OKConfirm
Channel+Channels . . .
Channel-Channel -
UpOn
DownNext
LeftLeft
RightRight
Volume+Volume s. . .
Volume-Volume -
11
22
33
44
55
66
77
88
99
##
MuteMute
ReturnReturn
HomepageHome
BackwardReback
PlayPlay
ForwardFast forward
StopStop it
PauseTime out
PrevTop
NextNext page
TVLive
DemandOn-demand
RedRed
GreenGreen
BlueBlue
YellowYellow
AudioChannel
FavoriteCollection
InformationInformation
SetupSet up
F1F1
F2F2
F3F3
F4F4
HelpHelp
*Input
LocationPositioning
ReviewLook back
DesktopDesktop
MemorySwitchMemory / Switching

air conditioning

keyDescription
PowerOnPower On
PowerOffPower Off
M0-M4Mode 1-Mode 4 (Cooling, Heating, Automatic, Heating, Dehumidification)
T16-T30Temperature 16-30
F0-F3Wind speed 1-High speed 4 (Auto, low, medium, high speed)

fan

keyDescription
PowerOnPower On
PowerOffPower Off
SwingOscillate fan
SpeedFan speed
TimingTiming