Integración domótica TP-Link Kasa, gratuita y de código abierto

Control your TP-Link Kasa smart plugs, switches and bulbs over your local network.
La documentación de esta integración la escribe su autor y, por ahora, solo está disponible en inglés.
Control your TP-Link Kasa smart plugs, switches and bulbs from Gladys, over your local network. The integration runs in its own container and talks to your devices using the classic Kasa LAN protocol.
Supported devices
| Device | Feature |
|---|---|
| Plugs and switches | On/Off (switch) |
| Bulbs | On/Off (light) |
Other TP-Link types are detected during a scan and reported in the logs, but they are not published because they have no controllable feature yet.
Multi-outlet strips are not supported. Kasa power strips (HS300, HS107, KP303, KP400) are detected and deliberately skipped: their outlets are controlled individually, which this integration cannot do yet. Publishing them would offer a single switch that turns the whole strip off at once.
Local-only, legacy protocol. This integration speaks the classic Kasa LAN protocol. Newer Kasa firmware that only exposes the encrypted KLAP protocol is not supported.
How discovery works
Kasa devices only answer an active discovery probe, and the integration runs in a sandboxed container that cannot broadcast onto your LAN. So the scan is mediated by Gladys: the integration forges the encrypted Kasa discovery request, the Gladys core (which sits on your home network) broadcasts it, and relays the devices' replies back. You do not enter any IP address — the scan finds your devices, and the IP each one answered from is remembered to control it afterwards.
Give your Kasa devices a DHCP reservation on your router so their IP address stays stable; if it changes, a new scan picks up the new address automatically.
Configuration
-
Open the Configuration tab of the integration.
-
Choose a Refresh interval — how often each device is polled to refresh its state (default: every minute). Save.
This interval is stored on each device when it is discovered. Changing it later does not update the devices you already created: run a new scan to apply the new value.
-
Open the Discovery tab and click scan: your Kasa devices appear.
-
Click create on the ones you want. They land in the Devices tab with an On/Off control.
Run a scan again anytime you add a new device.
Troubleshooting
- A device does not appear on scan. Make sure it is powered on and on the same network/subnet as your Gladys host, then scan again. Only classic-protocol Kasa devices answer (see below).
- A device appears but never changes state. Its firmware may only speak the newer KLAP protocol, which is not supported.
- "Nothing happens" when I click scan. Gladys allows one scan every 10 seconds: wait a moment before scanning again. The error is shown in the integration banner.
- A device is flagged "unreachable". It is off, unplugged, or its IP address changed. Check it is powered on, then run a new scan to pick up its new address.
- "Another device now answers at this address". Your router reassigned that device's IP address to something else. Run a new scan: the integration deliberately refuses to control a device whose identity it could not verify, rather than acting on the wrong one.
- Need more detail? The integration logs everything it does. Check the
integration logs from the Gladys UI (or
docker logson the host) withLOG_LEVEL=debugfor the full detail.
Parámetros de configuración
Estos son los parámetros que TP-Link Kasa te pide en su pantalla de configuración en Gladys.
| Parámetro | Tipo | Obligatorio | Descripción |
|---|---|---|---|
| Refresh interval | select | No | How often each device is polled to refresh its state. |
Cómo instalar TP-Link Kasa en Gladys
- En Gladys, abre Integraciones: TP-Link Kasa aparece en el catálogo junto a las integraciones nativas, con una insignia de comunidad.
- Haz clic en Instalar. Gladys descarga la imagen Docker (
ghcr.io/cicoub13/gladys-tp-link:1.3.0), la ejecuta en un entorno aislado del núcleo y genera la interfaz de la integración (dispositivos, descubrimiento y configuración). - Abre la pantalla de Configuración de la integración, rellena los parámetros y guarda.
- También puedes instalarla directamente desde la URL de su repositorio: https://github.com/cicoub13/gladys-tp-link.
TP-Link Kasa requiere Gladys >=4.84.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
TP-Link Kasa 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 cicoub13, no el equipo principal de Gladys.
- Explorar todas las integraciones externas
- Descubrir las integraciones nativas incluidas en Gladys
- Crear y publicar tu propia integración externa
- Código fuente en GitHub — fuente de esta documentación