Find Tuya Data Points
Tuya devices use a custom
manuSpecificTuya cluster. Within the reported values of this cluster's data is a dp (so called “Data Point ID”) which is at the core of Tuya devices. From the point of view of a device the DPIDs are the functions that the device provides. The instructions below will help you use the Tuya IoT Platform with a Tuya gateway to determine the functions of the datapoints which, will later assist in the creation of a device converter.
Requirements and caveats
- You will need an up-to-date version of Google Chrome (other browsers may work but, instructions may differ)
- You will require basic knowledge of using Chrome and its Dev Tools
- You will need to sign up for the Tuya IoT Platform and bind your accounts (more details below)
- You will require a Tuya Zigbee Gateway
- You will need the Tuya app (with the orange icon) installed on your mobile device
1. Standard part of the setup
Ensure that you have set up a Tuya account and bound your Zigbee device to the Tuya gateway (these instructions will assume this has already been done).
2. Signin up for Tuya IoT Platform
The Tuya IoT Platform is the backbone for how internet connected Tuya devices communicate back to the Tuya platform. It contains a suite of Application Programming Interfaces (API's) which allow for developers to embed the Tuya functionality within their own platforms.
Visit Tuya IoT Platform and sign up for a new account (if you don't already have one):
Use your new credentials to login to the Tuya IoT Platform. You will be greeted with a first time tutorial showing you around the platform. At the end of the tutorial select
Individual Developer. If you miss this, click on the
person icon in the right-top ->
Account and set
Account Type to
4. Create a cloud project
Cloud in the side menu,
Development in the sub-menu and then click on
Create Cloud Project.
In the newly opened dialog box, fill in the details as required, enduring that the Development Method is selected as Smart Home, and the Data Center corresponds to the region that your Tuya account is associated with.
Once confirmed, a new dialog box will open. Next to
Select API Services, click
5. Link your Tuya account with your new Tuya project
Once confirmed, you should be taken to your new Tuya project. Click on,
Link Tuya App Account, then
Add App Account.
This should bring up a QR code. Go in to the Tuya app on your mobile device, click on
[+] (as id you are adding a new device). At the top of the screen, you will see a scan barcode button
[-]. Click the
[-] button and give permissions to use the camera (if prompted). Scan the QR code with your mobile device, and press
Confirm login. On your computer a pop-up
Link Tuya App Account will be shown. Set
Device Linking Method to
Device Permission to
Read, write, and Manage and click
Ok. You will get a pop-up showing the amount of devices was added, close this.
6. Find your devices
Click on the
All Devices and find the device in-which you wish to find the Data Points. Click on
Debug Device. If you do not find your device in the list, or the list is empty, please check your project's region.
7. Display device logs
Click on the
Device Logs tab, and you will see a list of all events that the device has sent to the Tuya platform. Ignore the Event Details section as this appears to be garbage.
8. Find your Data Point!!
Select the Data Point for-which you wish to find the ID for in the drop-down list above the events table. Open up Dev Tools by pressing
i on your keyboard, or going to the
3-dot menu at the top-right of the Chrome window->
Dev Tools. When Dev Tools is open, click on the
Network Tab, then click the
Search button in the Tuya IoT Platform window.
You should see a number of calls appear in the
Name section of Dev Tools. The call that we are interested in it
list. Click this, and scroll down in the right-hand pane until you see the
Request Payload section. Within there, is a json encoded object which contains all of the data sent from the search function. One of the keys is labelled
code i.e. 112 is the value for your Data Point ID!
9. Rinse, and repeat!
You should now iterate through each of the Data Points that are available in the drop-down list. Once finished, follow the other How-To guides to map these Data Point's into converters.