Skip to content

Qualifying a device

ultratoto14 edited this page Dec 9, 2020 · 1 revision

What you should know

Tuya devices internal model is based on Data Points or DP which is represented by a number. Each DP has a specific functionality. The same functionality can use different DP numbers on devices provided by different manufacturers or if a device is providing different services.

On many devices, the DPs are linked to each over, meaning that a specific behavior changes multiple DPs.

Example: A bulb light with RGB+W uses the DPs:

  • "20", a boolean representing the on/off status
  • "21", a string representing the color mode in ["white", "colour", "scene", "music"]
  • "22", a number representing the brigthness range in [10, 1000]
  • "24", a string representing the coded color and brightness in color mode

In our case, changing from on status with white color and brightness to 50% with the status

{
    "20", true,
    "21", "white",
    "22", 500,
    "24", "000003e803e8"

}

to color in red with 100% brightness

{
    "20", true,
    "21", "colour",
    "22", 500,
    "24", "016803e803e8"

}

The color mode changed and the brightness is encrypted in the color.

Many of the tuya devices only support one connection at a time. It means that when connected through the Tuya App, you will not be able to access it from tuya-cli, tuyadebug or homeassistant. In that case, ensure you exit the tuya app (by pressing back two times in Android)

Prerequisites

You need the Tuya device IP, ID and local Key. See the different procedures there to get them.

Once you have the keys, check that you can have access to the device as explained here.

If the tuyadebug is not working, ensure that the Tuya App is not running. In extreme cases, check that you did not enable google/alexa access to your devices.

Finding the boundaries and identifying the DPs

If you have a new device and want to integrate it with localtuya, first check the already known devices to find out if yours is listed or if a device is similar to yours. The list is available here.

If the device is not listed, you would need to identify the DPs and find the boundaries.

Do as follow:

  1. Choose one functionality (on/off for a switch or a light. brightness or white color temp or color for a bulb...)
  2. Using the Tuya App, set a boundary of the chosen functionality (on or off, min brightness or max brightness ...).
  3. Optional: If your device does not support two connections, close the Tuya App
  4. Using tuyadebug, get a DP dump.
  5. Identify what are the changing DPs and the corresponding values.
  6. Return to 1. and choose another functionality

Based on your device type and the found DPs, check again the Known Devices, try to find some similarities with other devices.

If you still cannot configure your device correctly, open an issue with the different data gathered in this procedure.