Skip to main content

Interactive wizard for Tuya Library

Project description

Tuya Wizard

tuyawizard is a powerful and interactive CLI tool and Python library designed to help you discover and manage devices registered on the Tuya Cloud. It simplifies the authentication process using QR code login via the Smart Life or Tuya Smart app.


🔧 Features

  • Easy Authentication: Support for QR code login using the Smart Life or Tuya Smart mobile apps.
  • Automatic Token Management: Automatically handles and refreshes cloud tokens.
  • Device Discovery: Fetches a comprehensive list of all registered devices and their details.
  • Flexible Usage: Use it as a standalone CLI tool or integrate it into your own Python projects.
  • Refactored & Typed: Modern Python implementation with type hints and improved error handling.

📦 Installation

Install the package via pip:

pip install tuyawizard

▶️ Quick Start (CLI)

You can run the wizard directly from your terminal:

python -m tuyawizard

Command-line Options

Option Default Description
-device-file FILE tuyadevices.json Path to save the discovered devices list (JSON).
-credentials-file FILE tuyacreds.json Path to load/save cloud authentication credentials (JSON).
--postprocess false Run postprocess after fetching devices.
--postprocess-only false Run postprocess only (skip wizard login/fetch).
--postprocess-mode all Select postprocess mode: parent, scan, all.

Postprocess Examples

Run wizard and then postprocess:

python -m tuyawizard --postprocess

Run postprocess only:

python -m tuyawizard --postprocess-only

Run parent-only postprocess:

python -m tuyawizard --postprocess-only --postprocess-mode parent

Run scan-only postprocess:

python -m tuyawizard --postprocess-only --postprocess-mode scan

� How to get User Code

  1. Open the Smart Life or Tuya Smart app.
  2. Go to Me (Profile) tab.
  3. Tap on the Settings icon in the top right corner.
  4. Go to Account and Security.
  5. You will find your User Code (or Account ID) there.

💾 Output Files

  • tuyacreds.json: Contains sensitive authentication tokens and endpoint information. Keep this file secure.
  • tuyadevices.json: A structured JSON list of all your Tuya devices and their properties.

❗ Notes

  • Client Credentials: This tool currently uses temporary Home Assistant client credentials. These are intended to be replaced when official 3rd-party developer credentials become more widely available.
  • Python Version: Requires Python 3.8 or higher.

📄 License

This project is licensed under the MIT License.

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

tuyawizard-0.1.5.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tuyawizard-0.1.5-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file tuyawizard-0.1.5.tar.gz.

File metadata

  • Download URL: tuyawizard-0.1.5.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for tuyawizard-0.1.5.tar.gz
Algorithm Hash digest
SHA256 bf90b3eb8777b1c327303bb325bf3a2be72258fb437bd7ab75a41531b6e32045
MD5 18bf1af7fc0aeaf30173b8c3ac613d04
BLAKE2b-256 ef8632adb5683476e299eaf8769c70ba2ee881d8f6b1cd4eaa0efe114f0f1186

See more details on using hashes here.

File details

Details for the file tuyawizard-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: tuyawizard-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for tuyawizard-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 56ef4c8168a7fa9c9e61dcdf47a60380e5ec9efd341d506a84e95a07601902b4
MD5 a174e7b4c6b7a8098a6b4769aa40d9d1
BLAKE2b-256 79e62f5655ed6329dec93c999f38b496cbf5269fc30721a0d4242fee96869baf

See more details on using hashes here.

Supported by

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