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.2.tar.gz (11.1 kB view hashes)

Uploaded Source

Built Distribution

xaal.tuya-0.2-py3-none-any.whl (9.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page