Skip to content

Repository files navigation

Home Assistant CPU Capacity Integration

Custom integration that samples per-CPU load/frequency, computes rolling averages (1m/5m/15m), and exposes sensors directly in Home Assistant.

Features

  • Internal sampling loop (default 0.5s)
  • Home Assistant entity updates at a slower interval (default 15s)
  • Per-CPU sensors for:
    • MHz averages (1m/5m/15m)
    • Load % averages (1m/5m/15m)
    • Capacity-Adjusted Load % averages (1m/5m/15m)
    • Max MHz
    • EPP
    • EPB

Capacity-Adjusted Load % formula:

load_pct * (current_mhz / max_mhz)

Install

  1. Copy custom_components/cpu_capacity into your Home Assistant config/custom_components.
  2. Restart Home Assistant.
  3. Add integration: Settings -> Devices & Services -> Add Integration -> CPU Capacity.

Notes

  • The integration reads only from /proc and /sys/devices/system/cpu/*.
  • If some CPUs do not expose max MHz, capacity-adjusted sensors for those CPUs are omitted.

Development

Commits must follow the Conventional Commits spec — release-please uses commit prefixes (feat:, fix:, etc.) to drive version bumps.

After cloning, install the hooks including the commit-msg hook (the default prek install only wires up pre-commit-stage hooks):

uvx prek install --overwrite --hook-type pre-commit --hook-type commit-msg

Without --hook-type commit-msg, malformed commit messages won't be caught locally — CI (Commitlint workflow) will still reject them.

About

Home Assistant integration that samples per-CPU load/frequency, computes rolling averages (1m/5m/15m), and exposes sensors directly in Home Assistant.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Contributors

Languages