Registry / communication / plugp100

plugp100

JSON →
library5.1.7pypypiunverified

PlugP100 is an asynchronous Python library designed to control TP-Link Tapo P100, P105, P110, L900, L920, and similar smart devices locally. It provides a simple API for common operations like turning devices on/off, checking status, and accessing energy monitoring data where available. The current stable version is 5.1.7, with active development on version 6.x indicating a potential upcoming major release with significant changes.

pip install plugp100
INSTALL
IMPORT
SIG · PLUGP100
P
plugp100
communicationpythonv5.1.7
Install
6.7s avg
Import
Disk
69MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v5.1.7 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 66.4MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 6.7s · import 0.000s · 69MB
69MB installed
● package 69MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PlugP100
from plugp100.api import PlugP100
from plugp100 import PlugP100

This quickstart demonstrates how to connect to a Tapo P100-series smart plug, retrieve its status, and toggle its power state. It uses environment variables for secure credential management and handles common exceptions. The library is asynchronous, so the code must be run within an `asyncio` event loop.

import asyncio import os from plugp100.api.plug_device import PlugP100 from plugp100.common.exceptions import TapoError async def main(): # It's recommended to use environment variables for sensitive data ip_address = os.environ.get("TAPO_IP", "192.168.1.100") # Replace with your device IP username = os.environ.get("TAPO_USERNAME", "your_tapo_email@example.com") # Your Tapo account email password = os.environ.get("TAPO_PASSWORD", "YourTapoPassword") # Your Tapo account password if not all([ip_address, username, password]): print("Please set TAPO_IP, TAPO_USERNAME, and TAPO_PASSWORD environment variables.") return # Initialize the device client plug = PlugP100(ip_address, username, password) try: # Authenticate with the device await plug.login() print(f"Successfully logged in to Tapo device at {ip_address}") # Get device information device_info = await plug.get_device_info() print(f"Device Model: {device_info.model}") print(f"Device Name: {device_info.device_name}") print(f"Device is currently {'On' if device_info.device_on else 'Off'}") # Toggle the plug's power state if device_info.device_on: print("Turning off the device...") await plug.turn_off() else: print("Turning on the device...") await plug.turn_on() # Get updated device info to confirm state change device_info_updated = await plug.get_device_info() print(f"Device is now {'On' if device_info_updated.device_on else 'Off'}") # Example for P110/P105 with energy monitoring (uncomment if applicable) # if hasattr(plug, 'get_current_energy_usage'): # energy_usage = await plug.get_current_energy_usage() # print(f"Current Power: {energy_usage.current_power} mW") except TapoError as e: print(f"Tapo device error: {e}") except Exception as e: print(f"An unexpected error occurred: {e}") finally: # Ensure the session is properly closed if plug.is_logged_in: # Check if plug is still logged in before attempting logout await plug.logout() print("Logged out from Tapo device.") if __name__ == "__main__": asyncio.run(main())
Debug
Known issues
breakingVersion 6.0.0, currently in development, is expected to introduce breaking changes to the API. Users should consult the release notes when upgrading from 5.x to 6.x to adapt their code.
fix
Monitor the official GitHub repository for release notes of 6.0.0 and review the migration guide upon its stable release.
affects: >=6.0.0-dev.1
gotchaThe `plugp100` library is built entirely on `asyncio`. All interactions with Tapo devices require `await` calls within an `async` function and must be run within an `asyncio` event loop.
fix
Ensure your application's entry point uses `asyncio.run(main_async_function())` and all library calls are properly `await`-ed. Review `asyncio` basics if unfamiliar.
affects: All
gotchaAuthentication errors, specifically `TapoError: Handshake failed`, are common if the IP address, username (Tapo account email), or password for your device is incorrect or if the device is unreachable.
fix
Verify the device's local IP address, your Tapo account credentials, and ensure the device is on the same network as the script and accessible. Tapo credentials are email and password, not local device passwords.
affects: All
gotchaNot all Tapo devices or models support every feature. For example, some plugs (like P100) do not provide energy monitoring data, while others (like P110, P105) do. Attempting to access unsupported features may raise errors or return empty data.
fix
Refer to the device's specifications and the library's documentation for which features are available for your specific Tapo device model (e.g., `get_current_energy_usage` is only for P110/P105).
affects: All
Upgrade
Version history
5.1.7latest on PyPI · released Mar 13, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
23 hits · last 30 days
node
22
OpenAI (training)
1
Resources
plugp100 — pip install plugp100 · libregistry