tuya /
tuya-home-assistant
Home Assistant integration for controlling Powered by Tuya (PBT) devices using Tuya Open API, maintained by the Home Assistant Community and Tuya Developer Team.
75/100 healthLoading repository data…
jasonacox / repository
Python API and command line tool for Tuya WiFi smart devices using a direct local area network (LAN) connection or the cloud (TuyaCloud API).
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
Python module to interface with Tuya WiFi smart devices
This python module controls and reads state of Tuya compatible WiFi Smart Devices (Plugs, Switches, Lights, Window Covers, etc.) using the local area network (LAN) or the cloud (TuyaCloud API). This is a compatible replacement for the pytuya PyPI module and currently supports Tuya Protocols 3.1, 3.2, 3.3, 3.4 and 3.5.
Tuya devices are designed to communicate with the TuyaCloud but most also expose a local area network API. This allows us to directly control the devices without using the cloud. This python module provides a way to poll status and issue commands to these devices.
TinyTuya can also connect to the Tuya Cloud to poll status and issue commands to Tuya devices.
# Example Usage of TinyTuya
import tinytuya
d = tinytuya.Device('DEVICE_ID_HERE', 'IP_ADDRESS_HERE', 'LOCAL_KEY_HERE', version=3.3) # Set version to match your device (3.1, 3.2, 3.3, 3.4, or 3.5)
data = d.status()
print('Device status: %r' % data)
NOTE: Devices need to be activated by Smart Life App.
# Install TinyTuya Library
python -m pip install tinytuya
# Optional: Install Command Line Tool
pipx install tinytuya
Pip will attempt to install cryptography, requests and colorama if not already installed.
On systems with limited space (such as an OpenWRT router), or if you would like to use a different cryptography library, you can install TinyTuya without automatic dependencies and manually install them yourself.
First, install a cryptography library. TinyTuya supports:
python -m pip install cryptographypython -m pip install pycryptodome or python -m pip install pycryptodomexpython -m pip install pyaespython -m pip install pycryptoOptional: install colorama for terminal color support: python -m pip install colorama
Required for Wizard or Cloud functionality, Optional otherwise: install requests for Cloud functions to work: python -m pip install requests
Finally, install TinyTuya without dependencies: python -m pip install --no-deps tinytuya
Controlling and monitoring Tuya devices on your network requires the following:
TinyTuya has a built in network scanner that can be used to find Tuya Devices on your local network. It will show Address, Device ID and Version for each device. Your LAN and firewall will need to allow UDP (6666, 6667 and 7000) and TCP (6668) traffic.
python -m tinytuya scan
TinyTuya has a built-in setup Wizard that uses the Tuya IoT Cloud Platform to generate a JSON list (devices.json) of all your registered devices, including secret Local_Key and Name of your devices. Follow the steps below:
PAIR - Download the Smart Life App or Tuya Smart App, available for iPhone or Android. Set up your SmartLife account and pair all of your Tuya devices (this is important as you cannot access a device that has not been paired). Do not use a 'guest' account, otherwise it will get deleted without confirmation at step 3.
SCAN (Optional) - Run the TinyTuya scan to get a list of Tuya devices on your network. It will show device Address, Device ID and Version number (3.x):
python -m tinytuya scan
NOTE: You will need to use one of the displayed Device IDs for step 4.
TUYA ACCOUNT - Set up a Tuya Account (see PDF Instructions):
Notes:
npm i @tuyapi/cli -g and run tuya-cli wizardAfter importing tinytuya, you create a device handle for the device you want to read or control. Here is an example for a Tuya smart switch or plug:
import tinytuya
# Connect to Device
d = tinytuya.OutletDevice(
dev_id='DEVICE_ID_HERE',
address='IP_ADDRESS_HERE', # Or set to 'Auto' to auto-discover IP address
local_key='LOCAL_KEY_HERE',
version=3.3) # Set to your device's actual version (3.1, 3.2, 3.3, 3.4, or 3.5)
# Get Status
data = d.status()
print('set_status() result %r' % data)
# Turn On
d.turn_on()
# Turn Off
d.turn_off()
Classes
AESCipher - Cryptography Helpers
XenonDevice(args...) - Base Class
Device(args...) - Tuya Class for Devices
OutletDevice(args...)
CoverDevice(args...)
BulbDevice(ar
Selected from shared topics, language and repository description—not editorial ratings.
tuya /
Home Assistant integration for controlling Powered by Tuya (PBT) devices using Tuya Open API, maintained by the Home Assistant Community and Tuya Developer Team.
75/100 healthmeshtastic /
The Python CLI and API for talking to Meshtastic devices
75/100 healthmihai-dinculescu /
[..] in the upper right hand corner of the app. When you scan the QR code, it will link all of the devices registered in your Smart Life app into your Tuya IoT project. If the QR code will not scan then make sure to disable any browser theming plug-ins (such as Dark Reader) and try again.IoT Core and Authorization. To be sure, click subscribe again on every service. Very important: disable popup blockers otherwise subscribing won't work without providing any indication of a failure. Make sure you authorize your Project to use those APIs:
Subscribe (screenshot)IoT Core service expires after some time. By default, when you subscribe to it for the first time, it will last for one month. Once expired, the setup wizard won't be able to communicate with the Tuya account anymore, so it needs to be renewed. As of November 12th 2024, it can be renewed for a duration of 1, 3 or 6 months by simply filling in a form with some basic information (e.g. purpose of the project, type of developer).WIZARD - Run Setup Wizard:
python -m tinytuya wizard # use -nocolor for non-ANSI-color terminals
Overview
scan), use one from step 2 above or in the Device List on your Tuya IoT project.devices.json that TinyTuya will use to provide additional details for scan results from tinytuya.deviceScan() or when running python -m tinytuya scan. The wizard also creates a local file tuya-raw.json that contains the entire payload from Tuya Cloud.snapshot.json file with these results. Make sure your LAN and firewall permit UDP (6666, 6667 and 7000) and TCP (6668) traffic.🦀 Rust API, 🐍 Python API, and 🤖 MCP Server for TP-Link Tapo smart devices
0u44 /
Kitty-Tools is a Kahoot Cheating Client for all devices and interfaces that is EASY TO USE (Usable on; Windows, Linux, Web, Micro Controllers, Android, IOS) (TUI) (GUI) (kahoot cheats) (kahoot hacking) (kahoot API) (Easy To Use)
89/100 healthgoogle-coral /
Python API for ML inferencing and transfer-learning on Coral devices
32/100 healthPaloAltoNetworks /
The PAN-OS SDK for Python is a package to help interact with Palo Alto Networks devices (including physical and virtualized Next-generation Firewalls and Panorama). The pan-os-python SDK is object oriented and mimics the traditional interaction with the device via the GUI or CLI/API.
76/100 health