It is currently November 13th, 2019, 6:06 am

Working with the HWiNFO plugin

Our most popular Tips and Tricks from the Rainmeter Team and others
User avatar
jsmorley
Developer
Posts: 19706
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Working with the HWiNFO plugin

jsmorley » September 30th, 2015, 6:43 pm

Hardware Sensors

One of the things that you are likely to want in a skin is a way to monitor the hardware sensors on your system. Of particular interest will be the temperatures of various parts of your hardware, but there is lots of other hardware sensor information you might be interested in.

Rainmeter does not attempt to provide code to directly read hardware sensors. There are just far too many of them, and they change far too often, for a project like Rainmeter to ever be complete and up-to-date.

The way Rainmeter addresses hardware sensor information is to provide support through built-in or 3rd-party Rainmeter plugins, which can access information from several external applications that read and report on hardware sensors. You must have the application running, and then the Rainmeter plugin can access the information the application provides.

There are currently three that we recommend:

The CoreTemp plugin, which is included with Rainmeter. You will need the CoreTemp application installed and running.

The SpeedFan plugin, which is included with Rainmeter. You will need the SpeedFan application installed and running.

The 3rd-party HWiNFO plugin, which can be downloaded from that link. You will need the HWiNFO application installed and running.

All three work fine with Rainmeter, and each has strengths and weaknesses. For this guide, we will focus on my personal favorite, the HWiNFO plugin.

Step 1: The HWiNFO Application

HWiNFO is a very robust freeware system monitoring application for Windows. It provides a ton of information about your system's hardware, and can monitor and report on current status and potential problems. It's not a bad thing to have running even if you are not going to use the information in a Rainmeter skin.

You can download HWiNFO from here:

Download HWiNFO Application

Download it, install it and run it. I recommend installing it, and not running it portable, as like most application that need access to hardware, HWiNFO starts with Windows by setting up a Windows Scheduled Task, and it likely won't automatically start if you don't run the installer at least once.

Now using Setting option on the Windows Notification Area icon for HWiNFO, ensure the following settings in yellow are checked:
HWiNFOSettings.jpg
In particular, Shared Memory Support is required to use the Rainmeter plugin with HWiNFO. In general, those settings as I have them in that image work well and have the application just start silently in the Windows Notification Area.

Step 2: The HWiNFO Plugin for Rainmeter

Next you will want to get the HWiNFO plugin for Rainmeter. The plugin is provided and supported by an HWiNFO community member, and you can always get the most current version from their site.

The following link will download a .rmskin that when installed in Rainmeter, will install the 32bit or 64bit version of the HWiNFO plugin in your Rainmeter plugins folder, as well as an example skin from the plugin author you can play with:

Download HWiNFO_3.2.0.rmskin

There is a very extensive post on their forums about how to use the plugin with Rainmeter. While I intend to walk you through all you should need to know, that post is worth reading as well.

Step 3: Creating a skin with HWiNFO

After you have the HWiNFO application installed, configured and running, you are ready to start using it to create a skin.

The HWiNFO plugin measure:

Code: Select all

[MeasureCPUTemp]
Measure=Plugin
Plugin=HWiNFO
HWiNFOSensorId=0xf0000501
HWiNFOSensorInstance=0x0
HWiNFOEntryId=0x1000000
HWiNFOType=CurrentValue
The are four required options on an HWiNFO measure:

HWiNFOSensorId
HWiNFOSensorInstance
HWiNFOEntryId
HWiNFOType

A sensor may have one or many instances, and each of those instances may have one or many entries. Once you have identified the sensor, instance and entry, you use HWiNFOType to identify the particular value that is being returned.

HWiNFOType can be one of:

HWiNFOType=SensorName
HWiNFOType=SensorNameCustom
HWiNFOType=EntryName
HWiNFOType=EntryNameCustom
HWiNFOType=Units
HWiNFOType=CurrentValue
HWiNFOType=MinimumValue
HWiNFOType=MaximumValue
HWiNFOType=AverageValue

MinimumValue and MaximumValue reflect what the values have been since HWiNFO was started on your system. These are not the minimum and / or maximum value supported by your hardware, but in a sense the "lowest" and "highest" values the sensors have had since HWiNFO was started. It is not recommended that these values be dynamically used as MinValue / MaxValue on measures to return percentages. They are not terribly useful for that.

Note that if you are using HWiNFOType=SensorName or HWiNFOType=SensorNameCustom, then the HWiNFOEntryId option is not required, as you are not asking for any particular entry.

There is one optional option on the HWiNFO measure:

HWiNFOHostId

This will be the number of an optional remote computer on your local area network that is also running HWiNFO. If specified, the values from that computer will be used instead of your local system.

Step 4: Getting the values you need

To get the values you will need for your HWiNFO plugin measure, you will use a small application called HWiNFOSharedMemoryViewer.exe that comes with the .rmskin that installs the plugin on your system. It will be in the @Resources folder of the HWiNFO config that is created in your ..Documents\Rainmeter\Skins folder by the .rmskin.

Simply run that application, and you will get a dialog like this:
HWiNFO1.jpg
You can copy values from that dialog, to paste directly into your skin as the values for the measure options. This image shows what each of the fields in the dialog are for:
HWiNFOExample1.jpg
So it's pretty easy. Open the HWiNFOSharedMemoryViewer.exe, decide which sensor values you want to use, find and copy the values for:

HWiNFOSensorId
HWiNFOSensorInstance
HWiNFOEntryId

Shown in red in that image. Then use the names, shown in blue in that image, of the HWiNFOType results you want in the skin and set that value for HWiNFOType in the measure.

So in this example I want to get the CPU's current temperature:

Code: Select all

[MeasureCPUTemp]
Measure=Plugin
Plugin=HWiNFO
HWiNFOSensorId=0xf0000501
HWiNFOSensorInstance=0x0
HWiNFOEntryId=0x1000000
HWiNFOType=CurrentValue
Compare that to the image above, to see which values I copied from HWiNFOSharedMemoryViewer.exe.

Step 5: A simple example skin

Here is a .rmskin you can download and install. This requires at least the 3.3 Release of Rainmeter from http://rainmeter.net:
HWiNFOExample_3.2.0.rmskin
The .rmskin will install the appropriate 32bit or 64bit version of the plugin in your Rainmeter setup to use in this skin, and for your own skins.

In addition, in In the @Resources folder of this example skin will be the following.
  • The HWiNFOSharedMemoryViewer.exe application. You really must include this with any .rmskin you create and distribute. Any end-user trying to use your skin on their system will absolutely require it. I have a link on that logo in the example skin that loads the application, to help with modifying the skin. I recommend some similar approach in your skins.
  • A copy of that helpful image for HWiNFOSharedMemoryViewer.exe shown above. You really should include this with any .rmskin you create and distribute. An end-user will be sorta lost without some reference to what the fields in HWiNFOSharedMemoryViewer.exe mean.
  • 32bit and 64bit versions of the plugin .dll for use in creating new .rmskins. You should consider including this with any .rmskin you create and distribute. It makes it easy for a user who wants to create their own .rmskin to have the plugin versions available to include.
HWiNFOExample.jpg

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Metadata]
Name=HWiNFO Example
Author=JSMorley
Version=Feb 8, 2016
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Information=Simple example skin to demonstrate the HWiNFO plugin.

;Links to HWiNFO:
;http://www.hwinfo.com/
;http://www.hwinfo.com/download.php
;http://www.hwinfo.com/forum/Forum-Rainmeter-plug-in
;http://www.hwinfo.com/files/RainmeterPlugin/HWiNFO_3.0.0.rmskin

[Variables]
MinTemp=15
MaxTemp=90
AlertTemp=50

; HWiNFO Sensor Measures

[MeasureCPUTempCurrentValue]
Measure=Plugin
Plugin=HWiNFO
Group=Sensors
HWiNFOSensorId=0xf0000501
HWiNFOSensorInstance=0x0
HWiNFOEntryId=0x1000000
HWiNFOType=CurrentValue
MinValue=#MinTemp#
MaxValue=#MaxTemp#
AverageSize=5
IfCondition=MeasureCPUTempCurrentValue >= #AlertTemp#
IfTrueAction=[!SetOptionGroup Pointer LineColor "217,54,54,255"][!UpdateMeter *][!Redraw]
IfFalseAction=[!SetOptionGroup Pointer LineColor "173,230,247,255"][!UpdateMeter *][!Redraw]

[MeasureCPUTempLowestValue]
Measure=Plugin
Plugin=HWiNFO
Group=Sensors
HWiNFOSensorId=0xf0000501
HWiNFOSensorInstance=0x0
HWiNFOEntryId=0x1000000
HWiNFOType=MinimumValue
MinValue=#MinTemp#
MaxValue=#MaxTemp#

[MeasureCPUTempHighestValue]
Measure=Plugin
Plugin=HWiNFO
Group=Sensors
HWiNFOSensorId=0xf0000501
HWiNFOSensorInstance=0x0
HWiNFOEntryId=0x1000000
HWiNFOType=MaximumValue
MinValue=#MinTemp#
MaxValue=#MaxTemp#

[MeasureCPUTempAverageValue]
Measure=Plugin
Plugin=HWiNFO
Group=Sensors
HWiNFOSensorId=0xf0000501
HWiNFOSensorInstance=0x0
HWiNFOEntryId=0x1000000
HWiNFOType=AverageValue
MinValue=#MinTemp#
MaxValue=#MaxTemp#

; Meters

[MeterSkinBackground]
Meter=Image
W=265
H=145
SolidColor=20,30,34,255
SolidColor2=30,40,44,255

[MeterBackgroundCircle]
Meter=Roundline
W=80
H=80
X=10
Y=52
StartAngle=(Rad(270))
RotationAngle=(Rad(360))
LineStart=30
LineLength=40
LineColor=50,50,50,255
Solid=1
AntiAlias=1

[MeterCircle]
Meter=Roundline
MeasureName=MeasureCPUTempCurrentValue
W=80
H=80
X=10
Y=52
StartAngle=(Rad(270))
RotationAngle=(Rad(360))
LineStart=30
LineLength=40
LineColor=173,230,247,255
Solid=1
AntiAlias=1

[MeterPointer]
Meter=Roundline
Group=Pointer
MeasureName=MeasureCPUTempCurrentValue
W=80
H=80
X=10
Y=52
StartAngle=(Rad(270))
RotationAngle=(Rad(360))
LineWidth=2
LineLength=40
LineColor=173,230,247,255
AntiAlias=1

[MeterForegroundCircle]
Meter=Roundline
Group=Pointer
W=80
H=80
X=10
Y=52
StartAngle=(Rad(270))
RotationAngle=(Rad(360))
LineStart=0
LineLength=3
LineColor=173,230,247,255
Solid=1
AntiAlias=1

[MeterLowestPointer]
Meter=Roundline
MeasureName=MeasureCPUTempLowestValue
W=80
H=80
X=10
Y=52
StartAngle=(Rad(270))
RotationAngle=(Rad(360))
LineWidth=2
LineStart=19
LineLength=29
LineColor=153,247,153,255
AntiAlias=1

[MeterAveragePointer]
Meter=Roundline
MeasureName=MeasureCPUTempAverageValue
W=80
H=80
X=10
Y=52
StartAngle=(Rad(270))
RotationAngle=(Rad(360))
LineWidth=2
LineStart=19
LineLength=29
LineColor=247,238,153,255
AntiAlias=1

[MeterHighestPointer]
Meter=Roundline
MeasureName=MeasureCPUTempHighestValue
W=80
H=80
X=10
Y=52
StartAngle=(Rad(270))
RotationAngle=(Rad(360))
LineWidth=2
LineStart=19
LineLength=29
LineColor=247,116,116,255
AntiAlias=1

[MeterLogo]
Meter=Image
ImageName=#@#Images\HWiNFO.png
X=10
Y=10
W=32
H=32
AntiAlias=1
LeftMouseUpAction=["#@#HWInfoStuff\HWiNFOSharedMemoryViewer.exe"]

[MeterHeader]
Meter=String
X=10R
Y=15
FontFace=Fira Sans
FontSize=11
FontColor=#TextColor#
AntiAlias=1
Text=HWiNFO   CPU TEMPERATURE
InlineSetting=Color | 143,190,213,255
InlinePattern=HWiNFO
InlineSetting2=Weight | 500
InlinePattern2=.*
InlineSetting3=CharacterSpacing | 0.95 | *
InlinePattern3=TEMPERATURE
InlineSetting4=GradientColor | 180 | 153,247,153,255 ; 0.0 | 247,238,153,255 ; 0.5 | 247,116,116,255 ; 1.0
InlinePattern4=CPU TEMPERATURE
InlineSetting5=Underline
InlinePattern5=CPU TEMPERATURE

[MeterCPUTempCurrentValue]
Meter=String
MeasureName=MeasureCPUTempCurrentValue
X=100
Y=46
FontFace=Fira Sans
FontSize=11
FontColor=173,230,247,255
AntiAlias=1
Text=Current		%1 °C
InlineSetting=Weight | 600
InlinePattern=.*

[MeterCPUTempLowestValue]
Meter=String
MeasureName=MeasureCPUTempLowestValue
X=100
Y=12R
FontFace=Fira Sans
FontSize=11
FontColor=153,247,153,255
AntiAlias=1
Text=Lowest		%1 °C

[MeterCPUTempAverageValue]
Meter=String
MeasureName=MeasureCPUTempAverageValue
X=100
Y=3R
FontFace=Fira Sans
FontSize=11
FontColor=247,238,153,255
AntiAlias=1
Text=Average		%1 °C

[MeterCPUTempHighestValue]
Meter=String
MeasureName=MeasureCPUTempHighestValue
X=100
Y=3R
FontFace=Fira Sans
FontSize=11
FontColor=247,116,116,255
AntiAlias=1
Text=Highest		%1 °C
Feel free to ask questions as needed!
You do not have the required permissions to view the files attached to this post.
User avatar
xlr8r_
Posts: 20
Joined: October 8th, 2015, 12:45 pm

Re: Working with the HWiNFO plugin

xlr8r_ » October 8th, 2015, 1:20 pm

Hi,
I'm very new to rainmeter (since yesterday) and started all over with HWiNFO => having the most sensors in one pack for my intention.
Now my first easy skin is finished and after that I blunder over your tips with HWiNFO and Bars with gradient and so on. It was a little pain to discover by myself, but I guess it's easier now for further projects.
I looked around in the forum a bit and I appreciate your works (maybe I have had to look here before until beginning scripting with try and error). Found some nice "Roundline"-helps of you that I'll read before trying out some processor- and temperature-readings ;-)

I don't know how effective the ini-code is, but it works:

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1

[Metadata]
Name="HWiNFO: physical memory"
Author=FZ
Information="HWiNFO: physical memory"
Version=1.0.0
License=Z-Task

; ------------------------------ variables ------------------------------

[Variables]
@Include=#@#\HWiNFO.inc
SkinX=0
SkinY=0
SkinW=300
SkinH=62
SkinSolidColor=0,0,0,75
SkinBorder=2
TitleText="RAM: 4x Crucial 8 GB DDR4-2133 (15/15/15)"
PaddingLeft=5
PaddingTop=2
PaddingRight=5
PaddingBottom=2
MeterW=(#SkinW#-2*#SkinBorder#-#PaddingLeft#-#PaddingRight#)
MeterH=12
Image_BarGradient_W=233		
Image_BarGradient_H=29
MinRam=0
MaxRam=32768
MinPercent=0
MaxPercent=100

; ------------------------------ styles ---------------------------------

[StyleBackgroundDark]
SolidColor=80,80,80

[StyleBackgroundLight]
SolidColor=115,115,115

[StyleTextHeader]
StringAlign=Center
StringCase=None
StringStyle=Bold
StringEffect=Shadow
FontColor=219,219,219
FontFace=Trebuchet MS
FontSize=10
AntiAlias=1
Padding=#PaddingLeft#,#PaddingTop#,#PaddingRight#,#PaddingBottom#

[StyleText]
StringAlign=Left
StringCase=None
StringStyle=Bold
FontColor=234,234,234
FontFace=Trebuchet MS
FontSize=8
AntiAlias=1
Padding=#PaddingLeft#,#PaddingTop#,#PaddingRight#,#PaddingBottom#

[StyleBar-HW_System_PhysicalMemoryLoad]
W=#MeterW#-30
H=#MeterH#
SolidColor=150,150,150
BarOrientation=Horizontal
BarImage=#@#BarGradient.png
TransformationMatrix=((#MeterW#-30)/#Image_BarGradient_W#);0;0;(#MeterH#/#Image_BarGradient_H#);([MeterBar-HW_System_PhysicalMemoryLoad:X]-[MeterBar-HW_System_PhysicalMemoryLoad:X]*((#MeterW#-30)/#Image_BarGradient_W#));([MeterBar-HW_System_PhysicalMemoryLoad:Y]-[MeterBar-HW_System_PhysicalMemoryLoad:Y]*(#MeterH#/#Image_BarGradient_H#))
AntiAlias=1

; ------------------------------ meta-meters ----------------------------

[SkinBackground]
Meter=Image
X=#SkinX#
Y=#SkinY#
H=#SkinH#
W=#SkinW#
SolidColor=#SkinSolidColor#

[SkinTitle]
Meter=String
MeterStyle=StyleTextHeader|StyleBackgroundDark
W=#MeterW#
H=18
X=(#SkinW#/2)
Y=#SkinBorder#r
Text=#TitleText#

; ------------------------------ measures -------------------------------
[Measure-HW_System_PhysicalMemoryUsed]
Measure=Plugin
Plugin=HWiNFO.dll
HWiNFOSensorId=#HW_System_SensorId#
HWiNFOSensorInstance=#HW_System_SensorInstance#
HWiNFOEntryId=#HW_System_PhysicalMemoryUsed#
HWiNFOType=CurrentValue
MinValue=#MinRam#
MaxValue=#MaxRam#
RegExpSubstitute=1
Substitute="\d{1,3}(?=(\d{3})+(?!\d))":"\0,"

[Measure-HW_System_PhysicalMemoryAvailable]
Measure=Plugin
Plugin=HWiNFO.dll
HWiNFOSensorId=#HW_System_SensorId#
HWiNFOSensorInstance=#HW_System_SensorInstance#
HWiNFOEntryId=#HW_System_PhysicalMemoryAvailable#
HWiNFOType=CurrentValue
MinValue=#MinRam#
MaxValue=#MaxRam#
RegExpSubstitute=1
Substitute="\d{1,3}(?=(\d{3})+(?!\d))":"\0,"

[Measure-HW_System_PhysicalMemoryLoad]
Measure=Plugin
Plugin=HWiNFO.dll
HWiNFOSensorId=#HW_System_SensorId#
HWiNFOSensorInstance=#HW_System_SensorInstance#
HWiNFOEntryId=#HW_System_PhysicalMemoryLoad#
HWiNFOType=CurrentValue
MinValue=#MinPercent#
MaxValue=#MaxPercent#

; ------------------------------ meters ---------------------------------

[MeterString-HW_System]
Meter=String
MeterStyle=StyleText|StyleBackgroundLight
W=#MeterW#
H=#MeterH#
X=#SkinBorder#
Y=#SkinBorder#R
Text="physical:"

[MeterString-HW_System_PhysicalMemory]
Meter=String
MeterStyle=StyleText|StyleBackgroundLight
MeasureName=Measure-HW_System_PhysicalMemoryUsed
MeasureName2=Measure-HW_System_PhysicalMemoryAvailable
StringAlign=Right
W=#MeterW#
H=#MeterH#
X=(#SkinW#-#SkinBorder#)
Y=0r
Text="%1 GB used of %2 GB available"
SolidColor=0,0,0,0

[MeterString-HW_System_PhysicalLoad]
Meter=String
MeterStyle=StyleText|StyleBackgroundLight
MeasureName=Measure-HW_System_PhysicalMemoryLoad
StringAlign=Right
W=#MeterW#
H=(#MeterH#+#PaddingBottom#)
X=(#SkinW#-#SkinBorder#)
Y=0R
Text="%1 %"

[MeterBar-HW_System_PhysicalMemoryLoad]
Meter=Bar
MeterStyle=StyleBar-HW_System_PhysicalMemoryLoad
MeterStyle=StyleBackgroundLight
MeasureName=Measure-HW_System_PhysicalMemoryLoad
X=(#SkinBorder#+#PaddingLeft#)
Y=(0+#PaddingTop#)r

You do not have the required permissions to view the files attached to this post.
President of the world!
User avatar
jsmorley
Developer
Posts: 19706
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Working with the HWiNFO plugin

jsmorley » October 8th, 2015, 1:28 pm

Looks good to me.

I guess if it were me I would either reverse that image or measure "used" memory instead of "free" memory, as that image looks alarming with the Bar meter up into the "red" on the image, when in fact you have almost all your memory still free. Just a cosmetic thought...
08-10-2015 15-14-03.png
You do not have the required permissions to view the files attached to this post.
User avatar
xlr8r_
Posts: 20
Joined: October 8th, 2015, 12:45 pm

Re: Working with the HWiNFO plugin

xlr8r_ » October 8th, 2015, 1:38 pm

Hi,
It works like you say (the little comment of the attach describes).
I inverted the measurement, just for the screenshot, to see the gradient bar, so no alarming state, just for the picture ;-)

Tried this skin out with a lot of variables, so that I can play (scale) with sizes and borders, without losing the "look", to match further skins (if the global skin-width will expand for any reason).
My plan is to do some more little skins, that can be sticked together (=> one width for all)
President of the world!
User avatar
xlr8r_
Posts: 20
Joined: October 8th, 2015, 12:45 pm

Re: Working with the HWiNFO plugin

xlr8r_ » October 8th, 2015, 1:41 pm

xlr8r_ wrote:Hi,
It works like you say (the little comment of the attach describes).
I inverted the measurement, just for the screenshot, to see the gradient bar, so no alarming state, just for the picture ;-)

Tried this skin out with a lot of variables, so that I can play (scale) with sizes and borders, without losing the "look", to match further skins (if the global skin-width will expand for any reason).
My plan is to do some more little skins, that can be sticked together (=> one width for all)
And of course from green to red
You do not have the required permissions to view the files attached to this post.
President of the world!
User avatar
jsmorley
Developer
Posts: 19706
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Working with the HWiNFO plugin

jsmorley » October 8th, 2015, 1:41 pm

xlr8r_ wrote:Hi,
It works like you say (the little comment of the attach describes).
I inverted the measurement, just for the screenshot, to see the gradient bar, so no alarming state, just for the picture ;-)

Tried this skin out with a lot of variables, so that I can play (scale) with sizes and borders, without losing the "look", to match further skins (if the global skin-width will expand for any reason).
My plan is to do some more little skins, that can be sticked together (=> one width for all)
Ah, I didn't notice the attachment comment. Ok, carry on. Have fun.
User avatar
xlr8r_
Posts: 20
Joined: October 8th, 2015, 12:45 pm

Re: Working with the HWiNFO plugin

xlr8r_ » October 9th, 2015, 4:23 pm

one more HWiNFO <=> rainmeter - try.
You do not have the required permissions to view the files attached to this post.
President of the world!
User avatar
xlr8r_
Posts: 20
Joined: October 8th, 2015, 12:45 pm

Re: Working with the HWiNFO plugin

xlr8r_ » October 11th, 2015, 1:35 pm

again: one more
You do not have the required permissions to view the files attached to this post.
President of the world!
User avatar
xlr8r_
Posts: 20
Joined: October 8th, 2015, 12:45 pm

Re: Working with the HWiNFO plugin

xlr8r_ » October 19th, 2015, 5:46 am

Some time-lagging, cause unfortunately my pc totally broke down.
So I had to set up the hole stuff from scratch.

Next I want to do some GPU-infos. Then I'll be ready for some OC-work with my dedicated rainmeter-infos.

But another lil HWiNFO-Interfaces:
You do not have the required permissions to view the files attached to this post.
President of the world!
User avatar
xlr8r_
Posts: 20
Joined: October 8th, 2015, 12:45 pm

Re: Working with the HWiNFO plugin

xlr8r_ » October 25th, 2015, 8:04 pm

And my GPU-monitor
You do not have the required permissions to view the files attached to this post.
President of the world!