Interface to Tuya devices over LAN.
Project description
local-tuya
Interface to Tuya devices over LAN.
Features
- asynchronous methods and transport
- persistent and robust communication to the device
- automatic remote device state updates (remotes can still be used)
- configurable buffering for subsequent updates
- constraints between device commands
- Domoticz plugin using a dedicated thread
💡 For now, only v3.3 is supported as I only own devices using this version.
Examples
Requirements
To control a device you will need these 3 things:
- the device ID
- the device local IP address
- the device local key (encryption key generated upon pairing)
⚠️ This library does not provide support for getting these. See how to do that using any of those projects:
Generous thanks to the maintainers of those tools for details on interfacing with Tuya devices.
⚠️ Keep in mind that:
- After pairing the devices, it's recommended to assign static IPs in your router.
- If you reset or re-pair devices the local key will change.
- You can delete your tuya IOT account but not the SmartLife one and devices should be kept there.
- For state updates to be received properly, the device needs to be able to access the Tuya backend.
Architecture
This library is composed of two main components:
- the Tuya protocol
- the device
Protocol
The protocol is responsible for handling communication details with the Tuya device. Its interface consists of an asynchronous method to update the device and accepts a callback to subscribe to state changes.
See protocol module.
Device
The device handles higher level functional logic such as buffering, constraints and specific device commands.
See device module.
Domoticz plugin tools
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file local_tuya-3.0.0.tar.gz
.
File metadata
- Download URL: local_tuya-3.0.0.tar.gz
- Upload date:
- Size: 16.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.3 Linux/6.5.0-1018-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2d7a16c2ca376571d4fe51f5793655958ce74780013a55b2e36c60adebe873f |
|
MD5 | 29b2f029966da1b38dd9ea0a9d13ccce |
|
BLAKE2b-256 | e0a204204b5acf5906df12ffafbd49d0f7434e5aa0b584d3b49bd3e8fbb3cce0 |
File details
Details for the file local_tuya-3.0.0-py3-none-any.whl
.
File metadata
- Download URL: local_tuya-3.0.0-py3-none-any.whl
- Upload date:
- Size: 24.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.3 Linux/6.5.0-1018-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ffe23f2f8061af5b0fe467e8b91af09ce389eb3cdebf779a3ae4c5bcb9f0740a |
|
MD5 | 5cc841c06b1d4655506a0c62bda99ed9 |
|
BLAKE2b-256 | 34bc30f42aa415e5c2c43513537cb8c4fde52366e31714366e16ff9fa2b93549 |