Skip to main content

xAAL support for Tuya protocol / Smart Life App

Project description

This package provides a gateway to control Tuya devices from xAAL network.

Tuya protocol is the common protocol used in cheap chinese outlets, smart plugs, and RGB lamps. It use the cloud base “Smart Life” mobile application (Android/IOS).

This protocol isn’t really reliable. If you can, avoid the use of Smart Life APP when this gateway is running. This should be ok, but attributes can be out of sync. The gateway polls devices state every 45 seconds but due to socket error, this can be a little longuer.

The complete guide to extract keys is there: https://github.com/codetheweb/tuyapi/blob/master/docs/SETUP.md

Notes : The main issue is that tuya devices close every connection after 10 seconds.

Supported devices

The gateway supports: PowerRelays (from 1 to x relais), SmartPlugs (same as relais but with a single power-meter), lamps and RGB lamps

Configuration samples

  • Dimmer Lamp / LSC Smart filament

[[device_id]]
 ip = 192.168.1.x
 key = xxxxxxxxxxxxxxxx
 type = lamp_dimmer
 white_temp = 1800, 2700  # for LSC
 addr = xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
  • RGB Lamp / LSC RGB1

[[device_id]]
 ip = 192.168.1.x
 key = xxxxxxxxxxxxxxxx
 type = lamp_rgb
 white_temp = 1800, 2700  # for LSC
 white_temp = 3000, 6500  # for Utorch LE7
 addr = xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
  • Alphawise dumb single outlet

[[device_id]]
  ip = 192.168.1.x
  key = xxxxxxxxxxxxxxxx
  type = powerrelay
  • SmartPlug (single outlet) / BW-SHP6

[[device_id]]
  ip = 192.168.1.x
  key = xxxxxxxxxxxxxxxx
  type = smartplug
  • SmartPlug (dual outlet) / BW-SHP7

[[device_id]]
  ip = 192.168.1.x
  key = xxxxxxxxxxxxxxxx
  type = smartplug
  dps = 1, 2               # <= 2 outlets
  pmeter_dps = 18, 19, 20  # <= dps for current / power / voltage

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

xaal_tuya-0.3.0.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

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

xaal_tuya-0.3.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file xaal_tuya-0.3.0.tar.gz.

File metadata

  • Download URL: xaal_tuya-0.3.0.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for xaal_tuya-0.3.0.tar.gz
Algorithm Hash digest
SHA256 e5cba079cc9a4fcb9443f72338e7e515a354541b771a4257446976d2b17385c4
MD5 d1b36db578d064f0529346ba8ed173a1
BLAKE2b-256 d7f70f40e5abee1e35b1cb36f36492ba6ae12d085ede8b3ef597b06e3f8d878a

See more details on using hashes here.

File details

Details for the file xaal_tuya-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: xaal_tuya-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for xaal_tuya-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f8656ed670155b2d1f22bb2592a0090fcc80362cc69bc257db3f473d1a806379
MD5 09d78b25e8a8f6e7a6fa2c7b3032e81e
BLAKE2b-256 7290be6120c9e28064c96fcd34706781d700057653169146c6c09f61136ef3f2

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