Hello, finally I found a solution, but I am not sure, if the reading of the temperature is right. Here is my Code: https://pastebin.com/NJCamhrf Maybe you have some improvement suggestions. Code: """ You have to run this script as administrator. PowerShell is used. I am not sure, if the temperature reading is right. """ import subprocess import os import datetime psscript = """ $t = Get-WmiObject MSAcpi_ThermalZoneTemperature -Namespace “root/wmi” while (1) {$t.CurrentTemperature; sleep 5} """ si = subprocess.STARTUPINFO() si.dwFlags |= subprocess.STARTF_USESHOWWINDOW cmd = ['powershell.exe', '-Command', psscript] proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, startupinfo=si) with open(r'C:\Users\skyradar\Desktop\temp.txt', 'w') as fd: while True: tmp = proc.stdout.readline() proc.stdout.readline() # hack to prevent output twice celsius = int(tmp) / 10 - 273.15 celsius_str = f'{celsius:.2f};{datetime.datetime.now().isoformat()}' print(celsius_str) fd.write(celsius_str) fd.write(os.linesep)
Hm, I can't edit my own post. Currently the readings are wrong and I don't know exactly why. I get the whole time 63.05°C out. The resources I have used: - https://gist.github.com/jeffa00/9577816 - http://ammonsonline.com/is-it-hot-in-here-or-is-it-just-my-cpu/ I guess I have to iterate through $t.CurrentTemperature to get the 4 values out. Testing....
No problem. It seems that the value I read with my code is never changing. My approach was to save the temperature in a csv file (headless, without a GUI) and make a Graph from it. Maybe later together with Fan-Speed and CPU-Load. But it seems that I read the wrong Data. Additionally I do have the problem, that there is one "unknown device" in the device manager.