A Home Assistant custom integration that exposes Bitcoin network metrics from mempool.space as sensors. Works with both the public API and self-hosted instances.
- 🚀 Recommended Fees: Real-time fee estimates (Fastest, Half Hour, Economy).
- ⛓️ Blockchain Stats: Monitor block height and difficulty adjustments.
- ⛏️ Mining Insights: Track network hashrate and miner rewards.
- 💰 BTC Price: Real-time Bitcoin price in multiple currencies.
All sensors appear under a single Mempool device.
Recommended Fees
- Fastest Fee: Next-block fee estimate (sat/vB)
- Half Hour Fee: ~30 min confirmation target (sat/vB)
- Hour Fee: ~60 min confirmation target (sat/vB)
- Economy Fee: Low-priority fee estimate (sat/vB)
- Minimum Fee: Minimum relay fee (sat/vB)
Blockchain & Mempool
- Block Height: Current blockchain tip height
- Mempool TX Count: Unconfirmed transaction count
- Mempool Size: Mempool virtual size (vB)
- Network Hashrate: Current network hashrate (EH/s)
- Network Difficulty: Current mining difficulty
Difficulty Adjustment
- Progress: % through current retarget epoch
- Estimate: % estimated next adjustment
- Remaining Blocks: Blocks until next retarget
Mining Reward Stats (Last 144 blocks)
- Total Miners Reward: Total revenue (BTC)
- Avg Block Fees: Average fees per block (BTC)
- Avg TX Fee: Average fee per transaction (sats)
BTC Price
- USD State: Current Bitcoin price in USD.
- Attributes: EUR, GBP, CAD, etc. Access via templates:
{{ state_attr('sensor.mempool_btc_price', 'eur') }}
You can use the sensors from this integration to calculate the maximum electricity price (per kWh) at which your miner breaks even. This template replaces hardcoded fee estimates, exchange rates, and block subsidy values with live data from the Mempool integration.
See the Mining Break-Even kWh Price Template for more details and the full configuration example.
- Open HACS in your Home Assistant instance.
- Go to Integrations → Custom repositories.
- Add this repository URL and select Integration as the category.
- Search for Mempool and install it.
- Restart Home Assistant.
- Copy the
custom_components/mempoolfolder into your Home Assistantconfig/custom_components/directory. - Restart Home Assistant.
- Go to Settings → Devices & Services → Add Integration.
- Search for Mempool.
- Enter your instance URL (leave the default
https://mempool.spacefor the public API, or enter your self-hosted URL). - Click Submit.
The public mempool.space API enforces rate limits, though exact thresholds are intentionally undisclosed. Exceeding limits returns HTTP 429 responses, and repeated violations may result in a ban.
This integration makes 8 API calls per polling cycle (default: every 5 minutes), which is conservative usage. If you experience 429 errors, consider:
- Self-hosting a mempool instance — self-hosted instances have no rate limits.
- Mempool Enterprise at mempool.space/enterprise for higher limits.
No authentication is required for public API access.
MIT
