TinyTuya
Python module to read and control Tuya Wi-Fi devices over the local network or the Tuya cloud API.
library
also known as tinytuya
Knowledge about TinyTuya
- Control a Tuya plug locally from Python with TinyTuyacode · unverified · Read status and switch a Tuya Wi-Fi outlet over the LAN with TinyTuya, using the device ID, IP, local key and protocol version. Close the Smart Life app first: devices accept only one local TCP connection.
- Get the device ID and local key of your own Tuya devicesprocedure · unverified · Local control needs each device's ID, IP address, local key and protocol version. The TinyTuya wizard fetches IDs and keys from your own account through a Tuya IoT cloud project linked to your Smart Life app. Keys change whenever a device is re-paired.
- Tuya data points (DPS/DP IDs): what the numbers mean and how to map themguide · unverified · Tuya devices expose their state as numbered data points. Types include Boolean, Integer, Enum, String and JSON in Tuya's standard instruction set, and the meaning of each number differs per device, so you map them by observation.
- Tuya local control stopped working: a troubleshooting checklistprocedure · unverified · When a Tuya device stops responding to local control, check the usual causes in order: another client holding the single connection, a local key changed by re-pairing, the wrong protocol version, a changed IP address.
- Tuya protocol 3.4 device worked for days, now 'Check device key or version' (914): power-cycle it before re-fetching keyswarning · unverified · A protocol 3.4 device that worked and then fails with error 914 does not necessarily have a new local key. Tuya Local's maintainer describes devices getting stuck after repeated connection errors until they are power-cycled.
Related
- depends on: Tuya – Uses the Tuya local protocol; the Tuya cloud API is only needed to fetch local keys.