NoeticTools.Net2HassMqtt 0.3.2-InitialDev.97.1

Prefix Reserved
This is a prerelease version of NoeticTools.Net2HassMqtt.
There is a newer version of this package available.
See the version list below for details.
dotnet add package NoeticTools.Net2HassMqtt --version 0.3.2-InitialDev.97.1
                    
NuGet\Install-Package NoeticTools.Net2HassMqtt -Version 0.3.2-InitialDev.97.1
                    
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="0.3.2-InitialDev.97.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NoeticTools.Net2HassMqtt" Version="0.3.2-InitialDev.97.1" />
                    
Directory.Packages.props
<PackageReference Include="NoeticTools.Net2HassMqtt" />
                    
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 NoeticTools.Net2HassMqtt --version 0.3.2-InitialDev.97.1
                    
#r "nuget: NoeticTools.Net2HassMqtt, 0.3.2-InitialDev.97.1"
                    
#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 NoeticTools.Net2HassMqtt@0.3.2-InitialDev.97.1
                    
#: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=NoeticTools.Net2HassMqtt&version=0.3.2-InitialDev.97.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=NoeticTools.Net2HassMqtt&version=0.3.2-InitialDev.97.1&prerelease
                    
Install as a Cake Tool

Net2HassMqtt

NOTE

This project is currently experimental/pre-release with much of the code untested. Early trial and feedback would be great!

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:

// Your application model(s)
var environment = new EnvironmentSensorModel();

// MQTT broker connection options
var mqttClientOptions = ExampleMqttClientOptions.GetOptions("NET2HassMqtt_NodeIdExample", secretsConfig);

// Now we map your app's model to HASS device and entities.
var config = new BridgeConfiguration(mqttClientOptions)

    .HasDevice("Demo Home Environment",
                "my_home_environment", 

                device => device.Model(environment)

                                // Map model 'Temperature' property to HASS entity - "Lounge Temperature"
                                .HasTemperatureSensor(nameof(EnvironmentSensorModel.Temperature),
                                                      TemperatureSensorUoM.DegreesCelsius,
                                                      "Lounge Temperature", "lounge_temperature")

                                // Map model 'Humidity' property to HASS entity - "Lounge Humidiy"
                                .HasHumiditySensor(nameof(EnvironmentSensorModel.Humidity),
                                                   HumiditySensorUoM.Percent,
                                                   "Lounge Humidity", "lounge_humidity"));

var bridge = config.Build();

await bridge.StartAsync();  // Done! Running.
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.  net9.0 was computed.  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.

Version Downloads Last Updated
1.0.0 124 11/7/2024
0.3.5-InitialDev.100 51 11/3/2024
0.3.3-InitialDev.98.1 50 10/16/2024
0.3.2-InitialDevAlpha.96.2 48 10/14/2024
0.3.2-InitialDev.97.1 51 10/15/2024
0.3.1-alpha.1 51 8/6/2024
0.3.0-alpha.78-1 73 7/5/2024