Common APIs for Infrared Devices

Last Updated on : 2023-06-20 14:53:58

This topic describes the business process and time series relationship of common APIs for infrared devices.

Common APIs for Infrared Devices

Procedure

  1. Get a list of IR device types supported by cloud development. For more information, see Get Category List.

  2. Get a list of supported brands in terms of device categories you wish to control. For more information, see Get Brand List.

  3. Get the predefined IR code library index by specified brands. For more information, see Get Remote Control Indexes.

  4. A brand might have multiple IR code library indexes. You need to test and find indexes suitable for IR devices. It is recommended to test at least three valid keys before you add a remote control. For more information, see Send Standard Command (During Pairing).

  5. After the available IR code library index is confirmed, use this index to bind a general remote control with a universal IR remote control. For more information, see Add Remote Control.

  6. Use the general remote control to control devices by standard IR commands. For more information, see Send Standard Command.

Non-standard IR commands

Generally, standard IR commands cover most application scenarios. If remote control capabilities for certain categories are not included, you can query the full set of remote control capabilities by remote control ID.

The standard IR commands are Tuya’s highly abstract command sets for the same category. You can develop unified control methods by categories, without integrating IR command sets for different brands and models, namely the non-standard IR command sets.

Standard IR command

  • TV

    Key value Description
    Power Power supply
    OK Confirm
    Channel+ Channel+
    Channel- Channel-
    Menu Menu
    Up Up
    Down Down
    Left Left
    Right Right
    Volume+ Volume+
    Volume- Volume-
    0 0
    1 1
    2 2
    3 3
    4 4
    5 5
    6 6
    7 7
    8 8
    9 9
    -/– -/–
  • Set-top box

    Key value Description
    Power Power supply
    OK Confirm
    Channel+ Channel+
    Channel- Channel-
    Menu Menu
    Up Up
    Down Down
    Left Left
    Right Right
    Volume+ Volume+
    Volume- Volume-
    0 0
    1 1
    2 2
    3 3
    4 4
    5 5
    6 6
    7 7
    8 8
    9 9
    * *
    # #
  • Air conditioner

    Key Description
    PowerOn Power on
    PowerOff Power off
    M0–M4 Mode 1 to 5 (cool, heat, auto, fan, dry)
    T16–T30 Temperature: 16 to 30°C
    F0–F3 Speed levels 1 to 4 (auto, low, medium, high)
  • Fan

    Key Description
    PowerOn Power on
    PowerOff Power off
    Swing Swing
    Speed Speed
    Timing Schedule
    NegativeIon Anion
  • Projector

    Key Description
    PowerOn Power on
    PowerOff Power off
    OK Confirm
    Menu Menu
    Up Up
    Down Down
    Left Left
    Right Right
    Volume+ Volume+
    Volume- Volume-
    Mute Mute
    Back Back
    Home Homepage
  • Network set-top box

    Key Description
    Power Power supply
    OK Confirm
    Menu Menu
    Up Up
    Down Down
    Left Left
    Right Right
    Volume+ Volume+
    Volume- Volume-
    Home Homepage
    0 0
    1 1
    2 2
    3 3
    4 4
    5 5
    6 6
    7 7
    8 8
    9 9
    * *
    # #
  • Light

    Key Description
    PowerOn Power on
    PowerOff Power off
    ColdLight Cool colors
    WarmLight Warm colors
    Brightness+ Brightness+
    Brightness- Brightness-
    RedLight Red light
    GreenLight Green light
    BlueLight Blue light
  • Speaker

    Key Description
    PowerOn Power on
    PowerOff Power off
    Volume+ Volume+
    Volume- Volume-
    Play Play
    Pause Pause
    Previous Previous
    Next Next
  • DVD

    Key Description
    PowerOn Power on
    PowerOff Power off
    OK Confirm
    Menu Menu
    Up Up
    Down Down
    Left Left
    Right Right
    Volume+ Volume+
    Volume- Volume-
    Mute Mute
    Back Back
    Display Display
    Home Homepage
    Rewind Playback
    Play Play
    Forward fast-forward
    Stop Stop
    Pause Pause
    Open/Close Eject
    Previous Previous
    Next Next
    Info Information
  • Cameras

    Key Description
    OK Confirm
    Up Up
    Down Down
    Left Left
    Right Right
    Delay Delay
    Shutter Shutter
  • Air purifier

    Key Description
    Power Power supply
    Mode Mode
    Sleep Sleep
    Timing Schedule
    ChildLock Child lock
    Auto Automatic
    Speed Speed
  • Water heater

    Key Description
    Power Power supply
    Mode Mode
    Temperature+ Temperature+
    Temperature- Temperature-
    Sleep Sleep
    Timing Schedule
    Reservation Reservation

FAQ

Q: How can I connect the device to the cloud?

For more information, see Network Pairing Management.

Q: How can I get the device ID?

For more information, see Device Management.

In the returned result, id is the device ID you need.