Zum Hauptinhalt springen

Tuya Smart-Home-Integration, kostenlos und Open Source

Tuya-Integration für Gladys Assistant

Tuya / Smart Life sockets, meters, ACs, heaters, cameras, doorbells, feeders, vacuums (cloud + LAN).

Info

Die Dokumentation dieser Integration wird von ihrem Autor geschrieben und ist bisher nur auf Englisch verfügbar.

Control your Tuya / Smart Life devices from Gladys, over the cloud and, when possible, directly over your local network (LAN) for a faster, internet-independent experience.

Supported devices​

  • Smart plugs and sockets (including the LSC Power Plug FR with energy metering): on/off, child lock, power, voltage, current, energy.
  • Energy meters (including 3-phase): power, voltage, current, imported/exported energy.
  • Air conditioners: on/off, mode (auto / cool / heat / dry / fan), target temperature, ambient temperature, fan speed and both swing axes.
  • Pilot-wire (fil pilote) thermostats (RP5 family, Konyks eCosy): heating mode, target temperature, ambient temperature, child lock, energy.
  • Cameras (including LSC): privacy mode, motion detection, siren, motion tracking, human filter, recording, image flip, and a motion sensor usable in your scenes.
  • Video doorbells: ring (a dedicated doorbell feature), snapshot of the visitor, motion detection, recording, status LED.
  • Pet feeders: feed on demand, last amount fed, slow feed, light, battery (percentage or raw voltage plus the low-battery flag, depending on the model), scheduled meals.
  • Fans and ventilation units (category fs, e.g. the AV-TTW5-W heat-recovery unit): on/off, speed (the device's own levels, e.g. 1 to 3), light, child lock, airflow direction, horizontal/vertical swing, ambient temperature when the device measures one.
  • Dehumidifiers (category cs, e.g. Qlima D825A): on/off, current humidity, temperature, fan speed, timer and time left, mode, target humidity (when offered as steps), child lock. Speeds, timer durations and modes list exactly the values your model declares.
  • Robot vacuums (Honiture Q6 Pro): start/stop, pause, dock, cleaning state, battery, suction power, water level, carpet boost, custom (room) mode, Y-mop wash, dust-collection frequency, main/side brush remaining life. Note: on this product, turning Pause OFF while the robot is fully stopped also starts a new cleaning cycle — it is not purely a pause toggle.
  • Switches, lights and covers through the generic mappings.

Cameras and doorbells expose their snapshots, not a live video stream: Tuya publishes no stable local RTSP/ONVIF endpoint.

The doorbell ring and the air-conditioner fan speed / swings need Gladys 4.84.2 or later. The vacuum's suction power / water level / dust-collection frequency need Gladys 4.86.1 or later. On an older Gladys the integration keeps working, without those features.

New installs from the store require Gladys 4.86.1 or later; an integration already installed keeps updating on any Gladys version.

Every device shows a Local or Cloud badge so you always know how it communicates.


1. Create a Tuya IoT Cloud project​

The integration needs a (free) Tuya IoT Cloud project to reach your devices.

  1. Go to the Tuya IoT Platform and sign in (create an account if needed).
  2. Open Cloud → Development and click Create Cloud Project.
    • Give it any name.
    • Industry / Development method: keep the defaults (Smart Home).
    • Data Center: pick the region closest to you (e.g. Central Europe for France). Remember this choice — you will select the same region in Gladys.
  3. Once created, open the project. On the Overview tab, note the Access ID / Client ID and the Access Secret / Client Secret.
  4. Open the Service API tab and make sure IoT Core is authorized (subscribe to it if not — it is free).

⚠️ The IoT Core trial expires. Tuya grants this service as a free trial (one month, then renewable for six more months at no cost). Once it lapses, Tuya rejects every API call of your project and all your devices go offline in Gladys, with the message "IoT Core service subscription has expired".

To renew it: Cloud → Development → your project → Service API (or Cloud → Cloud Services → IoT Core), then Extend Trial Period. It is free and takes effect immediately. Set yourself a reminder — it has to be renewed every six months.

Your devices must belong to a Tuya app account that the project can see.

  1. In the project, open Devices → Link Tuya App Account → Add App Account.
  2. Scan the QR code with your Smart Life or Tuya Smart phone app (Me → top-right scan icon).
  3. Back on the platform, open Devices → Link Tuya App Account: your devices now appear.
  4. Note your App account UID (shown next to the linked account).

3. Fill in the configuration in Gladys​

In the integration configuration screen, fill in:

FieldWhere to find it
EndpointThe Data Center region you chose in step 1
Client IDProject Overview → Access ID / Client ID
Client SecretProject Overview → Access Secret / Client Secret
App account UIDDevices → Link Tuya App Account → the linked account UID

Save. The Connection status at the bottom of the screen should turn to Connected. If it shows an error, the message tells you what to fix (wrong credentials, wrong region…).

4. Discover your devices​

Open the Discover tab and let Gladys list your Tuya devices, then create the ones you want. Each device appears with its features and a Local/Cloud badge.


Local mode (LAN)​

Local control is faster and keeps working without internet. It is enabled by the "Prefer the local connection" toggle (on by default).

  • When on, Gladys tries to reach each device on your network; if it can, the device shows a Local badge and its state updates instantly. If it cannot, the device automatically falls back to the Cloud.
  • Local control needs Gladys to know each device's IP address and protocol. Most devices are found automatically by the network scan during discovery.
  • A device that could run locally (its IP is known and the preference is on) but is currently running over the cloud keeps a Cloud badge with an orange dot — hover it to see why (device parked after failures, LAN info incomplete…). A genuine cloud-only device stays a plain blue Cloud badge.

A device stays on Cloud even though it is on your LAN​

Some devices are not found by the automatic scan (different subnet, asleep during the scan…). You can add them by hand:

  1. Open the Configuration screen → Detect local protocol (manual IP) action.
  2. Enter the device (its Gladys name or its Tuya ID) and its IP address.
  3. Run it. On success, the device switches to local on the next cycle.

Tip: give your Tuya devices a fixed IP (DHCP reservation) on your router so they stay reachable.


Real-time cloud events (Pulsar) — optional​

For devices used over the cloud, Gladys can receive their state changes instantly (in ~1–2 s) instead of waiting for the next poll. This uses the Tuya Message Service (a.k.a. Pulsar). Devices already controlled locally already get instant feedback and do not need this.

Two steps to enable it:

  1. On the Tuya IoT Platform: open your project → Service API → subscribe to Message Service (free). Without it, the connection is refused and Gladys logs an explicit message.
  2. In Gladys: turn on the "Real-time cloud events (Pulsar)" toggle in the configuration, then save.

A device only reports through Pulsar what it actually sends to the Tuya cloud: some report their full state, some only a part (e.g. on/off), some nothing — those simply keep the regular cloud refresh. This is a device/firmware behaviour, not a limitation of Gladys.


Reporting an unsupported device​

A device created with no feature (or a single one) exposes Tuya codes the integration does not know yet — common across variants of the same model.

In the integration configuration, run the Device diagnostic action, type the device name as shown in Gladys, and copy the result into a GitHub issue. The report lists every code the device reports, its value and what the integration does with it. It carries no local key, IP address nor Tuya device id: it can be pasted publicly as-is.

Useful actions​

  • Detect local protocol (manual IP): enable local mode for a device the scan did not find (see above).
  • Device diagnostic: builds the report of what a device exposes (see above).
  • Disconnect from the Tuya cloud: stops talking to the cloud until you save the configuration again.

Troubleshooting​

  • Connection shows an error → check the four credentials and that the Endpoint matches your project's Data Center.
  • A device has no state / no control → check its badge. On Cloud with nothing coming back, the device may be offline in the Tuya app.
  • Real-time cloud events do not start → make sure Message Service is subscribed on your Tuya project (a 401 in the logs means it is not).
  • Logs are available in the integration's Logs tab.

Konfigurationseinstellungen​

Diese Einstellungen fragt Tuya in seinem Konfigurationsbildschirm in Gladys ab.

EinstellungTypPflichtfeldBeschreibung
Getting startedsectionNeinThis integration talks to your devices through a Tuya IoT Cloud project. Create one (free) on the Tuya IoT Platform, subscribe the "IoT Core" service, link your Smart Life / Tuya app account, then copy the four values below. The full step-by-step is in the Documentation link above.
EndpointselectJaTuya data center region of your cloud project.
Client IDstringJaAccess ID / Client ID of your Tuya IoT cloud project.
Client SecretsecretJaAccess Secret / Client Secret of your Tuya IoT cloud project.
App account UIDstringJaUID of the Smart Life / Tuya app account linked to your cloud project.
Real-time cloud events (optional)sectionNeinFor devices used over the cloud, Gladys can receive their state changes instantly instead of waiting for the next poll. This needs the "Message Service" subscribed on your Tuya IoT project, then the toggle below turned on. Devices already controlled locally already get instant feedback and do not need this.
Real-time cloud events (Pulsar)booleanNeinInstant cloud state feedback via the Tuya Message Service. Requires 'Message Service' enabled on your Tuya IoT project.

So installierst du Tuya in Gladys​

  1. Öffne in Gladys Integrationen: Tuya erscheint im Katalog neben den nativen Integrationen, mit einem Community-Badge.
  2. Klicke auf Installieren. Gladys lädt das Docker-Image (ghcr.io/terdious/gladys-tuya:1.17.0) herunter, startet es in einer vom Kern isolierten Sandbox und erzeugt die Oberfläche der Integration (Geräte, Erkennung und Konfiguration).
  3. Öffne den Bildschirm Konfiguration der Integration, fülle die Einstellungen aus und speichere.
  4. Du kannst sie auch direkt über die URL ihres Repositorys installieren: https://github.com/Terdious/gladys-tuya.

Tuya benötigt Gladys >=4.86.1. Der Katalog in Gladys wird stündlich aktualisiert, eine neue Version ist also spätestens eine Stunde nach ihrer Veröffentlichung verfügbar.

Du nutzt Gladys noch nicht? Es ist kostenlos und Open Source: folge der Installationsanleitung, um loszulegen.

Passende Ratgeber​

Über externe Integrationen​

Tuya ist eine externe Integration: eine Community-Integration, die als Docker-Container verpackt und auf GitHub veröffentlicht wird. Gladys installiert sie mit einem Klick und führt sie in einer vom Kern isolierten Sandbox aus. Sie wird von Terdious veröffentlicht und gepflegt, nicht vom Gladys-Kernteam.

Abonniere den Newsletter von Gladys Assistant

Ein paar E-Mails im Monat zu neuen Releases und Neuigkeiten aus dem Projekt. Verschickt von Pierre-Gilles Leymarie, dem Gründer des Projekts. Jederzeit abbestellbar 🙂