NoeticTools.Net2HassMqtt
1.0.0
dotnet add package NoeticTools.Net2HassMqtt --version 1.0.0
NuGet\Install-Package NoeticTools.Net2HassMqtt -Version 1.0.0
<PackageReference Include="NoeticTools.Net2HassMqtt" Version="1.0.0" />
paket add NoeticTools.Net2HassMqtt --version 1.0.0
#r "nuget: NoeticTools.Net2HassMqtt, 1.0.0"
// Install NoeticTools.Net2HassMqtt as a Cake Addin #addin nuget:?package=NoeticTools.Net2HassMqtt&version=1.0.0 // Install NoeticTools.Net2HassMqtt as a Cake Tool #tool nuget:?package=NoeticTools.Net2HassMqtt&version=1.0.0
Net2HassMqtt
Net2HassMqtt provides Home Assistant (HASS) integration to .NET applications via MQTT. It not a MQTT transport layer. It provides a Home Assistant centric fluent configuration interface to map your application's models to Home Assistant entities.
The devices and entities you configure automatically appear fully configured in Home Assistant (Home Assistant MQTT Discovery). Configure once, use twice & no YAML! 😃
You do not need to code any MQTT publish calls, value conversions, subscriptions, or connection management. It just all happens. Net2HassMqtt layers over MQTT so you do not have to. It is designed to let you work with the "what" (Home Assistant) not the "how" (MQTT).
An example:
// Create a device to hold the entities
var device = new DeviceBuilder().WithFriendlyName("Net2HassMqtt Quick Start Device 1")
.WithId("net2hassmqtt_quick_start_device_01");
// Map model property to an entity
device.HasBatteryChargingBinarySensor(config => config.OnModel(model)
.WithStatusProperty(nameof(QuickStartDemoModel.BatteryChaging))
.WithUnitOfMeasurement(BatteryChargingBinarySensorUoM.None)
.WithFriendlyName("Battery Charging Status")
.WithNodeId("battery_1_charging"));
// Build bridge
var bridge = new BridgeConfiguration().WithMqttOptions(mqttClientOptions)
.HasDevice(device)
.Build();
// Run
await bridge.StartAsync();
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net8.0
- CommunityToolkit.Mvvm (>= 8.3.2)
- FluentDateTime (>= 3.0.0)
- Microsoft.Extensions.Hosting (>= 8.0.1)
- MQTTnet (>= 4.3.7.1207)
- MQTTnet.Extensions.ManagedClient (>= 4.3.7.1207)
- NoeticTools.Git2SemVer.MSBuild (>= 1.0.0)
- Serilog.Extensions.Logging (>= 8.0.0)
- System.Configuration.ConfigurationManager (>= 8.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 69 | 11/7/2024 |
0.3.5-InitialDev.100 | 39 | 11/3/2024 |
0.3.3-InitialDev.98.1 | 40 | 10/16/2024 |
0.3.2-InitialDevAlpha.96.2 | 36 | 10/14/2024 |
0.3.2-InitialDev.97.1 | 37 | 10/15/2024 |
0.3.1-alpha.1 | 41 | 8/6/2024 |
0.3.0-alpha.78-1 | 55 | 7/5/2024 |