It is currently May 26th, 2020, 8:43 pm

Open Hardware Monitor Plugin [11-FEB-2011 V1.1]

Share and get help with Plugins and Addons
User avatar
TD22057
Posts: 30
Joined: February 2nd, 2011, 2:19 am

Open Hardware Monitor Plugin [11-FEB-2011 V1.1]

Post by TD22057 »

Open Hardware Monitor (OHM) Rainmeter Plugin [Updated: 11-FEB-2011 V1.1]

This plugin communicates with OHM using a WMI interface to read values (i.e. you must be running OHM for this to work). You specify the sensor to use by supplying three strings to the configuration: the hardware name, the sensor type, and the sensor name. These are the three strings that appear in the sensor hierarchy when you run OHM.

This plugin requires a version of OHM built after JAN-2011. I have built a version of OHM and included in the zip file. The OpenHardwareMonitor SVN directory contains a version that was built from source on 6-FEB-2011 which contains the WMI server needed to communicate with the plugin. Once OHM releases an official version with WMI support, this will no longer be needed. You can also use SVN to download the OHM source and built it with Visual Studio Express 2010 C# (I've never used the program before in my life and it was trivial to do).

I've built 32 bit and 64 bit versions of the plugin and tested them as much as I can. I'm running Windows 7 64 bit but I've run both DLL's using 32 and 64 bit versions of Rainmeter so I have some hope that they'll work with both apps.

To use this, copy the appropriate plugin to your Rainmeter plugins directory and create a new skin to use it. The required inputs are:
  • Hardware: The hardware name string from the OHM GUI (Intel Core i7-2600K, NVIDIA GeForce GTX 570, etc).
  • Type: The sensor type string from the OHM GUI (Clocks, Temperatures, Load, etc).
  • Type: The sensor type string from the OHM GUI (CPU Total, GPU Core, HDD, etc).
Optional Inputs are:
  • Debug: [Default=0] Set to 1 or 0 to enable debugging output in the Rainmeter log.
  • MaxValueCheck: [Default=1] Set to 1 or 0 to enable sensor maximum value sanity checking. If you make changes in OHM which modify which sensors are read (such as changing HDD sensors), some sensors may be reported in a different order. This check detects that and resets the sensor configuration. It's possible (but unlikely) that this could cause problems but if you see the sensors repeatedly going to zero and back to a value, set this to 0 and check the logs.
For sensor types that return a percentage, they will return [0,1] so you will want to set Percentual=1 in your meter.

If you get a crash or crazy behavior, it would help me if you enable Debug=1 and send me the log file output.

Example:

Code: Select all

[measureCPU]
Measure=Plugin
Plugin=Plugins\OpenHardwareMonitorPlugin.dll
Hardware=Intel Core i7-2600K
Type=Load
Sensor=CPU Total
;Debug=1
Version History:
  • 1.0: Initial release.
  • 1.1: Added MaxValueCheck input and updates to check for inconsistent sensor values or number of sensors read to handle the case where OHM changes which sensors it's reading. This can happen if you change the Read HDD Sensors option in OHM while Rainmeter is running.
You can download the plugin from here:

[JSMorley: Link removed. This plugin is very old, and unsupported by the original author. It should not be used.]

I've attached the source code to this post for anyone who wants to take a look at it. I'd be happy to hear any suggestions you have. This is a VSE 2008 build - if you're using 2010 you will have to grab the source yourself. I believe I've fixed all the build issues for 1.1.
Last edited by jsmorley on February 26th, 2015, 6:42 pm, edited 3 times in total.
Reason: Edited to remove link to old, unsupported and really unreliable plugin.
poiru
Developer
Posts: 2875
Joined: April 17th, 2009, 12:18 pm

Re: Open Hardware Monitor Plugin Release

Post by poiru »

Sounds great!

Just tried, but the plugin failed to load. It doesn't export anything (i.e. the values in About are blank). I then tried to build the plugin (after converting it to a VC2010 project -- we're upgrading), but failed due to unresolved external symbols.

By the way, I noticed the output file is set to ExamplePlugin.dll in your .vcproj file. Perhaps you uploaded the wrong plugin? :)

EDIT: Managed to build the plugin (had to add wbemuuid.lib as a dependency) and it's working file. While I was at it, I renamed the plugin to OpenHardwareMonitor.dll (we're trying to avoid the Plugin postfix for new plugins).

I would send over the files, but I'm on VC2010 so they won't work unless you upgrade. Anyway, fantastic work! Plugin seems to work great.
poiru
Developer
Posts: 2875
Joined: April 17th, 2009, 12:18 pm

Re: Open Hardware Monitor Plugin Release

Post by poiru »

Here is a working copy of the plugins and the OHM app for those eager to get their hands dirty: http://poiru.net/OHM.zip
User avatar
Chewtoy
Moderator
Posts: 1010
Joined: June 10th, 2009, 12:44 pm
Location: Sweden

Re: Open Hardware Monitor Plugin Release

Post by Chewtoy »

Error message wrote: The program could not start because MSVCP100.dll is missing from your computer. Try reinstalling the program to fix this program.
This is what I get when I try to load the plugin in rainmeter.
OHM works great (man that's a lot of info...), but when I try to load the plugin I get that error.
I don't think, therefore I'm not.
poiru
Developer
Posts: 2875
Joined: April 17th, 2009, 12:18 pm

Re: Open Hardware Monitor Plugin Release

Post by poiru »

Chewtoy wrote: OHM works great (man that's a lot of info...), but when I try to load the plugin I get that error.
Forgot to mention that you need the Visual C++ 2010 runtimes installed as we upgraded our development environment.

Get it from http://www.microsoft.com/downloads/en/details.aspx?FamilyID=BD512D9E-43C8-4655-81BF-9350143D5867 (64bit) or http://www.microsoft.com/downloads/en/details.aspx?FamilyID=a7b7a05e-6de6-4d3a-a423-37bf0912db84 (32bit). Once a public beta is released, the installer will automatically download and install the required runtimes. Until then, a manual installation is required.
User avatar
Chewtoy
Moderator
Posts: 1010
Joined: June 10th, 2009, 12:44 pm
Location: Sweden

Re: Open Hardware Monitor Plugin Release

Post by Chewtoy »

Indeed. That fixed it.
Thanks.


Edit
Now that I got to test it a little I can say that for the most part it works like a champ!
First of, the plugin says it's version 1.0 in About.

The problems I had was with any kind of 'Load' and with GPU Fan.

Load:
What ever Load I use, be it for the CPU or GPU, I don't get the values that I get in OHM.
If I for example take the total CPU load I get something like 8.5% in OHM and 0.1 in the rainmeterskin.

Code: Select all

[MCPU]
Measure=Plugin
Plugin=Plugins\OpenHardwareMonitor.dll
Hardware=Intel Core 2 Quad Q8200
Type=Load
Sensor=CPU Total
GPU Fan:
I got a NVIDIA GeForce 9800 GT, Type: Controls, Sensor GPU Fan.
In OHM it says 35%, in the skin it says 0.4

Code: Select all

[MGPU]
Measure=Plugin
Plugin=Plugins\OpenHardwareMonitor.dll
Hardware=NVIDIA GeForce 9800 GT
Type=Controls
Sensor=GPU Fan
Besides those I got no problems what so ever. Every sensor works great.
Awesome plugin!

Edit2:
poiru thought up why we get these values.
It returnes values 0.0-1.0 and this makes sense as both of them are represented by bars in OHM own gadget.
So yeah. Works good anyhow.
I don't think, therefore I'm not.
poiru
Developer
Posts: 2875
Joined: April 17th, 2009, 12:18 pm

Re: Open Hardware Monitor Plugin Release

Post by poiru »

Already solved with Chewtoy, but to avoid further confusion, the plugin returns loads between 0.0 and 1.0. So 6% is 0.1 and 37% is 0.4.
User avatar
TD22057
Posts: 30
Joined: February 2nd, 2011, 2:19 am

Re: Open Hardware Monitor Plugin Release

Post by TD22057 »

poiru wrote:Already solved with Chewtoy, but to avoid further confusion, the plugin returns loads between 0.0 and 1.0. So 6% is 0.1 and 37% is 0.4.
I've updated the first post to note that you should set Percentual=1 for those sensors.

poiru: Thanks for taking the time to build this. I'm normally a Linux developer and anytime you try to learn a new system it seems like a struggle. I felt like I was fighting VSE to get the thing to build the way I wanted. I started by copying the example plugin and just renaming all the instances of "ExamplePlugin" seemed like a huge pain and had to be done twice (once for 32 bit and once for 64 bit). I wonder - I did end up with 2 .vsproj files and I deleted the one with my computer name in it (thought it was weird it would even be there) - perhaps that one had the correct data in it because I did add the wbemuuid.lib to get it to build.

Is everyone having problems w/ the zip I made? On my machine, I can use the 64 bit plugin from the zip with the current Rainmeter 2.0 (64 bit) and it works fine. I can also use the 32 bit plugin from the zip w/ a 32 bit Rainmeter I built with VSE (and conversely - the 32 bit dll will not work with 64 bit rain). Could your problems have to do w/ the fact that I built them using the Debug target? Or could they be because you're running a VSE 2010 build of Rainmeter?
poiru
Developer
Posts: 2875
Joined: April 17th, 2009, 12:18 pm

Re: Open Hardware Monitor Plugin Release

Post by poiru »

TD22057 wrote:I'm normally a Linux developer and anytime you try to learn a new system it seems like a struggle. I felt like I was fighting VSE to get the thing to build the way I wanted.
Heh, I just edit the .vsproj files with a text editor, much easier than the GUI in most cases :)
TD22057 wrote:Could your problems have to do w/ the fact that I built them using the Debug target? Or could they be because you're running a VSE 2010 build of Rainmeter?
Debug shouldn't affect anything, just tested with a Debug build and same problem. I also tried using a VS2008 build (the official 2.0 release) and no luck with that either.
User avatar
TD22057
Posts: 30
Joined: February 2nd, 2011, 2:19 am

Re: Open Hardware Monitor Plugin Release

Post by TD22057 »

Ha - I never thought of that. I assumed the vcproj was some crazy binary format.

I'm still confused. I can take a default installation of 64 bit Rainmeter, copy the 64 bit plugin to the plugins directory, and everything works fine. I can also take the 32 bit plugin and use it with the default build from VSE (in 32 bit mode) and it also works fine. Any ideas how that can be happening if my build is really screwed up?

I'd like figure out how to correctly build a plugin for distribution but I'm at loss as to what the problem is...