A Windows service that exposes system sensors to MQTT so that they can be consumed from IOT applications such as Home Assistant
See Roadmap.
The application is a Windows Service that runs in the background, collects system information, and publishes it to an MQTT broker.
It uses the MQTT protocol to communicate with the broker and publish sensor data.
Install as a Windows Service
First, build a a self-containing exe:
dotnet publish .\src\Win2Mqtt\ --configuration Release --framework net8.0-windows8.0 --runtime win-x64 --self-contained --output c:\Win2MQTT
Then create and start the service (you will need Administration privileges):
sc.exe create "Win2MQTT Service" binpath= "C:\Win2MQTT\Win2Mqtt.exe"
sc.exe start "Win2MQTT Service"
More information in this article
Install as a Linux Service
First, build a a self-containing exe:
dotnet publish ./src/Win2Mqtt --configuration Release --framework net8.0 --runtime linux-x64 --self-contained --output ./publish
Sensors are published to Home Assistant, provided it has the MQTT integration enabled.
The default topic is win2mqtt/{hostname}
where {hostname}
is the name of the computer running the service.
The hostname is automatically detected and used as the prefix for all topics.
See Sensors to see the list of available sensors and their topics.
Win2MQTT subscribes to several topics and, when receiving messages, executes a command or action.
See Listeners to see the list of available listeners and their topics.
(in progress)
From https://learn.microsoft.com/en-us/dotnet/core/extensions/windows-service-with-installer?tabs=wix