glances icon indicating copy to clipboard operation
glances copied to clipboard

Plugin for librehardwaremonitor integration to get glances to monitor temperatures on windows

Open ghost opened this issue 4 months ago • 7 comments

*** If I mess up the message I apologize for my bad english *** I'm also sorry for any out of protocol event that may happen, it's my first time posting an issue on github I'm really excited about this, and hope this ends up being considered a contribution

I needed to monitor some things on my small and humble server running windows 10 Temperatures are not read in windows for glances, so I started looking for a workaround

Glances doesn't read temperatures on windows

I already managed for it to happen, I'm here to share what I got to work Programming or coding really isn't my thing, but I gave it a try, and with help of course IA, I got it working

The solution is a modification on index.html located in C:\PythonXXX\Lib\site-packages\glances\outputs\static\template

And the creation of a script in C:\Python31\Lib\site-packages\glances\outputs\static\public\

Temps in widget bottom left corner

Image

ghost avatar Aug 16 '25 03:08 ghost

custom-lhm.js index.html I leave the files here

I'm still trying to get to run librehardwaremonitore some other way than the .exe per se But I know anyone who reads these is way more capable that I to get this fully integrated with glances installation

ghost avatar Aug 16 '25 03:08 ghost

This issue is available for anyone to work on. Make sure to reference this issue in your pull request. :sparkles: Thank you for your contribution ! :sparkles:

github-actions[bot] avatar Aug 16 '25 08:08 github-actions[bot]

Hi @beccaceceignacio-cell and thank you for your first enhancement request !

Concerning your proposal, it's interesting but several points should be taken into account.

  1. The WebUI is "auto-generated" (read https://github.com/nicolargo/glances/blob/develop/glances/outputs/static/README.md), change should be done on Python Script (to grab stats) and VueJS templates (to display stats, not directly in the JS/HTML code.

  2. A Sensors plugin already exist, it should be used instead of creating a new plug plugin. The software architecture of the existing Sensors plugin (https://github.com/nicolargo/glances/tree/develop/glances/plugins/sensors) is designed to add new functionalities. It means that if the change is done correctly in this plugin there is nothing to do regarding display in TUI and WEBUI display.

  3. A Python lib i available to grab stats from the LibreHardwareMonitor API: https://pypi.org/project/librehardwaremonitor-api/. This lib should be used in Sensors plugin.

===

Question for others Windows users: Is this feature interesting for your use case of Glances in Windows environment ? If yes, please vote for this feature !

nicolargo avatar Aug 16 '25 08:08 nicolargo

Would definitely appreciate this on Windows :)

mlindgren avatar Sep 10 '25 04:09 mlindgren

Same user that created the issue, but with my old account. None of them have any contributions, but this one I like better. (and deleted the other one)

I managed to read temps from librehardware dll, but I don't know how to make this count for the issue. I'll leave the script here The script "temps.py" reads the temps from librehardwarelib.dll and dumps a temps.json to the static folder of glances. This vaules can be picked up by glances with another script set in \public\ folder and index has to be properly set in \template\

custom-lhm.js

temps.py

My humble and gitbuh methodless contributions (if they can be called as such)

nachobkcc avatar Sep 12 '25 15:09 nachobkcc

Description

On Windows, Glances currently does not display hardware temperatures (CPU, GPU, motherboard, etc.).

I needed to monitor them on my small Windows 10 server, so I experimented with an integration using the LibreHardwareMonitor library. Instead of running the LibreHardwareMonitor.exe, I used its native DLL directly from Python (via pythonnet). This way Glances can query temperature sensors natively.

Proposed solution

  • Integrate LibreHardwareMonitorLib.dll into Glances as an optional backend for Windows.
  • Use pythonnet (import clr) to access the DLL classes.
  • Expose sensor data (CPU, GPU, Motherboard temps, etc.) in the same format as Glances expects for its sensors.
  • No external processes required, everything runs in Python.

Implementation details

  • Added a small Python module that loads LibreHardwareMonitorLib.dll.
  • Collects sensor values directly from the Computer object (CPU, GPU, Mainboard).
  • Values are parsed into a dictionary and exposed via the Glances API.
  • Verified integration with Glances web UI (custom JS shows CPU: 38°C · MB: 50°C · GPU: 35°C).

Results

Now Glances on Windows shows: CPU: 31°C · MB: 27°C · Chipset: 50°C · GPU: 34°C via the web UI at http://localhost:61208.

Advantages

  • Native integration, no need to spawn an external process.
  • Lightweight and efficient.
  • Reusable for other sensor types supported by LibreHardwareMonitor.

Next steps

  • Discuss if maintainers are interested in merging this feature.
  • Define how to package/distribute LibreHardwareMonitorLib.dll (bundle or require user to provide it).
  • Extend beyond temperatures (fans, voltages, clocks).

Environment

  • Windows 10
  • Python 3.13.7
  • Glances 4.3.3
  • LibreHardwareMonitor v0.9.4

This is how it looks now.

Image

nachobkcc avatar Sep 13 '25 01:09 nachobkcc

Request for Help

I would like to contribute to Glances by adding support for hardware sensor readings on Windows using LibreHardwareMonitor.

So far, I have been able to [briefly explain what you did, e.g., test the Python wrapper / call the DLL / get some metrics].
However, I am not sure how to properly integrate this into Glances as a plugin.

I am willing to learn the proper method and follow the guidelines.
Could someone point me in the right direction, or provide an example of how similar plugins are structured?

Goal

  • Add CPU/GPU temperatures and fan speeds from LibreHardwareMonitor on Windows.
  • Keep the integration optional (fallback to psutil if LibreHardwareMonitor is not available).

Thanks in advance for any guidance!

nachobkcc avatar Oct 03 '25 13:10 nachobkcc