TasmotaSharp 1.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package TasmotaSharp --version 1.0.2
                    
NuGet\Install-Package TasmotaSharp -Version 1.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TasmotaSharp" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TasmotaSharp" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="TasmotaSharp" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add TasmotaSharp --version 1.0.2
                    
#r "nuget: TasmotaSharp, 1.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package TasmotaSharp@1.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=TasmotaSharp&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=TasmotaSharp&version=1.0.2
                    
Install as a Cake Tool

TasmotaSharp

NuGet Version NuGet Downloads

A lightweight HTTP-based Tasmota client for .NET.
Provides typed async methods for relays, timers, rules, Wi-Fi, MQTT, sensors, backup/restore, geo, LEDs, mDNS, system.


Install

dotnet add package TasmotaSharp

Requirements: .NET 6 or higher (tested with .NET 8 and .NET 9).


Usage

using TasmotaSharp;

var client = new TasmotaClient("10.0.4.41");

// Relay
await client.SetRelayAsync(1, true);
var state = await client.GetRelayStateAsync(1);

// Time & DST
await client.SetTimezoneAsync(3);        // UTC+3
await client.SetDstAsync(false);
await client.SetTimeAsync(DateTime.Now);

// Wi-Fi scan
var nets = await client.ScanWifiAsync();

// One-shot: turn relay1 ON for 30s at specific date
await client.SetOneShotDateRuleAsync(
    1,
    new DateTime(2025,9,5,18,30,0),
    1,
    true,
    TimeSpan.FromSeconds(30)
);

// Backup config
var backup = await client.BackupConfigAsync();
await client.RestoreConfigAsync(backup!);

Highlights

  • Relays: Set, toggle, query state
  • Timers: Weekly, multi-relay, clear/disable
  • Rules: One-shot, relative pulse, sunrise/sunset
  • Wi-Fi: Set SSID/Password, scan, status
  • MQTT: Configure, query status
  • Sensors: Read (Status 10), set TelePeriod
  • System: Restart, factory reset
  • Geo: Latitude/Longitude
  • LED: Mode + power control
  • Backup/Restore: Config dump upload/download
  • mDNS: Enable/disable, query state

License

MIT © Serkan Polat Use freely in your projects 💚

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.