[Tuya IoT footprint] Tuya cloud platform interface list-universal infrared remote control

Preface series of articles >>>

[Tuya IoT footprint] Tuya cloud platform interface list

Our series of articles will focus on how to complete the development of an intelligent "air kissing machine". Hope to help couples who are in different places or foreign countries!

In this article, we will roughly explain the universal infrared remote control which is one of the vertical categories in the API interface list~

At present, the Tuya Cloud Development Platform provides a total of 12 basic interface lists (see the previous article) and 5 vertical category interfaces. The so-called "vertical categories" are based on scene-based interfaces~ Let's introduce them one by one next~

1. General introduction of universal infrared:

Universal infrared: Universal infrared remote control, also known as universal infrared gateway, can replace 99% mainstream brand infrared remote control at home and abroad, and supports DIY learning function. It allows traditional home appliances to quickly access the Internet, supports mobile phone control, scene linkage and other rich functions. For product introduction and related parameters, please visit  Universal Infrared Remote Control .

The scene types include: ordinary remote control, set-top box remote control, air conditioner remote control, in addition to universal interfaces, infrared code learning, infrared code intelligent matching, infrared timing tasks, and so on.

2. List of scene interface:

Ordinary remote control

The type of remote control used to control the TV and fan. This scenario is only a recommended infrared process. According to their different needs, they can develop and enrich their own business process scenarios based on open interfaces.

       The operation process is as follows:

API list:

  • Get the type of device supported by infrared: Get the type of device supported by infrared device, currently supports TV, set-top box, air conditioner, fan, etc.
  • Obtain a list of specified types of brands: Obtain a list of brands by remote control type, which supports TV and air conditioners.
  • Obtain the index list of remote control supported by the brand: Obtain the index list of the remote control of all models under the specified brand according to the brand id.
  • Add ordinary remote control: Add a remote control of a specified model to form an instantiated virtual remote control.

 

Set-top box remote control

The set-top box device supports IPTV and non-IPTV. This scenario is only a recommended infrared process. According to their different needs, they can develop and enrich their own business process scenarios based on open interfaces.

Operating procedures:

API(2): API document-get a list of provinces

API(3): API document-get a list of cities

API(4): API document-get the list of areas

API(7): API document-Get index list of remote control: According to brand

API(8): API document-get the remote control index list: according to area

API list:

  • Get list of provinces: Get list of provinces.
  • Get city list: Get the city list based on the province ID.
  • Obtain a list of areas: Obtain a list of areas based on the province ID and city ID.
  • Obtain the operator list according to the area: For set-top box type devices, you can obtain the list of IPTV s supported by the specified area.
  • Obtain the brand list according to the operator: For set-top box devices, according to the list of brands supported by the operator.
  • Obtain the remote control index list according to the brand/region: According to the type ID/region ID, obtain the remote control index that supports the IPTV operator.
  • Add set-top box remote control: add set-top box remote control.
  • Query the TV channel list: query the channel list according to the remote control ID.
  • Switch TV channel: switch TV channel

Air conditioner remote control

This scenario is only a recommended infrared process. According to their different needs, they can develop and enrich their own business process scenarios based on open interfaces. .

Operating procedures:

Or air-conditioning proprietary command control equipment; API (5): API document-control air-conditioning remote control

  • In some business scenarios, there is the situation of directly controlling the relevant parameters of the air conditioner. Calling multi-condition air conditioner commands to directly control the relevant parameters of the air conditioner, but please note that not all combined conditions can support the direct issuing of infrared codes; API(6): API document ——Multi-condition control air conditioner

The air conditioner remote control only supports the standard commands described in the API document, and does not support non-standard commands.

API list

  • Test the remote control of the air conditioner: When testing whether the remote control of the air conditioner matches the air conditioner, it is used to issue a single key command of the air conditioner remote control according to the remote control index.
  • Control the air conditioner remote control: issue a single key command of the air conditioner remote control.
  • Multi-condition control air-conditioning: multi-condition air-conditioning commands are issued to control the air-conditioning in some linkage scenarios.
  • Query air conditioner status: query the air conditioner status.

 

3. List of other interfaces:

Common interface API list:

  • Get the list of remote controls bound to the infrared device: Get the list of remote controls bound to the infrared device according to the infrared device ID.
  • Add/delete/set remote control: This interface can be compatible with remote control add/delete/setting of set-top box, TV, air conditioner and other types of equipment.
  • Obtain remote control pairing rules: Obtain the pairing rules according to the remote control ID, and obtain the key for infrared code delivery.
  • Control the remote control: test scene button (based on common standard buttons): used when testing whether the remote control matches the device. Use general standard key control, see appendix for standard key. Support the issuance of standard instructions for air conditioning.
  • Control the remote control: Test scene button (based on pairing rules): Used when testing whether the remote control matches the device. The infrared code is issued according to the key, and the key in the request parameter is obtained from the matching rule. Non-standard instructions do not support air conditioners, and air conditioners are issued using proprietary instructions.
  • Control the remote control: the remote control has been added (based on the pairing rules): control the bound remote control to issue instructions, and send the infrared code according to the raw_key. The raw_key in the request parameter is the key obtained from the pairing rules. Currently this interface Only supports TVs and set-top boxes, and air conditioners use proprietary instructions to issue.
  • Get the list of keys supported by the remote control: query the list of keys supported by the specified remote control, and return the supported standard keys and non-standard keys at the same time.
  • Get the list of key rules supported by the air conditioner remote control: query only the key list supported by the remote control of the specified air conditioner, and return the supported standard keys and non-standard keys, and return the supported key range at the same time.

Infrared code learning API list

After the learning state is turned on, use the real remote control to point at the universal infrared device and press the button that needs to be learned, and then use the API to query the learned learning code to obtain the learned learning code.

  • Update learning status: enter learning status
  • Query the learned infrared code: get the learned infrared code. It is recommended to directly use the timestamp t returned when the learning status is updated for the incoming parameters .
  • Issue/update/delete learned infrared code: issue/update/delete learned infrared code.
  • Save the learned infrared code: save the learned infrared code and generate the remote control id
  • Get the saved learning infrared code: get the saved learning infrared code

Infrared code smart matching API list

There may be many preset remote control infrared code library indexes under some brands. Sometimes in order to try to find out whether a certain index supports the equipment that needs to be controlled, it may be necessary to test multiple times. As a result, a remote control will take a lot of time and time to match successfully. energy. ​ So provide the infrared code intelligent matching function, which can quickly match the remote control infrared code library index according to the learned infrared code.

The premise is to provide a real remote control for learning and matching.

Operating procedures:

  1. Turn on the learning status of the infrared gateway; API document-update the learning status
  2. The user uses the remote control to aim at the infrared gateway to send the infrared code;
  3. Get the learning code learned by the infrared gateway API document-query the learned infrared code
  4. Use the learned  learning code to  request smart matching, and return  smart matching tokenAPI documentation-generate smart matching token
  5. Use  smart matching token to  request the matching list; API document-get the smart matching remote control list
  6. The user checks the index information of the remote control in the returned matching list;  API document-get the brand information supported by the remote control index
  7. Cycle attempts to match the keys in the remote control index of the list;

API document-control remote control: test scene buttons (based on common standard buttons)

API document-test air conditioner remote control

  1. If it finds a suitable one, confirm the remote control and end this smart matching action; otherwise, continue to the following steps; API document-add remote control
  2. If no suitable one is found, continue to use the  smart matching token to  request the matching list, and proceed to step 5, here is the paging processing performed when there are multiple matching results. If there is only 1 page, you do not need to go to step 5 The operation;
  3. If the interface returns no data, the matching list ends;
  4. If you need to further narrow the matching range, you can turn on the infrared gateway learning state again, issue a new learning code, and then obtain a new  smart matching token  (steps 1, 2, 3, 4);
  5. Then use the new  smart matching token  and bring the old smart matching token  in step 5  to request the matching list together. Based on the infrared code matching learned in step 3, the system will use the infrared code obtained in step 11 to further Narrow the scope of matching;
  6. Then repeat steps 6, 7, 8, 9, 10, 11 until a suitable remote control index is found, or it is not matched.

API list:

  • Production of smart matching token: Use the infrared code learned by the infrared gateway to generate a smart matching token token for subsequent paging query of the smart matching result.
  • Get the smart matching remote control list: use the generated smart matching token token to query the smart matching result list by page.
  • Get brand information supported by the remote control index: query the information of the brands supported by the specified remote control index.

Infrared timing task API list

  • Add infrared timing task: Add an infrared timing task.
  • Get/update/delete infrared timing tasks: query/update/delete infrared timing tasks.
  • Delete all timed tasks: delete all timed tasks.
  • Update infrared packet timing status: update infrared packet timing status.

 

All the above interface addresses can be queried here >>> Tuya Cloud Platform Interface List

 

Guess you like

Origin blog.csdn.net/weixin_50563088/article/details/109646700