I Built a Python Hardware Monitor That Reveals Your Laptop's Real Health

My laptop battery is lying to me. Windows says it's at 100% — but I ran a quick Python script and found out it's actually at 74% of its original design capacity after 8 years. Worse, my CPU is hitting 83°C at just 20% load. These aren't edge case problems. Windows just hides this stuff from you.

So I built a hardware monitoring tool that pulls the real numbers — the kind your manufacturer doesn't want you obsessing over.

What the Tool Actually Reads

This isn't just a psutil wrapper. The tool goes deeper:

  • Battery wear level — real design capacity vs. current full charge capacity via WMI
  • CPU per-core temperatures — not the average, each core individually
  • GPU temperature — via nvidia-smi for NVIDIA cards
  • SSD health / wear indicator — drive health percentage
  • RAM usage + swap — so you know if you're thrashing

Battery Wear Detection (via WMI)

import wmi

def get_battery_health():
    c = wmi.WMI(namespace="root\WMI")
    batteries = c.BatteryFullChargedCapacity()
    static = c.BatteryStaticData()
    
    if not batteries or not static:
        return None
    
    design_capacity = static[0].DesignedCapacity
    full_charge = batteries[0].FullChargedCapacity
    wear_pct = (full_charge / design_capacity) * 100
    
    return {
        "design_mwh": design_capacity,
        "current_mwh": full_charge,
        "health_pct": round(wear_pct, 1)
    }

Running this on my Lenovo after 8 years: design 56,000 mWh -> current 41,500 mWh = 74.1% health. Not dead, but it explains why my laptop dies in 3 hours instead of 5.


GPU Temperature (via nvidia-smi)

import subprocess

def get_gpu_temp():
    try:
        result = subprocess.run(
            ["nvidia-smi", "--query-gpu=temperature.gpu,utilization.gpu,name",
             "--format=csv,noheader,nounits"],
            capture_output=True, text=True, timeout=5
        )
        if result.returncode == 0:
            parts = result.stdout.strip().split(", ")
            return {
                "temp_c": int(parts[0]),
                "utilization_pct": int(parts[1]),
                "name": parts[2]
            }
    except (FileNotFoundError, subprocess.TimeoutExpired):
        return None

My RTX 3060 was sitting at 67 degrees C at idle. That was the moment I realized I needed to clean the fans.


CPU Per-Core Temps

import psutil

def get_cpu_temps():
    temps = psutil.sensors_temperatures()
    # On Windows, use OpenHardwareMonitor or LibreHardwareMonitor
    # On Linux: temps.get("coretemp") or temps.get("k10temp")
    return temps

On Windows, psutil alone won't give CPU temps — you need LibreHardwareMonitor running as a service, then query it. The full tool handles this automatically.


What I Found On My Own Machine

MetricValueStatus
Battery health74.1%Degraded (expected at 8yr)
CPU temp at 20% load83CHigh — thermal paste due
GPU temp idle67CAcceptable, needs cleaning
SSD health96%Good
RAM usage61% at idleAcceptable

The CPU temp number is what got me. 83C at 20% load means when I actually push it, I'm hitting thermal throttle territory. Windows Task Manager told me nothing.


The Tool Is Available

I packaged this up as a standalone Windows script with a clean terminal dashboard. It runs at startup, logs to SQLite, and Telegram-alerts you if anything spikes.

Grab it on Gumroad for $5: https://milkyway801.gumroad.com/l/ekpeqp

It's a single Python file + a config JSON. No installer, no telemetry, no nonsense.


Why HIVE?

I post here because I actually want feedback. If you've built something similar, or if you know a better way to read CPU temps on Windows without LHM overhead, drop it in the comments. The battery WMI method especially — I've seen some implementations that pull from different namespaces and get different numbers.


Built by Milton Rojas — SE Texas. I build systems the way a mechanic fixes cars: practically, with whatever's on hand.



0
0
0.000
0 comments