Skip to main content

Interface to Tuya devices over LAN.

Project description

local-tuya

tests version python

Interface to Tuya devices over LAN.

Features

  • asynchronous methods and transport
  • persistent 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

See Domoticz tools package.

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

local_tuya-2.0.0.tar.gz (15.1 kB view details)

Uploaded Source

Built Distribution

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

local_tuya-2.0.0-py3-none-any.whl (23.1 kB view details)

Uploaded Python 3

File details

Details for the file local_tuya-2.0.0.tar.gz.

File metadata

  • Download URL: local_tuya-2.0.0.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.0 CPython/3.11.2 Linux/5.15.0-1033-azure

File hashes

Hashes for local_tuya-2.0.0.tar.gz
Algorithm Hash digest
SHA256 c09d8f3fc4e30ff9e532597f006b2f766b0b4bccba062c6e77a03a3ead90a9dd
MD5 3d2cba611cd195fdbad8e00c52eb7289
BLAKE2b-256 ea5a388677c1ea1e46e5e48ab7e4026aa8a9c295cadff12bd26a8b0b9793aca4

See more details on using hashes here.

File details

Details for the file local_tuya-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: local_tuya-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 23.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.0 CPython/3.11.2 Linux/5.15.0-1033-azure

File hashes

Hashes for local_tuya-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 479db01001eeb3fbf6a360902d60096ac0e9e5fe31a00d4e20b47009ff582c49
MD5 6e325c999ac920628ef0c99cabfed7a6
BLAKE2b-256 ba049416ea476c287aa0e859b9aedf7b57aba9eba25640c7a3e1144c93e06a65

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