NoeticTools.Net2HassMqtt 1.0.0

Prefix Reserved
dotnet add package NoeticTools.Net2HassMqtt --version 1.0.0                
NuGet\Install-Package NoeticTools.Net2HassMqtt -Version 1.0.0                
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="NoeticTools.Net2HassMqtt" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NoeticTools.Net2HassMqtt --version 1.0.0                
#r "nuget: NoeticTools.Net2HassMqtt, 1.0.0"                
#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.
// 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 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. 
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.

Version Downloads Last updated
1.0.0 88 11/7/2024
0.3.5-InitialDev.100 42 11/3/2024
0.3.3-InitialDev.98.1 43 10/16/2024
0.3.2-InitialDevAlpha.96.2 42 10/14/2024
0.3.2-InitialDev.97.1 40 10/15/2024
0.3.1-alpha.1 46 8/6/2024
0.3.0-alpha.78-1 58 7/5/2024