Skip to content

The C# .NET5 library to control TP-Link Tapo devices locally

License

Notifications You must be signed in to change notification settings

apdevelop/tapo-devices

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Tapo Devices

The C# .NET5 library for basic controlling of some types of TP-Link Tapo devices in local network without using TP-Link Cloud features. Device must be registered and has known IP address.

This project is mostly experimental and based on undocumented API features.

Usage

// Tapo account credentials (email and password)
var factory = new TapoDevices.TapoDeviceFactory("[email protected]", "password");

// 1. Control the Smart Socket with specified IP address
var plug = factory.CreatePlug("192.168.1.71");
await plug.ConnectAsync();

// Get device information
var info = await plug.GetInfoAsync();
var energyUsage = await plug.GetEnergyUsageAsync();

// Turn device on and then off
await plug.TurnOnAsync();
await plug.TurnOffAsync();

// 2. Control the Light Bulb
var bulb = factory.CreateBulb("192.168.1.72");
await bulb.ConnectAsync();
await bulb.SetColorTemperatureAsync(2700);
await bulb.SetBrightnessAsync(50);
await bulb.SetParametersAsync(
    new TapoDevices.SetDeviceInfo.ParamsBulb
    {
        Brightness = 5,
        Hue = 120,
        Saturation = 100,
        ColorTemperature = 0,
    });

Supported and tested devices

Device Description FW Version
P110 Mini Smart Wi-Fi Socket, Energy Monitoring 1.3.0 Build 230905 Rel.152200
P300 Smart Wi-Fi Power Strip 1.0.15 Build 231130 Rel.122554
L510 Smart Wi-Fi Light Bulb, Dimmable 1.1.0 Build 230721 Rel.224802
L530 Smart Wi-Fi Light Bulb, Multicolor 1.1.0 Build 230721 Rel.224802

Features

  • Asynchronous only set of methods for devices control
  • Generic types for requests/responses
  • NET 5.0 assembly without additional dependencies

TODOs

  • Implement as .NET8 / .NET Standard 2.0 library
  • Support for more of device features
  • Support for more device types
  • API documentation
  • Nuget package

References