Skip to content

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Tapo Energy for Home Assistant

Local energy monitoring and switching for TP-Link Tapo P110 and P115 smart plugs.

English

Highlights

  • Fully local polling — no cloud API is used during normal operation
  • Current power, today's energy and monthly energy sensors
  • On/off control directly from Home Assistant
  • UI-based setup and configurable polling interval
  • One config entry per plug
  • KLAP transport on port 80 with individual requests for firmware compatibility
  • Automatic one-time session recovery if a plug rejects an expired KLAP session

Supported devices

Model Switch control Current power Daily energy Monthly energy
Tapo P110
Tapo P115

Other Tapo models have not been validated and are not officially supported.

Why this integration?

Some P110/P115 firmware versions — notably P115 firmware 1.4.x — reject batched multipleRequest calls with HTTP 403 after successful authentication. Tapo Energy sends each request separately and explicitly uses KLAP over port 80. This avoids the problematic batched query path while keeping communication local.

Installation

HACS (recommended)

  1. Open HACS in Home Assistant.
  2. Select the three-dot menu and choose Custom repositories.
  3. Add https://github.com/MTTPoll/tapo-energy and select Integration.
  4. Find Tapo Energy in HACS and select Download.
  5. Restart Home Assistant.
  6. Go to Settings → Devices & services → Add integration and search for Tapo Energy.

Manual installation

  1. Copy custom_components/tapo_energy into your Home Assistant configuration directory at /config/custom_components/tapo_energy.
  2. Restart Home Assistant.
  3. Go to Settings → Devices & services → Add integration and search for Tapo Energy.

Configuration

Enter the plug's local IP address, your Tapo account email address and password. Repeat the setup for every plug you want to add.

In the Tapo app, enable Compatibility with third-party apps for the account used by Home Assistant. Assigning a fixed IP address to each plug in your router is strongly recommended.

The integration polls every 30 seconds by default. Open the integration entry and select Configure to change the interval.

Entities

Each plug provides:

Entity Unit Home Assistant class
Current power W Power / Measurement
Energy today kWh Energy / Total increasing
Energy this month kWh Energy / Total increasing
Switch On / Off Switch

Troubleshooting

The integration cannot connect
  • Verify the plug's IP address and that Home Assistant can reach it on the local network.
  • Confirm the Tapo credentials and enable third-party app compatibility in the Tapo app.
  • Make sure the plug is online and not isolated from Home Assistant by a guest network or VLAN rule.
Entities are unavailable

Search the Home Assistant log for tapo_energy. Temporary network loss is the most common cause. A fixed DHCP lease helps prevent the plug's address from changing.

Authentication succeeds but requests return HTTP 403

Update the plug to the latest firmware available in the Tapo app. If the problem persists, remove and re-add the plug in the Tapo app to reset its device session.


Deutsch

Highlights

  • Vollständig lokale Abfrage — im normalen Betrieb wird keine Cloud-API verwendet
  • Sensoren für aktuelle Leistung sowie Tages- und Monatsverbrauch
  • Ein-/Ausschalten direkt aus Home Assistant
  • Einrichtung über die Benutzeroberfläche und einstellbares Abfrageintervall
  • Ein Konfigurationseintrag pro Steckdose
  • KLAP-Transport über Port 80 mit Einzelanfragen für hohe Firmware-Kompatibilität
  • Einmalige automatische Sitzungswiederherstellung bei abgelehnter KLAP-Sitzung

Unterstützte Geräte

Modell Schalten Aktuelle Leistung Tagesverbrauch Monatsverbrauch
Tapo P110
Tapo P115

Andere Tapo-Modelle wurden nicht validiert und werden nicht offiziell unterstützt.

Warum diese Integration?

Einige Firmware-Versionen der P110/P115 — insbesondere P115 Firmware 1.4.x — lehnen gebündelte multipleRequest-Anfragen trotz erfolgreicher Anmeldung mit HTTP 403 ab. Tapo Energy sendet jede Abfrage einzeln und verwendet ausdrücklich KLAP über Port 80. Dadurch wird der problematische Sammelabfrage-Pfad vermieden, während die Kommunikation lokal bleibt.

Installation

HACS (empfohlen)

  1. HACS in Home Assistant öffnen.
  2. Im Drei-Punkte-Menü Benutzerdefinierte Repositories auswählen.
  3. https://github.com/MTTPoll/tapo-energy hinzufügen und die Kategorie Integration wählen.
  4. Tapo Energy in HACS suchen und Herunterladen auswählen.
  5. Home Assistant neu starten.
  6. Einstellungen → Geräte & Dienste → Integration hinzufügen öffnen und nach Tapo Energy suchen.

Manuelle Installation

  1. custom_components/tapo_energy nach /config/custom_components/tapo_energy im Home-Assistant-Konfigurationsverzeichnis kopieren.
  2. Home Assistant neu starten.
  3. Einstellungen → Geräte & Dienste → Integration hinzufügen öffnen und nach Tapo Energy suchen.

Konfiguration

Die lokale IP-Adresse der Steckdose sowie E-Mail-Adresse und Passwort des Tapo-Kontos eingeben. Die Einrichtung für jede weitere Steckdose wiederholen.

In der Tapo-App muss für das verwendete Konto Kompatibilität mit Drittanbieter-Apps aktiviert sein. Eine feste IP-Adresse beziehungsweise DHCP-Reservierung für jede Steckdose wird dringend empfohlen.

Standardmäßig fragt die Integration alle 30 Sekunden neue Werte ab. Über Konfigurieren am Integrationseintrag lässt sich das Intervall ändern.

Entitäten

Jede Steckdose stellt bereit:

Entität Einheit Home-Assistant-Klasse
Aktuelle Leistung W Leistung / Messung
Verbrauch heute kWh Energie / Fortlaufende Summe
Verbrauch im Monat kWh Energie / Fortlaufende Summe
Schalter Ein / Aus Schalter

Fehlerbehebung

Die Integration kann keine Verbindung herstellen
  • IP-Adresse prüfen und sicherstellen, dass Home Assistant die Steckdose im lokalen Netzwerk erreicht.
  • Tapo-Zugangsdaten prüfen und die Kompatibilität mit Drittanbieter-Apps in der Tapo-App aktivieren.
  • Sicherstellen, dass die Steckdose online ist und nicht durch Gastnetz- oder VLAN-Regeln von Home Assistant getrennt wird.
Entitäten sind nicht verfügbar

Im Home-Assistant-Protokoll nach tapo_energy suchen. Meist ist die Steckdose kurzzeitig nicht erreichbar. Eine feste DHCP-Zuweisung verhindert, dass sich ihre IP-Adresse ändert.

Anmeldung erfolgreich, danach HTTP 403

Die Steckdose über die Tapo-App auf die neueste verfügbare Firmware aktualisieren. Bleibt das Problem bestehen, die Steckdose in der Tapo-App entfernen und erneut hinzufügen, um die Gerätesitzung zurückzusetzen.


Technical details / Technische Details

  • Protocol / Protokoll: KLAP, HTTP port 80
  • Library / Bibliothek: python-kasa
  • Polling / Abfrage: get_device_info and get_energy_usage as individual requests
  • Control / Steuerung: set_device_info
  • Update interval / Intervall: 30 seconds by default

Contributing / Mitwirken

Bug reports and pull requests are welcome. Please include the plug model, firmware version and relevant tapo_energy log entries in issue reports.

Fehlerberichte und Pull Requests sind willkommen. Bitte bei Fehlern Steckdosenmodell, Firmware-Version und relevante tapo_energy-Protokolleinträge angeben.

License / Lizenz

Released under the MIT License. / Veröffentlicht unter der MIT-Lizenz.

About

Local Home Assistant energy monitoring for TP-Link Tapo P110 and P115 smart plugs

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages