Skip to main content

A Python sdk for Tuya Open API, which provides IoT capabilities, maintained by Tuya official

Project description

[WIP] tuya-iot-py-sdk

A Python sdk for Tuya Open API, which provides basic IoT capabilities like device management, asset management and industry capabilities, helping you create IoT solutions. With diversified devices and industries, Tuya Cloud Development Platform opens basic IoT capabilities like device management, AI scenarios, and data analytics services, as well as industry capabilities, helping you create IoT solutions.

Features

  • OpenAPI
    • Get the device list
    • Get the device details
    • Get device status
    • Control devices
    • Modify the device name
    • Query the device log
    • Remove devices
    • ...
  • Open IoT Hub (Not released yet)
    • Get device status change

Possible scenarios

  • HomeAssistant Tuya Plugin
  • ...

Before use

Part 1. Tuya IoT Platform

  1. Register a Tuya Developer account in Tuya IoT Platform.
  2. Go to Tuya IoT Platform > Cloud > Projects, and Click Create. Select Industry Solutions in the Project Type field, and select Smart Home in the Industry field.
  3. Go to Projects > My Project, and click the created project to view details. Click Applications > Cloud to get your AccessID and AccessSecret.
  4. Click Users > Add User to create a user.
  5. Click Assets > New Asset to create an asset.
  6. To manage your asset, click Manage in the Action column. Click Authorized Users > Add Authorization, and add the user created in Step 4.
  7. Go to Projects > API Products > All Products, click Industry Project, and subscribe to your desired API products.
  8. Go to Projects > API Products > Subscribed Products. Click one of your subscribed products, and click Project > New Authorization to authorize your project to use this API.
  9. Add the AccessID, AccessSecret, username, password, and asset ID in your code.

Part 2. Device configuration

  1. Open the IoT Config app (not available for WeChat Mini Programs, iOS apps, and Android apps).
  2. Log in to Tuya IoT Platform.
  3. Choose the asset created in Part 1.
  4. Configure your device into the asset.

Usage

Installation

pip3 install tuya-iot-py-sdk

Sample code

OpenAPI Sample

Open IoT Hub Sample

Tuya Open API reference

Tuya opens up a variety of APIs covering business scenarios such as device pairing, smart home management, device control, and scene automation. You can call APIs according to API integration documents to implement applications.

For more information, see the documentation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tuya-iot-py-sdk-0.1.2.tar.gz (13.5 kB view hashes)

Uploaded Source

Built Distribution

tuya_iot_py_sdk-0.1.2-py3-none-any.whl (14.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page