The C# .NET5 library for basic controlling of some types of TP-Link Tapo devices in local network (not 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.
// Tapo account credentials (email and password)
var factory = new TapoDevices.TapoDeviceFactory("user@domain.com", "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,
});
- P110 Mini Smart Wi-Fi Socket, Energy Monitoring
- L510 Smart Wi-Fi Light Bulb, Dimmable
- L530 Smart Wi-Fi Light Bulb, Multicolor
- Asynchronous only set of methods for devices control
- Generic types for requests/responses
- NET 5.0 assembly without additional dependencies
- Implement as .NET Standard 2.0 library
- Support for more of device features
- Support for more device types
- API documentation