Bitcoin
The Bitcoin integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] shows you details about the Bitcoin network, such as the current exchange rate, the network hash rate, and how busy the network has been over the last 24 hours. The data comes from the public blockchain.com API, so you do not need an account or an API key.
Configuration
To add the Bitcoin service to your Home Assistant instance, use this My button:
Manual configuration steps
If the above My button doesn’t work, you can also perform the following steps manually:
-
Browse to your Home Assistant instance.
-
In the bottom right corner, select the
Add Integration button. -
From the list, select Bitcoin.
-
Follow the instructions on screen to complete the setup.
To change the currency later, remove the integration and add it again with the new currency.
Supported functionality
The Bitcoin integration provides the following entities. All of them are created and filled from the same two API calls. If you only need a few, hide or disable the others in the entity settings.
Sensors
-
Exchange rate (1 BTC)
- Description: Price of 1 BTC in the currency you selected, based on the 15 minute average price.
-
Market price
- Description: Price of 1 BTC in USD.
-
Trade volume
- Description: BTC traded on major exchanges in the last 24 hours.
-
Trade volume
- Description: The same trade volume, expressed in USD.
-
Miners revenue
- Description: Coins earned by miners in the last 24 hours, in USD.
-
Miners revenue
- Description: The same revenue, expressed in BTC.
-
Mined
- Description: New BTC created in the last 24 hours.
-
Mined blocks
- Description: Number of blocks mined in the last 24 hours.
-
Block size
- Description: Combined size of the blocks mined in the last 24 hours, in bytes.
-
Difficulty
- Description: How hard it currently is to mine a block.
-
Time between blocks
- Description: Average number of minutes between blocks.
-
No. of transactions
- Description: Number of transactions confirmed in the last 24 hours.
-
Hash rate
- Description: Estimated computing power of the whole network, in PH/s.
-
Total fees
- Description: Transaction fees paid to miners in the last 24 hours, in BTC.
-
Total sent
- Description: Value of all transaction outputs in the last 24 hours, in BTC.
-
Estimated sent
- Description: Estimate of the same value with change outputs left out, in BTC.
-
Total
- Description: All BTC in circulation.
-
Total blocks
- Description: Number of blocks in the chain.
-
Next retarget
- Description: Block height at which the mining difficulty changes next.
-
Est. transaction volume
- Description: Estimated value moved in the last 24 hours, in USD.
-
Timestamp
- Description: When blockchain.com produced these numbers.
Two names are used twice. Trade volume and Miners revenue each exist once in BTC and once in USD, so one of each pair gets a _2 suffix in its entity ID. When you set Bitcoin up from the UI, sensor.trade_volume is the BTC one and sensor.trade_volume_2 the USD one, while sensor.miners_revenue is the USD one and sensor.miners_revenue_2 the BTC one. If your setup was imported from YAML, the sensors you already had keep their entity IDs, so a pair can be the other way round.
Data updates
The Bitcoin integration pollsData polling is the process of querying a device or service at regular intervals to check for updates or retrieve data. By defining a custom polling interval, you can control how frequently your system checks for new data, which can help optimize performance and reduce unnecessary network traffic. [Learn more] blockchain.com every 5 minutes. One poll refreshes every entity. This interval is not configurable.
Known limitations
Both Miners revenue sensors report 0, and Total fees reports a negative value. These numbers come straight from the blockchain.com statistics API, which currently returns them incorrectly.
The exchange rate is a 15 minute average price rather than a live price, so it lags the market slightly.
Troubleshooting
If no tip here resolves your issue, feel free to open a bug and make sure to include the debug logs.
Can’t set up the integration
Symptom: “Failed to connect”
When you try to add the integration, the form shows the message “Failed to connect”.
Description
Home Assistant asks blockchain.com which currencies it quotes before it shows you the form. If that request does not succeed, there is nothing to offer you in the currency list, so the setup stops.
Resolution
To resolve this issue, try the following steps:
- Make sure your Home Assistant instance can reach the internet.
- Open the currency ticker the integration uses in a browser to check that the service is up.
- Add the integration again.
A repair issue asks you to remove the YAML configuration
Symptom: “The Bitcoin YAML configuration is being removed”
After an upgrade, the repairs dashboard shows a Bitcoin issue.
Description
The integration is now set up from the UI. On restart, Home Assistant reads the currency from your existing YAML configuration and creates the integration for you.
Resolution
To resolve this issue, try the following steps:
- Remove the
bitcoinsensor platform from yourconfiguration.yamlThe configuration.yaml file is the main configuration file for Home Assistant. It lists the integrations to be loaded and their specific configurations. In some cases, the configuration needs to be edited manually directly in the configuration.yaml file. Most integrations can be configured in the UI. [Learn more] file. - Restart Home Assistant.
- If a second issue says the import did not succeed, it also says why:
- Home Assistant could not reach blockchain.com. Restart Home Assistant later to try again.
- The currency in your YAML file is not one that blockchain.com quotes. Correct it and restart, or remove the YAML and add the integration from the UI.
- You had the
bitcoinsensor platform listed more than once with different currencies. Bitcoin can only be set up once, so only the first currency was imported. Remove the YAML, then remove the integration and add it again with the currency you want.
Your existing sensors keep the entity IDs they already had, so dashboards and automations that use them keep working. If you used entity_namespace on the YAML platform, that prefix is not carried over, so sensor.wallet_exchange_rate_1_btc becomes sensor.exchange_rate_1_btc. You do get extra sensors: the YAML display_options setting is gone, because a config flow should not ask you to pick entities, so all 21 sensors are now created.
Removing the integration
This integration follows standard integration removal.
To remove an integration instance from Home Assistant
- Go to Settings > Devices & services and select the integration card.
- Next to the entry you want to remove, select the three dots
menu. Then, select Delete. - Depending on the integration, the entries are listed under one of the following headings:
- Devices
- Hubs
- Services
- Integration entries
- Depending on the integration, the entries are listed under one of the following headings:
- To confirm, select Delete.
- Home Assistant also deletes the devices and entities of the entry.
- If Home Assistant asks you to restart, restart Home Assistant.
- If Home Assistant asks whether to also delete the application credentials, select Remove or Keep.
- If you keep them, Home Assistant uses them automatically when you add the integration again.
- To delete them later, refer to Deleting application credentials.