snip3rnick / PyHardwareMonitor

Thin Python layer for LibreHardwareMonitor
BSD 3-Clause "New" or "Revised" License
9 stars 5 forks source link

I don't see as much information in Python that in the GUI #7

Open benoit-cty opened 3 months ago

benoit-cty commented 3 months ago

Hello,

Thanks for the package 👍

I don't see as much information in Python that in the GUI, even in administrator mode:

PyHardwareMonitor-main> python.exe .\test\TestHardwareMonitor.py
Hardware: AMD Ryzen Threadripper 1950X 1
        Sensor: CPU Core #1, value: 73.18607330322266
[...]
        Sensor: CPU Core #32, value: 11.351579666137695
        Sensor: CPU Total, value: 60.929725646972656
        Sensor: CPU Core Max, value: 99.99630737304688
        Sensor: Package, value: 158.16065979003906
        Sensor: Core #1, value: 3693.0537109375
        Sensor: Core #1, value: 37.0
        Sensor: Core #1 (SMU), value: 8.992218971252441
        Sensor: Core #1 VID, value: 1.2312500476837158
[...]
        Sensor: Core #16, value: 3693.0537109375
        Sensor: Core #16, value: 37.0
        Sensor: Core #16 (SMU), value: 4.2909746170043945
        Sensor: Core #16 VID, value: 1.2374999523162842
        Sensor: Core (Tctl), value: 89.12500762939453
        Sensor: Core (Tdie), value: 62.12500762939453
        Sensor: Core (SVI2 TFN), value: 1.0499999523162842
        Sensor: Bus Speed, value: 99.81226348876953

The power is not there.

What can I do to get it ?

snip3rnick commented 3 months ago

Did you use the wheel from the release page or the version from the main branch?

I never ended up updating the release as I wanted to correct the package version to have it correlate directly to the LibreHardwareMonitorLib version.
Since the package was never deployed for its original intent I may have slacked off in correcting that and making a new release.

snip3rnick commented 3 months ago

I retract my version question, you obviously had the most recent version with the test script. With minor modifications to the test script to include the sensor units in the print

+from HardwareMonitor.Util import SensorValueToString

@@ -42,8 +43,8 @@ for hardware in computer.Hardware:
     for subhardware  in hardware.SubHardware:
         print(f"\tSubhardware: {subhardware.Name}")
         for sensor in subhardware.Sensors:
-            print(f"\t\tSensor: {sensor.Name}, value: {sensor.Value}")
+            print(f"\t\tSensor: {sensor.Name}, value: {SensorValueToString(sensor.Value, sensor.SensorType)}")
     for sensor in hardware.Sensors:
-        print(f"\tSensor: {sensor.Name}, value: {sensor.Value}")
+        print(f"\tSensor: {sensor.Name}, value: {SensorValueToString(sensor.Value, sensor.SensorType)}")

When run in an admin-terminal I see the following

> py .\TestHardwareMonitor.py
Hardware: Intel Core i5-8265U
        Sensor: CPU Core #1 Thread #1, value: 19.6 %
        Sensor: CPU Core #1 Thread #2, value: 6.7 %
        Sensor: CPU Core #2 Thread #1, value: 8.9 %
        Sensor: CPU Core #2 Thread #2, value: 11.1 %
        Sensor: CPU Core #3 Thread #1, value: 26.7 %
        Sensor: CPU Core #3 Thread #2, value: 31.1 %
        Sensor: CPU Core #4 Thread #1, value: 10.9 %
        Sensor: CPU Core #4 Thread #2, value: 37.0 %
        Sensor: CPU Total, value: 19.0 %
        Sensor: CPU Core #1, value: 66.0 °C
        Sensor: CPU Core #2, value: 66.0 °C
        Sensor: CPU Core #3, value: 70.0 °C
        Sensor: CPU Core #4, value: 72.0 °C
        Sensor: CPU Package, value: 72.0 °C
        Sensor: CPU Core #1 Distance to TjMax, value: 34.0 °C
        Sensor: CPU Core #2 Distance to TjMax, value: 34.0 °C
        Sensor: CPU Core #3 Distance to TjMax, value: 30.0 °C
        Sensor: CPU Core #4 Distance to TjMax, value: 28.0 °C
        Sensor: Core Max, value: 72.0 °C
        Sensor: Core Average, value: 68.5 °C
        Sensor: CPU Core #1, value: 3600.0 MHz
        Sensor: CPU Core #2, value: 3600.0 MHz
        Sensor: CPU Core #3, value: 3500.0 MHz
        Sensor: CPU Core #4, value: 3400.0 MHz
        Sensor: CPU Package, value: 21.9 W
        Sensor: CPU Cores, value: 19.5 W
        Sensor: CPU Memory, value: 1.4 W
        Sensor: CPU Core, value: 1.053 V
        Sensor: CPU Core #1, value: 1.033 V
        Sensor: CPU Core #2, value: 1.007 V
        Sensor: CPU Core #3, value: 1.027 V
        Sensor: CPU Core #4, value: 0.999 V
        Sensor: Bus Speed, value: 100.0 MHz
...

For my platform the Wattages are displayed. Since you were able to read the power values using the GUI it should be available here as well.
Would it be possible to confirm that the script was indeed run as administrator and if the sensors are definitely not there. With the sensor type or unit not being printed in the test script I would have totally missed them in the output myself.

Thanks.