Catalog

Docs

Solutions Introduction

Last Updated on2020-01-20 06:49:57

Open platform

img

After the device is connected to the Internet, third-party client (APP) developers of the hardware manufacturer or device buyer can use the openapi or SDK provided by the Tuya open platform for rapid native application (Android / iOS) and web application development (such as : Applets, SaaS backend, cloud platforms, etc.);

For all IoT devices connected to Tuya Cloud, the device control capability is authorized to call through the cloud API. Developers can implement the development of internal business logic by calling APIs. Device status monitoring is opened in the form of message queues to meet The three-party developers’ monitoring of the device status is used to achieve the linkage between different devices.

Tuya Smart Platform has realized the ability of cross-chip platform and cross-communication platform. Tuya Smart supports up to 7 mainstream communication protocols, including Wi-Fi, BLE, BLE mesh, ZigBee, NB-IoT, GPRS, and Sub-G. Wi-Fi supports 2.4G & 5G dual-frequency connection technology;

The Tuya open platform supports the opening of devices of different categories and different communication capabilities to support the application of makers and manufacturers in various home, business and urban scenarios.

The Tuya Open Platform provides various integrate modes based on Tuya’s mature IoT services, combining different docking scenarios:

  • Simple mode (implicit authorization):

Tuya Cloud provides a cloud-based docking method based on the oauth2 protocol. Developers can apply for a cloud API on the tuya iot platform, call tuya openapi according to the tuya openapi interface specification, obtain the developer’s own user and device data, and control the device through permissions.
For this case, developers need to create OEM Applications or create products on the platform. After that, you can get user data or device data based on your development account.

  • Authorization code mode (explicit authorization):

After applying the cloud API key on Tuya cloud platform, developers can call Tuya open interface based on Tuya openapi interface specification to obtain resource data and authorization scope under authorization Resource data
For cloud integration scenarios where there is no OEM Application in the tuya platform, tuya cloud provides an authorization code method.

Multi-dimensional data acquisition methods:

  • Application dimension:

The users bound to the device belong to the application created by the developer in Tuya Cloud, and the developer has operation rights for this type of device. For example: using Tuya OEM App or app pairing device based on Tuya app SDK, developers can manage such devices through API;

  • Product dimension:

The product belongs to the developer and the developer has a Tuya Cloud IoT account, and the developer has operation rights for this type of device. For example: create a product on Tuya IoT platform and purchase the corresponding module for generation. This type of device is connected to the Internet. You can query the specific device list based on the product id through the API, and perform data subscription monitoring or API control.

  • Authorization dimension:

The user grants the corresponding device resource permissions to the third-party developer, and the developer indirectly obtains the operation permissions of these devices. Such as: The third-party platform user has an account in the Tuya cloud system (such as an account registered in the Tuya public app). In this case, the user can authorize the device resources owned by Tuya to a third-party application platform. With relevant user rights, it can realize equipment control, management and other functions.

Integration solutions

Solution 1: OEM App & Simple mode

Architecture
image-20190804155412279

Features:

Based on the Tuya OEM App, the Tuya cloud can be integrated on demand, and instructions can be sent to the device through partner Cloud to the Tuya cloud ;

Both the device and the app are connected to the Tuya cloud, and all requests for devices and apps are sent to the Tuya cloud;

The generated user and device data are attributed to the partner. The customer can manage user data and device data based on the Tuya openapi, execute timing, scene, and obtain analysis data,etc.

Tuya offers you

Public OEM App or App Custom Development Solution;

Provides a standard instruction set based on categories to control different types of equipment under the same category in the Tuya platform;

Provides standard openapi management user & device data, provides message queue for partner to obtain real-time data of devices.

Advantages:

Low access cost and fast development time, can quickly support the access of multi-category devices under the Tuya platform;

Can fully utilize all the features of the Tuya platform;

Quickly bring products to market;

Data can be obtained from the Tuya platform for various analyses and complex scene development as needed.

Scenarios:

Partner won`t develop app;

Partner want to get their own user and device data, do their own internal control platform or get through with their internal system.

Solution 2: Full SDK & Simple mode

Architecture

image-20190804155917585

Features:

The app can connect directly to the partner own cloud;

App can use the partner`s own user system, and the user system can be directly stored in the partner’s platform. Before using the Tuya device service, only one virtual user can be mapped synchronously. The partner can not reveal the real user privacy data of the platform;

Based on the partner’s own development app, embed Tuya’s full sdk (For example:distribution network, panel control, scene control, etc.);

The link between the partner app and the Tuya cloud is implemented via the sdk package;

Require partner develop device panel/app UI or use Tuya public device UI;

Based on the SDK, device status can be fed back to the app in real time.

Tuya offers you:

Provide full-featured APP SDK;

Provide openapi to complete user integrate, device discovery, device control and other functions;

Provides a standard instruction set based on categories to control different types of equipment under the same category in the Tuya platform;

Provide message queue for partner to receive real-time data from devices.

Advantages:

Partner can develop their own app according to their own needs;

Customers can build their own user systems;

The app is based entirely on the full version of the Tuya SDK, which can take full advantage of the various capabilities provided by the Tuya SDK, such as: distribution network, device control, home management, scene management, upgrade management, etc., and reduce the difficulty of app development.

Scenarios:

Partner have their own app development team and need to use their own user system;

The app needs to connect to the customer’s own cloud platform and allows device-related services to connect to the Tuya cloud;

App can rely on Tuya full version SDK.

Solution 3: miniSDK & Simple mode

Architecture

image-20190804160242984

Features:

Based on the partner own app, embed in Tuya’s mini sdk (only includes the distribution network package: ssid, password and user token obtained from the cloud);

Require partner develop panels/apps by themselves;;

Device status changes can’t be pushed to the app directly, the pushing ability to rely on the partner’s own cloud.

Tuya offers you:

Provide the mini app SDK;

Provide openapi to complete user integration, device discovery, device control and other functions of the API;

Provide openapi to complete user integration, device discovery, device control and other functions;

Provides a standard instruction set based on categories to control different types of equipment under the same category in the Tuya platform;

Provide message queue for partner to receive real-time data from devices.

Advantages:

Customer self-developed APP, app low intrusive and all the request through partner cloud.

Disadvantages:

App development workload;

Device status changes cannot be pushed to the app in real time, requiring the customer to have notification capabilities;

The control link is too long, and the real-time control experience is not comparable to the schemes 1, 2.

Scenarios:

The app is developed by the client and requires its own user system and has strict requirements on the SDK size. Partner don’t want the app to connect directly to the Tuya;

The partner is not sensitive to the real-time status of the device, or the partner has its own message push channel to meet the real-time receiving capability of the device status.

Solution 4:miniSDK & Authorization mode

Architecture

image-20190804161338776

Features:

Partner have user system in the Tuya platform, and users can obtain data from users in the Tuya platform.

Tuya offers you:

Provide a mini APP SDK for discovery devices (optional);

Provide openapi to complete device discovery, device control and other functions;

Provides a standard instruction set based on categories to control different types of equipment under the same category in the Tuya platform;

Provide message queue for partner to receive real-time data from devices.

Provides mqtt message push based on the authorization to meet the real-time acceptance of device status requirements of partner app.