ricky Posted September 7, 2012 Share Posted September 7, 2012 Hello,I want to read some hardare information.I want to read :CPU temp (most important)CPU fan speed (most important)Other fan speedOther temp in the motherboardHow can I do that?Thanks in advance for your helpRegadsRicky Link to comment Share on other sites More sharing options...
water Posted September 7, 2012 Share Posted September 7, 2012 Search the forum for "CPU temperature" or "hardware temperature" and you'll get a lot of hits. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
ricky Posted September 7, 2012 Author Share Posted September 7, 2012 Hello, before post, i found some topics, but not working solutions... Who can help me? Thanks in advance... Link to comment Share on other sites More sharing options...
armoros Posted September 7, 2012 Share Posted September 7, 2012 There are some good examples and solutions on these. [font="verdana, geneva, sans-serif"] [/font] Link to comment Share on other sites More sharing options...
Emiel Wieldraaijer Posted January 26, 2013 Share Posted January 26, 2013 (edited) Hi,I've tried to retrieve the CPU temperature throught WMI MSAcpi_ThermalZoneTemperature but the information is not correct.After searching the internet i found The Open Hardware monitor projectThe Open Hardware Monitor publishes all sensor data to WMI RootOpenHardwareMonitor. This allows other applications to read and use the sensor information as well. A preliminary documentation of the interface can be found here -> http://openhardwaremonitor.org/wordpress/wp-content/uploads/2011/04/OpenHardwareMonitor-WMI.pdfIf found a working PHP examplefunction report_cpu_temp(){ $wmi = new COM('winmgmts://./root/OpenHardwareMonitor'); $result = $wmi->ExecQuery("SELECT * FROM Sensor"); foreach($result as $obj){ if($obj->SensorType == 'Temperature' && strpos($obj->Parent, 'cpu') > 0) echo "$obj->Name ($obj->Value C)"; // output cpu core temp else echo 'skipping ' . $obj->Identifier ; echo ' '; } }But i don't know how to translateif($obj->SensorType == 'Temperature' && strpos($obj->Parent, 'cpu') > 0)echo "$obj->Name ($obj->Value C)"; // output cpu core tempInto AutoItTraySetState() $wbemFlagReturnImmediately = 0x10 $wbemFlagForwardOnly = 0x20 $strComputer = "." objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\OpenHardwareMonitor") While 1 $colItems = $objWMIService.ExecQuery("SELECT * FROM Sensor", "WQL",$wbemFlagReturnImmediately + $wbemFlagForwardOnly) $Instances = $objWMIService.InstancesOf("Sensor") $Output="" For $objItem in $colItems $CurrTemp=$objItem.SensorType $Output&= String(($CurrTemp/10) - 273.15) & "°C"& @crlf Next If $output = "" then TraySetToolTip("No ACPI device found") Else TraySetToolTip($output) EndIf Sleep(5000) WEnd exit Edited January 26, 2013 by Emiel Wieldraaijer Best regards,Emiel Wieldraaijer Link to comment Share on other sites More sharing options...
water Posted January 26, 2013 Share Posted January 26, 2013 if $obj.SensorType = 'Temperature' & StringInStr($obj.Parent, 'cpu') > 0 Then MsgBox(0, "", $obj.Name & " " & $obj.Value & " C")Not 100% sure that the translation of the echo line is correct. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Emiel Wieldraaijer Posted January 26, 2013 Share Posted January 26, 2013 (edited) Thanks Water so strpos = stringinstr Edited January 26, 2013 by Emiel Wieldraaijer Best regards,Emiel Wieldraaijer Link to comment Share on other sites More sharing options...
water Posted January 26, 2013 Share Posted January 26, 2013 Yes. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Emiel Wieldraaijer Posted January 26, 2013 Share Posted January 26, 2013 hmmm .. why didn't i google that Best regards,Emiel Wieldraaijer Link to comment Share on other sites More sharing options...
water Posted January 26, 2013 Share Posted January 26, 2013 Don't know My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Emiel Wieldraaijer Posted February 17, 2013 Share Posted February 17, 2013 Download : http://openhardwaremonitor.org/files/openhardwaremonitor-v0.5.1-beta.zipOpenHardwareMonitor.exe must be started in order to retrieve the information, it's also possible to retrieve the information through the openhardwaremonitorlib.dll but i don't know howexpandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> If not ProcessExists("OpenHardwareMonitor.exe") Then Msgbox (16, "Error", "Please start OpenHardwareMonitor.exe") Exit EndIf $wbemFlagReturnImmediately = 0x10 $wbemFlagForwardOnly = 0x20 $strComputer = "." $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\OpenHardwareMonitor") GUICreate ("CPU", 200,200) GUICtrlCreateLabel ("Temperature", 10, 10, 100,20) GUICtrlCreateLabel ("Load", 10, 40, 100,20) GUICtrlCreateLabel ("Power", 10, 70, 100,20) $CPUTemp = GUICtrlCreateLabel("", 130, 10, 50, 20, $SS_RIGHT) $CPULoad = GUICtrlCreateLabel("", 130, 40, 50, 20, $SS_RIGHT) $CPUPower = GUICtrlCreateLabel("", 130, 70, 50, 20, $SS_RIGHT) GUISetState() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch $colItems = $objWMIService.ExecQuery("SELECT * FROM Sensor", "WQL",$wbemFlagReturnImmediately + $wbemFlagForwardOnly) $Output="" $Power="" $Load="" For $objItem in $colItems if $objItem.SensorType = 'Power' and StringInStr($objItem.Parent, 'cpu') Then If StringInStr($objItem.Name , "Package") Then _GuiCtrlSetData($CPUPower, Round($objItem.Value,1) & " W") EndIf EndIf if $objItem.SensorType = 'Temperature' and StringInStr($objItem.Parent, 'cpu') Then If StringInStr($objItem.Name , "Package") Then _GuiCtrlSetData($CPUTemp, $objItem.Value & " °C") EndIf EndIf if $objItem.SensorType = 'Load' and StringInStr($objItem.Parent, 'cpu') Then If StringInStr($objItem.Name , "Total") Then _GuiCtrlSetData($CPULoad, Round($objItem.Value,1) & " %") EndIf EndIf Next WEnd Func _GUICtrlSetData($iCtrlID, $sData) If GUICtrlRead($iCtrlID, 1) <> $sData Then GUICtrlSetData($iCtrlID, $sData) EndFunc ;==>_GUICtrlSetData Xandy 1 Best regards,Emiel Wieldraaijer Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now