Heuhaufen: a GPU workload you can actually control from Home Assistant

I have a PC with an NVIDIA card that runs a long-term compute job around the clock. What bugged me was that Home Assistant could see the power meter in front of it, but had no idea what the machine was doing and no way to influence it. So I built the missing half: the job now announces itself over MQTT discovery and takes commands back.

No custom component, no HACS, no YAML for the entities — it is plain MQTT discovery, so the device shows up by itself.

What appears in Home Assistant (one device per graphics card):

  • Sensors — speed, temperature, fan, utilisation, VRAM used and VRAM used by other programs,

    power draw, state, last message, progress, estimated time left

  • Energy — kWh for the session as total_increasing, so it goes straight into the Energy Dashboard

  • Switch: Search — start and stop the workload

  • Switch: Auto pause — see below

  • Number: Power limit — a slider, from the card’s own minimum to its maximum (150–198 W on my

    5060 Ti). Changing it takes effect within a second, no restart

The last one is what makes this interesting beyond my own use case: it turns the machine into a dimmable load. I use it with PV surplus — plenty of sun, slider goes up; a cloud comes, slider goes down instead of shutting everything off. Anything that can set a number entity can do this, so a template automation on your surplus sensor is enough.

Auto pause is the other half. The card is also the one driving my monitors, so when another program needs it — a game, video editing, a local LLM — the job stops on its own and resumes afterwards. It watches VRAM used by other processes, and it can ask Ollama directly whether a model is computing right now, which is more reliable than guessing from memory use. Both are visible in HA and can be switched there.

There is a ready-made Lovelace card in the repo (homeassistant/heuhaufen-karte.yaml) with the gauges and switches from the screenshot; you only replace the entity prefix with your own.

The honest part: the actual workload is a hobby search for the key of one of the Bitcoin puzzle addresses from 2015 — a lottery with terrible odds that I run for the fun of building the machinery around it. If that is not your thing, the Home Assistant side is independent of it: what you get is a controllable, measurable GPU load with a proper energy sensor. It is Windows-only and needs an NVIDIA card, it is plain PowerShell (no installer, no service, no telemetry, nothing leaves your network), and it is MIT licensed.

Happy to answer questions about the MQTT side — the discovery payloads and the availability handling took a couple of iterations to get right, and I am still curious whether anyone finds a nicer way to model “this device is alive but deliberately paused” than I did.