-
Notifications
You must be signed in to change notification settings - Fork 564
Qualifying a device
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"
, aboolean
representing theon/off
status -
"21"
, astring
representing the color mode in ["white"
,"colour"
,"scene"
,"music"
] -
"22"
, anumber
representing the brigthness range in [10
,1000
] -
"24"
, astring
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
orhomeassistant
. In that case, ensure you exit the tuya app (by pressing back two times in Android)
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.
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:
- Choose one functionality (
on/off
for a switch or a light.brightness
orwhite color temp
orcolor
for a bulb...) - Using the Tuya App, set a boundary of the chosen functionality (
on
oroff
,min brightness
ormax brightness
...). - Optional: If your device does not support two connections, close the Tuya App
- Using
tuyadebug
, get aDP
dump. - Identify what are the changing
DPs
and the corresponding values. - 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.