Jump to content

Hardware Temp


Recommended Posts

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
Link to comment
Share on other sites

  • 7 months later...

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...