Using HWiNFO with Rainmeter


Overview

As of version 7.0 of the HWiNFO hardware sensor monitoring tool, the software has changed to require purchasing a yearly "Pro" license in order to use the Shared Memory feature of the software that allowed it to interact with the HWiNFO plugin for Rainmeter. This would make distributing Rainmeter skins to end-users problematic at best.

Martin Malik, the author of HWiNFO, has graciously worked with us to find a solution that will allow the software to be used for personal, non-commercial use in Rainmeter without having to purchase a license, while keeping his ability to monetize his application when used by commercial entities.

The approach consists of tweaking a feature of HWiNFO that was implemented years ago to support using the software with the now long-dead Windows Sidebar gadgets. This allows you to output the current values of one or more sensors to the Windows Registry, where it can be easily accessed using the Registry measure in Rainmeter. A distinct HWiNFO plugin for Rainmeter is no longer required.

Setting up HWiNFO

The end-user of a skin will need to do some setup work with HWiNFO before using the skin. The first thing will be to get version 7.02 or later of the software from HWiNFO Home. Install the software and run it.

Then using the "Settings" option from the Windows Notification Area tray icon, configure HWiNFO with these recommended options. Note that Shared Memory Support is not required and should be left turned off:


Close the Settings dialog, and again using the Windows Notification Area tray icon, select "Sensors", and then click on the "Configure Sensors" button at the bottom of the Sensor Status dialog.


Select the "HWiNFO Gadget" tab on the Sensor Settings dialog.

This will list all of the sensors that HWiNFO is monitoring for your hardware. What is on this list will obviously vary from computer to computer! Be sure the checkbox for "Enable reporting to Gadget" is selected.


Now scroll through the list, and one at a time, select the sensor elements you wish to output to Rainmeter. For each one, check the box "Report value in Gadget", and make a note of the "Index" value that is created for each. More on that in a minute...


Click on "OK" and you are done! You can close the Sensor Status dialog. HWiNFO will minimize to the Windows Notification Area, and will continue to run in the background.

Using the values in a skin

The hard work is behind you! Using the values in a skin is actually really simple. What happens is that HWiNFO will output the current values for all of the sensor elements you selected to the Windows Registry. This will be done each time HWiNFO "polls" your sensors, which by default is every 2000ms or every 2 seconds. This can be changed in the settings for HWiNFO, but I don't particularly recommend changing it. You don't want HWiNFO using more resources than it needs to.

For each sensor element, four registry entries will be created and updated.

  • SensorN : This will contain the name of the top level sensor.
  • LabelN : This will contain the name of the individual sensor element.
  • ValueN : This will contain a formatted version of the number value.
    Formatting will include commas for thousands separators, and the text value for the unit of measure.
    Example: 4,198 MHz
  • ValueRawN : This will contain a raw, unformatted version of the number value.
    Example: 4198

Now for those values for N. That will be that "Index" number that was assigned to each sensor element when you configured HWiNFO. Those numbers can be obtained by opening a cmd.exe Command Prompt, and typing in:

reg query HKEY_CURRENT_USER\SOFTWARE\HWiNFO64\VSB

That will produce a listing like this:


So all you need to do is create Registry measures to obtain each of those values you want to display in your skin.

The values are stored in the registry in HKEY_CURRENT_USER\SOFTWARE\HWiNFO64\VSB.

[Measure0Sensor]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=SOFTWARE\HWiNFO64\VSB
RegValue=Sensor0

[Measure0Label]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=SOFTWARE\HWiNFO64\VSB
RegValue=Label0

[Measure0ValueFormatted]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=SOFTWARE\HWiNFO64\VSB
RegValue=Value0

[Measure0ValueRaw]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=SOFTWARE\HWiNFO64\VSB
RegValue=ValueRaw0

That's really all there is to it! No plugin, no hideous and complicated hex numbers. Just go get the value you want.

Some Notes and Tips

It might occur to you that "writing" to the Windows Registry every 2 seconds might be working your hard drive a bit. This really isn't the case. Windows is very clever about how it manages the Registry and changes are actually just stored in a memory copy of the hive, and only written to the physical disk periodically, and / or when you shut down Windows. This approach is very easy indeed on your hard drive.

The old Rainmeter plugin for HWiNFO allowed you to obtain distinct values for "Current", "Minimum", "Maximum" and "Average" for each sensor element. Only the "current" value is possible with this interface. These values can just as easily be calculated in the skin, which I demonstate in the MinMaxAvg skin in the example .rmskin below.

This interface does not support monitoring "remote computers". If you need to have a computer monitor one or more other computers on a network, this is the kind of functionality that requires that you purchase the "Pro" version of HWiNFO.

Many of the sensor elements HWiNFO will monitor have really bizarre, mysterious, or otherwise incomprehensible names. As you are going through the list on the main Sensor Status dialog, holding your mouse over the element will provide a really nice tooltip explanation of what the sensor means.

Those names can be changed by you! Simply right click any sensor element in the Sensor Status dialog and "Rename" it to something that makes more sense to you. Those changes will be carried through into the interface and into your skins.

Example .rmskin to Download

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
ContextTitle=Display Sensors
ContextAction=[!ActivateConfig "HWiNFO_New\ShowReg" "ShowReg.ini"]

[Variables]
; * Skin Authors
; The easiest way to do this is to create variables for each of the values you
; will be using in the skin. Give them easy to understand variable names.
; * Skin Users
; Right click this skin and select "Display Sensors"
; That will create a list of all the sensor elements you are "outputting" from HWiNFO in your default browser.
; Find the Index number for each of the elements the skin needs and set the variables accordingly.
; Note that if you later go back into HWiNFO and add or remove elements to "output",
; these Index numbers will change!

CPUNameIndex=15
CPU0SpeedIndex=15
CPUUsageIndex=58
CPUTempIndex=102
CPUFanIndex=149
GPUNameIndex=198
GPUTempIndex=198
GPUFanIndex=207

; Measures

[MeasureCPUNameSensor]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=SOFTWARE\HWiNFO64\VSB
RegValue=Sensor#CPUNameIndex#
UpdateDivider=-1
RegExpSubstitute=1
Substitute="^.*]:":""

[MeasureCPU0SpeedLabel]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=SOFTWARE\HWiNFO64\VSB
RegValue=Label#CPU0SpeedIndex#
UpdateDivider=-1

[MeasureCPU0SpeedValueRaw]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=SOFTWARE\HWiNFO64\VSB
RegValue=ValueRaw#CPU0SpeedIndex#

[MeasureCPUUsageLabel]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=SOFTWARE\HWiNFO64\VSB
RegValue=Label#CPUUsageIndex#
UpdateDivider=-1

[MeasureCPUUsageValueRaw]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=SOFTWARE\HWiNFO64\VSB
RegValue=ValueRaw#CPUUsageIndex#

[MeasureCPUTempLabel]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=SOFTWARE\HWiNFO64\VSB
RegValue=Label#CPUTempIndex#
UpdateDivider=-1

[MeasureCPUTempValueRaw]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=SOFTWARE\HWiNFO64\VSB
RegValue=ValueRaw#CPUTempIndex#

[MeasureCPUFanLabel]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=SOFTWARE\HWiNFO64\VSB
RegValue=Label#CPUFanIndex#
UpdateDivider=-1

[MeasureCPUFanValuePretty]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=SOFTWARE\HWiNFO64\VSB
RegValue=Value#CPUFanIndex#

[MeasureGPUNameSensor]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=SOFTWARE\HWiNFO64\VSB
RegValue=Sensor#GPUNameIndex#
UpdateDivider=-1
RegExpSubstitute=1
Substitute="^.*]:":""

[MeasureGPUTempLabel]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=SOFTWARE\HWiNFO64\VSB
RegValue=Label#GPUTempIndex#
UpdateDivider=-1

[MeasureGPUTempValueRaw]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=SOFTWARE\HWiNFO64\VSB
RegValue=ValueRaw#GPUTempIndex#

[MeasureGPUFanLabel]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=SOFTWARE\HWiNFO64\VSB
RegValue=Label#GPUFanIndex#
UpdateDivider=-1

[MeasureGPUFanValuePretty]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=SOFTWARE\HWiNFO64\VSB
RegValue=Value#GPUFanIndex#

; Meters

[MeterCPUName]
Meter=String
W=390
MeasureName=MeasureCPUNameSensor
FontSize=12
FontWeight=600
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=CPU - %1

[MeterCPU0Speed]
Meter=String
W=390
Y=15R
MeasureName=MeasureCPU0SpeedLabel
MeasureName2=MeasureCPU0SpeedValueRaw
FontSize=12
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
DynamicVariables=1
Text=%1 - %2 MHz : Max - [MeasureCPU0SpeedValueRaw:MaxValue] MHz

[MeterCPUUsage]
Meter=String
W=390
Y=10R
MeasureName=MeasureCPUUsageLabel
MeasureName2=MeasureCPUUsageValueRaw
FontSize=12
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=%1 - %2%

[MeterCPUTemp]
Meter=String
W=390
Y=5R
MeasureName=MeasureCPUTempLabel
MeasureName2=MeasureCPUTempValueRaw
FontSize=12
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=%1 - %2 °C

[MeterCPUFanSpeed]
Meter=String
W=390
Y=5R
MeasureName=MeasureCPUFanLabel
MeasureName2=MeasureCPUFanValuePretty
FontSize=12
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=%1 - %2

[MeterGPUName]
Meter=String
W=390
Y=15R
MeasureName=MeasureGPUNameSensor
FontSize=12
FontWeight=600
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=GPU - %1

[MeterGPUTemp]
Meter=String
W=390
Y=10R
MeasureName=MeasureGPUTempLabel
MeasureName2=MeasureGPUTempValueRaw
FontSize=12
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=%1 - %2 °C

[MeterGPUFanSpeed]
Meter=String
W=390
Y=5R
MeasureName=MeasureGPUFanLabel
MeasureName2=MeasureGPUFanValuePretty
FontSize=12
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=%1 - %2


Bonus Skins!

Included with that .rmskin is a little ShowReg skin that will create a listing of the Registry entries for HWiNFO and open it in your default browser. Something like this might help your end-users find those Index numbers they will need.


Also included is an example MinMaxAvg skin showing how you can get and use the Minimum, Maximum, and Average values in your skins.