SkillAgentSearch skills...

M4rcus.TuyaCore

Tuya Smart Plug Console Utility & .NET Standard API for Tuya/Jinvoo-compatible devices

Install / Use

/learn @Marcus-L/M4rcus.TuyaCore
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Tuya Smart Plug API (.NET Standard 2.0)

This .NET Standard 2.0 API allows programmatic control over the basic functions of Tuya Smart Plugs, including getting and setting Power status.

<img src="tuya-plug.jpg">

Requirements

  • .NET Core 2.0

Known-working devices:

Many Smart Plug devices compatible with the Tuya Smart Life and Jinvoo Smart app also appear to be compatible with the Tuya protocol.

Installation

Install-Package m4rcus.TuyaCore

Retrieving Tuya Plug ID and LocalKey values:

Check out the instructions at codetheweb/tuyapi

Usage

Console utility

> dotnet m4rcus.TuyaCore.Console.dll -i <ip> -k <localKey> -d <deviceId> [status|power-on|power-off]

Querying status, toggling power (async)

using m4rcus.TuyaCore;
var device = new TuyaPlug()
{
    IP = "192.168.0.101",
    LocalKey = "5f5f784cd82d449b",
    Id = "0120015260091453a970"
};
var status = await device.GetStatus();
await device.SetStatus(!status.Powered); // toggle power

Credits

Protocol details from @codetheweb and @clach04:

  • https://github.com/codetheweb/tuyapi
  • https://github.com/clach04/python-tuya/wiki
View on GitHub
GitHub Stars54
CategoryDevelopment
Updated2mo ago
Forks18

Languages

C#

Security Score

95/100

Audited on Jan 9, 2026

No findings