MQTT To AIDA64 Bridge
Having moved my gaming pc back to Windows (yes I know…) due to a big upgrade in processor and graphics card (9800X3D and RTX 5080) I have been setting up a stats screen using AIDA64. One area that was lacking however was the ability for me to pull in MQTT data and display it on the sensor panel. Time to fire up Visual Studio.
AIDA64 & Stats Panels
AIDA64 is a great program for building stats panels, it is very simple to get started and makes it easy for beginners to design quite complicated layouts. Add to that the fact that off the shelf small displays are relatively inexpensive, you can, without too much effort add a great system stats display to your case or computer.
AIDA64 Limitations
As great at AIDA64 is, there are still some limitations, one of them being no method to pull in data from MQTT. Given how easy it is to send sensor data around a network with MQTT it is unfortunate that no plugins or methods exits to subscribe to a topic and get sensor data.
Fixing The Problem - MQTT In AIDA64
So what are my options, how can I grab MQTT data, bundle it up and insert it into AIDA64 for use in a sensor panel?
This looks like a problem with two parts, firstly how can I pull arbitrary data into AIDA64 and use it in a sensor panel? And secondly how can I grab MQTT data (on a windows machine) and use it with the first part?
Arbitrary Data In AIDA64
Part one, how can I get data into AIDA64? Interestingly this is actually a lot simpler than I expected, I though plugins may have to be written or complicated scripts designed. However AIDA64 has 20 custom registry keys, 10 of them being DWORDS (32 bit integers) and 10 of them being string. If you write a value to any of these, they appear as a sensor and are usable in sensor panels.
They live here
HKEY_CURRENT_USER\Software\FinalWire\AIDA64\ImportValues
DWORDS are keys DW1 to DW10 and Strings are Str1 To Str10. Simple enough and a quick test manually creating keys and adding values to them proves that all works as expected. Nice on to part two.
MQTT Data In Windows
Part two, how can I subscribe to MQTT data topics in windows and insert the payloads into registry keys when they arrive? Time to fire up Visual Studio and write a hopefully simple .NET program.
With the use of the MQTTnet library and a little bit of tinkering in c#, I managed to produce a small tray application that can be run on startup and subscribes to one or more topics on a local MQTT server. When data arrives it matches to the configured subscriptions and inserts the payload data into the relevant registry key(s).
The Application
With the first version of the application complete, it has been running well on my gaming pc. I have pushed all the code to my Github so anyone can use, copy it, extend it or inspect the code and suggest changes.
There is a small guide here on how to set it up and use it (the same as is on the Github page). Hopefully someone finds this helpful, is has certainly solved the problem I was having and I can now see total power usage on my stats display (top right hand side in the image)
Installation
To install the bridge, please go to the release page and grab the latest version (it will be a zip file of the compiled app).
Unzip the application to a suitable directory on your system.
It is advised to run the program as startup, so it starts with or shortly after AIDA64.
When the program is running it will show an icon in the notification area (a red mqtt icon), you can right click it to exit.
Configuration
There is a simple config in JSON that allows you to define a MQTT broker and optionally a username and or password for the broker. You can then define up to 20 keys (10 DWORD, 10 String) to read different MQTT paths to the registry keys.
An example config, shown here is included in the release, it will require some adjustment to work with your local setup.
{
"broker": {
"host": "1.1.1.1",
"user": "user",
"password": "password"
},
"keys": [
{
"key": "DW1",
"topic": "draytronics/switch/game_pc/SENSOR",
"path": "ENERGY.Power"
},
{
"key": "DW2",
"topic": "draytronics/switch/game_pc/SENSOR",
"path": "ENERGY.Voltage"
}
]
}
Broker Section
The ‘broker’ section defines how you connect to your local MQTT server.
host
- This is the IP address or DNS name of your MQTT server
user
- This is the user name needed to connect to your MQTT server (optional)
password
- This is the password needed to connect to your MQTT server
(optional)
Keys Section
The ‘keys’ section defines what topics you are going to subscribe to on your MQTT server, what you will do with the returned data and what registry key it should be written to.
key
- This is the name of the key that should be written in the AIDA64
custom registry values
these can only be DW1 to DW10 or STR1 to STR10 as defined by the linked page. DW
keys are DWORD (32 bit integer values) STR keys are String.
topic
- This is the topic to subscribe to on the MQTT server
path
- This is the path value that allows you to pick out specific JSON nodes
if the data returned from the topic is JSON (more detail of this under here). If
your topic does not return JSON but a simple value you can exclude adding the
path value or set it to an empty value.
To expand on the path
setting, in the example config above the topic
draytronics/switch/game_pc/SENSOR returns;
{
"Time": "2025-02-12T22:47:39",
"ENERGY": {
"TotalStartTime": "2025-02-10T16:47:09",
"Total": 0.904,
"Yesterday": 0.636,
"Today": 0.258,
"Power": 122,
"ApparentPower": 126,
"ReactivePower": 33,
"Factor": 0.96,
"Voltage": 243,
"Current": 0.521
}
}
So I use the path ENERGY.Power and ENERGY.Voltage to return those values rather than the whole JSON block. If you have an array in your JSON data you can also do paths that include indexes such as item[3].value.
Notes On Interger Parsing
If you are using a DW1-10 key the program will try and parse the response as an integer and will not set the value if it fails, for strings or any non integer values use a STR1-10 key.
Using Data In AIDA64
Once data has been capture and written to the registry any items will show up as Registry Value (NAME OF REG) when you add a new sensor to the sensor panel.