OperationPublished by Cipheron
Controlling a miner with solar surplus – Home Assistant and hass-miner
With Home Assistant and the hass-miner integration, the miner follows your solar system – full power when there is surplus, throttled under clouds, off at night. What you need and what the rule looks like.
Solar power that goes into the grid earns little. A miner can use it instead, if it follows the surplus. For that it needs a controller that knows the surplus.
What you need
- Home Assistant with the readings from your solar system: generation and household consumption, or the feed-in power directly.
- hass-miner, an open-source integration for Home Assistant. You install it via HACS by adding its GitHub repository there as a custom repository.
- A miner whose firmware accepts a power limit. hass-miner supports Antminer, Whatsminer and Avalon, among others, as well as the Braiins OS, Vnish and LuxOS firmwares. However, the integration only creates the power limit if the unit reports autotuning. According to its source code, these are Braiins OS, Vnish, LuxOS and newer Whatsminers with stock firmware, but not Antminers or Avalons with stock firmware.
What hass-miner provides
- Sensors: hashrate, power draw, temperatures, fan speed.
- A switch: mining on and off.
- A number: the power limit in watts.
- Services: restarting the unit.
With the switch and the power limit, any rule can be built.
The simplest rule: on and off
- Surplus above the miner's power for longer than ten minutes: switch on.
- Surplus below zero for longer than ten minutes: switch off.
This also works without a power limit, for example with an Antminer on stock firmware, but only uses hours with a lot of sun. The waiting time prevents the miner from switching at every cloud.
The better rule: following the surplus
The miner is given a power limit that is adjusted continuously:
Power limit = current surplus + current power of the miner − reserve
Four things make the rule fit for everyday use:
- Reserve. Leave a margin of 100 to 200 W so that short load peaks in the house do not come from the grid.
- Lower limit. Every firmware has a minimum power below which the unit does not hash stably. If the surplus is below it, you switch off.
- Control slowly. Change the limit every few minutes at most and only in steps. Every change makes the firmware retune, and during that time the unit hashes less.
- Priority. Decide what gets power first: household consumption, then the battery, then the miner, or the miner before the battery. Both make sense, it just has to be decided.
With heat reuse
If a hydro miner is connected to a buffer tank, a second condition is added: if the tank is full, the miner is throttled even if there is still surplus. Home Assistant reads the tank temperature via a separate sensor.
What pays off
The miner replaces the feed-in tariff with the mining revenue per kilowatt-hour. If the revenue is higher, every diverted kilowatt-hour earns the difference. But the unit has to pay for itself from fewer operating hours than in continuous operation. A cheap, older unit is often the better choice for this than the newest one.
Limits
- Winter: in the months with the greatest heat demand there is the least surplus.
- Controller failure: the miner keeps running with the last limit. Set up an automation that switches it off when the readings stop coming in.
- Warranty: third-party firmware can end the manufacturer's warranty.
- Dependency: hass-miner builds on the pyasic library. Its developers now list it as deprecated and point to its successor, asic-rs. Before you set things up, check whether the integration still supports your unit and your firmware.
Sources
- hass-miner: integration for Home Assistant, devices and features (GitHub)
- pyasic: supported miners and firmware
- pyasic: developers' notice on its replacement by asic-rs (GitHub)
- HACS: adding custom repositories
As of October 2026. We read which firmware accepts the power limit from the integration's source code and did not test it on every unit.