User Guide for tuya models including: 20240614 Smart Industry App, 20240614, 20240614 Industry App, Smart Industry App, Industry App, App

Quick Start of Custom Development

Quick Start of Custom Development

13 lug 2024 — Follow the guide to register a developer account. The registered account ... Scan the QR code to download and install the Smart Industry app, pair and add.

Quick Start of Custom Development-Tuya Developer Platform-Tuya Developer

Quick Start of Custom Development - images.tuyacn.com

2 Becomeadeveloper 2 Become a developer 1. GototheaccountregistrationpageontheTuyaDeveloperPlatform. 2. Followtheguidetoregisteradeveloperaccount.


File Info : application/pdf, 15 Pages, 1.27MB

PDF preview unavailable. Download the PDF instead.

Quick Start of Custom Development Tuya Developer Platform Tuya Developer Platform
Quick Start of Custom Development
Version: 20240614
Online Version

Contents

Contents

1 Example

2

2 Become a developer

4

3 Create and set up a cloud project

5

4 Add a device

8

5 Enable message service

9

6 Develop and debug

10

6.1 API calls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

6.2 Message service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

I

Contents This topic describes how to create and set up a cloud development project in the custom development system, and how to integrate it with Tuya's cloud development.
1 / 13

1 Example
1 Example
In a cloud project, you can add assets and add devices under the assets. Then, query user and device information and control devices by using OpenAPI and message queues.
1. Become a developer on the Tuya Developer Platform. 2. Create and set up a cloud development project. 3. Add devices. 4. Subscribe to the message service. 5. Develop and debug.
a. Get a list of devices under a specified asset. b. Query the instructions supported by a device in the device list. c. Send an instruction to the device. d. With the message service, listen for the messages generated by this in-
struction. The following figure shows the interaction logic.
2 / 13

1 Example 3 / 13

2 Become a developer
2 Become a developer
1. Go to the account registration page on the Tuya Developer Platform. 2. Follow the guide to register a developer account. The registered account is
granted all respective permissions. Keep it properly. If you are an organization developer, you can follow instructions in Organization Verification and verify your organization's identity.
4 / 13

3 Create and set up a cloud project
3 Create and set up a cloud project
The cloud project is a carrier or collection of resources on the Tuya Developer Platform, including devices and users. Resources deployed for each project are isolated from those for other projects.
1. Log in to the Cloud Development Platform. 2. In the left-side navigation bar, choose Cloud > Development > Create Cloud
Project.
3. Enter the required information as prompted and click Create. To create a custom development project, you must select Custom in the Development Method field.
5 / 13

3 Create and set up a cloud project 4. On the Configuration Wizard page, click Authorize and go to quickly create
an asset and a user.
By default, the APIs that support the specified development method are selected for the project on the platform. You can add or delete the default API services, or select other API services. For more information about API services, see Manage API Services. 5. Enter the required information as prompted and click Create. The platform will create an asset and a user accordingly, and authorize the user to access the asset.
6 / 13

3 Create and set up a cloud project
You can also choose to skip this step and create assets and users after the cloud project is created. For more information about assets, see Manage Assets. 6. After you create and set up a project, you can view the project in the project list.
For more information about cloud projects, see Manage Projects. 7 / 13

4 Add a device
4 Add a device
1. On the page of Cloud Management, click a project to enter the details page. 2. Choose Assets > Add Device, and then select Add Devices with Smart
Industry App. 3. Scan the QR code to download and install the Smart Industry app, pair and add
a device to the asset.
The following figure shows the result of adding a device.
:::info If you do not have a virtual device, you can add a virtual device to try out first. For more information about virtual devices, see Manage Virtual Devices. :::
8 / 13

5 Enable message service
5 Enable message service
On the page of Cloud > Message Service, you can enable this service for the cloud project and configure parameters to get alerts of excessive messages.
The following figure shows the result of enabling the message service.
For more information about the message service, see Message Service. 9 / 13

6 Develop and debug
6 Develop and debug
6.1 API calls
We will use API Explorer to complete the above case. 1. Call the Get Device List API to get a list of devices under the asset.
As shown above, there is a socket device with ID 87707085bcddc******3 under the asset. 2. Call the Get the instruction set of the device API to get the instruction set supported by the device.
10 / 13

6 Develop and debug
The socket supports two functional instructions: · Switch · Countdown The code of the switch instruction is switch_1, and the value is of Boolean type. true: Turn on. false: Turn off. For more information about functional instructions, see Standard Instruction Set.
3. Call the Send commands API to control the device and turn on the socket.
11 / 13

6 Develop and debug The output window shows that the insruction has been sent to the device.
6.2 Message service
1. On the Message Test tab, add the device to the message test channel and enable the Test Channel.
2. Call the Send commands API again and observe the test channel.
As you can see, the listener has returned the message that the socket was turned off. The message test channel is for trial and debugging only. If you add your device to the test channel, you will not receive messages in the production environment.
12 / 13

6 Develop and debug Now, you have completed the quick start and can dive deep to the custom development system.
13 / 13



References

LaTeX via pandoc with the Eisvogel template xdvipdfmx (20200315)