Saltar al contenido principal

Integración domótica LG ThinQ, gratuita y de código abierto

Integración LG ThinQ para Gladys Assistant

Discover and control the LG appliances of your ThinQ account, through the official LG API.

info

La documentación de esta integración la escribe su autor y, por ahora, solo está disponible en inglés.

This integration connects Gladys Assistant to the appliances registered on your LG account — air conditioner, washing machine, dryer, dishwasher, fridge, oven, air purifier, robot vacuum… — using LG's official ThinQ Connect API.

It is a cloud integration: Gladys talks to LG's servers, and LG talks to your appliances. Nothing is reverse-engineered, and no password is stored: the only credential is a token you create yourself and can revoke at any time.

Before you start​

You need:

  • Gladys 5.1 or newer;
  • an LG ThinQ account with your appliances already added in the LG ThinQ mobile app (this integration discovers appliances, it does not pair them);
  • appliances that are online in the app;
  • the country your LG account was created in — LG hosts accounts on regional servers, and the wrong region simply answers "unknown user".

Step 1 — Create a Personal Access Token​

  1. Open https://connect-pat.lgthinq.com and log in with the same LG account you use in the ThinQ app.
  2. Click Create New Token.
  3. Give the token a name (for example Gladys).
  4. Tick the scopes matching the appliances you want to use in Gladys. A missing scope makes the appliance invisible to the integration, so if in doubt, tick everything.
  5. Click Create Token and copy the token — LG shows it once.

LG's own documentation for this screen: https://thinq.developer.lge.com/en/cloud/docs/thinq-connect/PAT-en/

Step 2 — Configure the integration in Gladys​

  1. Open the LG ThinQ integration in Gladys, Configuration tab.
  2. Paste the token in Personal Access Token.
  3. Pick the country of the LG account.
  4. Save.
  5. Click Test the connection: Gladys answers with the region it reached and the list of appliances it found. If that works, your appliances appear in the Devices tab within a few seconds.

The two other settings are optional:

  • Refresh interval — how often each appliance is read (default 5 minutes, one minute at the fastest). LG meters API calls per client and each appliance costs one call per refresh, so lower it only if you own few appliances.
  • Temperature unit — LG publishes every temperature twice, in Celsius and in Fahrenheit. Only the unit you pick becomes a Gladys feature.
  • Expose every numeric property — off by default. Turn it on to also get the scheduling offsets and counters LG exposes; useful to explore what a specific appliance reports.

What you get​

The integration reads each appliance's profile — LG's description of what that exact model can report and accept — and builds the Gladys features from it. So what you see depends on your hardware, not on a hard-coded list:

What LG exposesWhat you get in Gladys
Power on/off, and other on/off optionsA switch you can control, and use in scenes
Target temperatureA setpoint, with the bounds of your model
Current temperature, humidity, PM2.5, PM10, CO2Sensors, with history and charts
Filter life, batterySensors, in percent
Remaining time of a cycleA duration, in hours and minutes
Door open/closedAn opening sensor
Job mode, run state, programme nameA text feature, usable as a scene trigger

An appliance is read as soon as you add it, so its features carry a value right away; everything is then refreshed on the interval you configured. Gladys shows a badge on each appliance: cloud when LG answers, unreachable (orange) when the appliance is unplugged or off the network.

Controlling something Gladys has no feature for​

LG's modes are model-specific: your air conditioner may accept COOL, HEAT, AIR_DRY, while another one accepts ENERGY_SAVING too. Gladys features cover what is universal (power, temperature, sensors); everything else is reachable through two buttons in the Configuration tab:

  1. List the properties — pick an appliance, and Gladys prints every property it accepts with the exact values allowed, for example:

    airConJobMode.currentJobMode = COOL | HEAT | AIR_DRY
    temperatureInUnits.targetTemperatureC = 18..30, step 1
    airFlow.windStrength = LOW | MID | HIGH
  2. Send a command — pick the appliance, paste the property name and the value. The command is checked against the profile before being sent, so a typo is refused with the list of allowed values instead of a silent failure.

Dashboard widgets​

In a dashboard, Edit → add a box → integrations category:

  • LG appliance — one appliance, picked in the box settings: its live values (temperatures, humidity, time left…), what it is doing (state, mode), its connection to the LG cloud, and the On / Off and Refresh buttons;
  • LG appliances — every LG appliance on one card, each with its state ("Running", "End", "Unreachable"…) and a Refresh button.

Values follow the refresh interval; Refresh asks LG right away. Only the appliances added to Gladys are shown.

Scenes​

Triggers​

In the scene editor, Integrations category:

TriggerWhen
LG appliance: cycle finishedA washer, dryer, dishwasher or oven finishes its cycle
LG appliance: state changedThe run state changes (RUNNING, RINSING, END…)
LG appliance: connection lost / backThe appliance leaves or comes back to the LG cloud

A filter left empty means "any". The New state filter expects the exact LG value, in capitals (END, RUNNING…): List the properties shows the values of each appliance.

The next actions of the scene can reuse the appliance name, the sub-appliance (washer or dryer of a WashTower), the new and the previous state. Example: "Cycle finished" → send a message "{{triggerEvent.data.device_name}} is done".

Good to know:

  • changes are seen at the next read of the appliance: a cycle that ends is reported at most one refresh interval later;
  • nothing fires when the integration starts: a change needs a "before" and an "after";
  • a read caused by an action (button, scene, command) fires nothing right away — the next regular read does. This keeps a scene from re-triggering itself in a loop.

Actions​

ActionWhat it does
LG appliance: send a commandLike the Send a command button: any property, checked before being sent
LG appliance: read the stateReads the appliance now and hands the next actions: connected (yes/no), run state, time left (min)

Example: every evening at 10 pm, "Read the state" of the washer → condition "run state = END" → notification "Empty the washer".

Troubleshooting​

"LG refused the credentials" — the token or the country is wrong. Tokens are bound to the account that created them: check you used the same LG account as in the ThinQ app, and pick the country the account was created in.

An appliance is missing — either its scope was not ticked when the token was created (create a new token with the right scopes), or it was added to the LG app after Gladys last looked. Click Refresh the appliance list.

An appliance shows an orange unreachable badge — LG reports it as not connected. Check it is powered and connected to Wi-Fi in the LG ThinQ app; the badge clears itself on the next refresh.

An appliance I just added shows "no recent value" — the appliance is read the moment you add it, so this means LG had nothing to report at that instant: the appliance is usually off the network (check for the orange badge). The next refresh fills the features as soon as LG answers again.

The LG appliance widget shows "settings.device: must be at most 100 characters" — the appliance was added with version 2.0.0 or older, whose identifier was too long for a widget. After the update, delete the appliance in Gladys, add it again from the Discovery tab, then pick it again in the widget settings. The history of the old device and the scenes using it must be redone.

"Call quota exceeded" — increase the refresh interval. LG counts the calls of each client, and one refresh costs one call per appliance.

A command is refused — LG rejects commands an appliance cannot honor in its current state (starting a washing machine whose door is open, changing the mode while it is off). The reason is shown under the button and in the integration logs.

Privacy​

The Personal Access Token is stored encrypted by Gladys and is never sent back to your browser. It can be revoked at any time from https://connect-pat.lgthinq.com, which instantly cuts this integration's access without touching your LG account.

Parámetros de configuración​

Estos son los parámetros que LG ThinQ te pide en su pantalla de configuración en Gladys.

ParámetroTipoObligatorioDescripción
Connect your LG accountsectionNoThis integration uses the official LG ThinQ Connect API. Log in on the LG page below with the LG account your appliances are registered on, create a Personal Access Token, tick the scopes of the appliances you want to use, then paste the token here.
Personal Access TokensecretSíThe token created on the LG page above. It is stored encrypted and never sent back to the browser.
Country of the LG accountselectSíLG hosts accounts on regional servers: pick the country your LG account was created in, not the one you live in today.
BehavioursectionNoLG meters the number of API calls per client. Each appliance costs one call per refresh, so keep the interval comfortable if you own many appliances.
Refresh interval (s)numberNoHow often each appliance is read, in seconds.
Temperature unitselectNoLG publishes each temperature twice, in Celsius and in Fahrenheit. Only the chosen unit becomes a Gladys feature.
Expose every numeric propertybooleanNoAlso create features for the numeric properties with no obvious meaning (scheduling offsets, counters). Useful to explore what an appliance reports.

Cómo instalar LG ThinQ en Gladys​

  1. En Gladys, abre Integraciones: LG ThinQ aparece en el catálogo junto a las integraciones nativas, con una insignia de comunidad.
  2. Haz clic en Instalar. Gladys descarga la imagen Docker (ghcr.io/prohand/gladys-lg-thinq:2.2.0), la ejecuta en un entorno aislado del núcleo y genera la interfaz de la integración (dispositivos, descubrimiento y configuración).
  3. Abre la pantalla de Configuración de la integración, rellena los parámetros y guarda.
  4. También puedes instalarla directamente desde la URL de su repositorio: https://github.com/prohand/gladys-lg-thinq.

LG ThinQ requiere Gladys >=5.1.0. El catálogo de Gladys se actualiza cada hora, así que una nueva versión está disponible como máximo una hora después de publicarse.

¿Todavía no usas Gladys? Es gratuito y de código abierto: sigue la guía de instalación para empezar.

Sobre las integraciones externas​

LG ThinQ es una integración externa: una integración comunitaria empaquetada como contenedor Docker y publicada en GitHub. Gladys la instala con un clic y la ejecuta en un entorno aislado del núcleo. La publica y mantiene prohand, no el equipo principal de Gladys.

Suscríbete a la newsletter de Gladys Assistant

Unos pocos correos al mes sobre nuevas versiones y novedades del proyecto. Enviados por Pierre-Gilles Leymarie, fundador del proyecto. Puedes darte de baja cuando quieras 🙂