Jump to content
Sign in to follow this  
netegg

Hardware Temp

Recommended Posts

netegg

Is it possible to get the hardware temperature by api?

Share this post


Link to post
Share on other sites
Igzter

Is it possible to get the hardware temperature by api?

Well - it would be helpful if you specified which hardware temp (CPU, PSU or other device?). What it boils down to is it all depends.

Share this post


Link to post
Share on other sites
Igzter

Is it possible to get the hardware temperature by api?

If you are looking for the CPU external temperature you can query WMI for informatio (ACPI). I use my own iWMILib but as you can see from the example below its a standard WMI query using WQL (just using my lib to excuse myself of writing all additional support code).

http://www.autoitscript.com/forum/index.php?showtopic=115733 (iWMILib)

Hope this helps you somewhat..

Ig

#NoTrayIcon
#include <iWMILib.au3>

_iWMI_Initialize()

$iConnection = _iWMI_Connect("localhost",0,"","", "root\WMI" ) ; Assume you have privs to execute the query
if @error Then
        ConsoleWrite("Error!" & @CRLF )
EndIf
$cObjects = _iWMI_ExecQueryRaw( $iConnection, "SELECT * FROM MSAcpi_ThermalZoneTemperature", False )
if @error Then
        ConsoleWrite("Error!" & @CRLF )
EndIf

For $oObject In $cObjects
        $temperature    = ( $oObject.CurrentTemperature - 2732.0) / 10.0                    ; Convert to Celsius from 0.1 Kelvins
        $critical       = ( $oObject.CriticalTripPoint - 2732.0) / 10.0                     ; Convert to Celsius from 0.1 Kelvins
        ConsoleWrite( $temperature & @CRLF )
        ConsoleWrite( $critical & @CRLF )
Next

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×