How to Integrate Grafana with Home Assistant in 2026

Navigate to:

This post covers how to get started with Home Assistant and Grafana, including setting up InfluxDB and Grafana with Docker, configuring InfluxDB to receive data from Home Assistant, and creating a Grafana dashboard to visualize your data. It provides a comprehensive guide for real-time monitoring and analysis of Home Assistant data.

In this tutorial, you’ll learn how to install and configure both InfluxDB and Grafana, and create a Grafana dashboard to visualize data from Home Assistant.

Want to know more about InfluxDB and Grafana before you get started?

Watch the webinar.

Definitions: Grafana, Home Assistant, InfluxDB

Home Assistant

Home Assistant is an open source home automation platform that enables control and monitoring of various devices using a web interface or mobile app. With support for diverse devices and protocols, it’s highly customizable, allowing users to integrate new devices and protocols through custom components.

Grafana

Grafana is a versatile open source analytics and monitoring platform that offers powerful data visualization capabilities. It supports various data sources, including popular databases, such as InfluxDB, Elasticsearch, Prometheus, MySQL, PostgreSQL, and more.

With its extensibility through plugins, Grafana allows users to easily incorporate new data sources for enhanced analytics and monitoring.

InfluxDB

InfluxDB is an open source time series database designed for storing and querying time series data. It supports a wide range of data types, including integers, floats, strings, booleans, and others. Additionally, InfluxDB provides the flexibility to incorporate new data types via plugins.

Home Assistant integrates with Grafana, an analytics and monitoring platform, to visualize and analyze data. This data can be collected and stored in InfluxDB, an open source time series database, which allows for efficient querying of timestamped data.

Together, these tools enable users to control and monitor their smart home devices through Home Assistant while visualizing and analyzing the data in real-time using Grafana and InfluxDB.

Prerequisites and versions

To follow this tutorial, you will need the following:

Step 1: Install InfluxDB 3 Core

Option A: Install via Docker

First, pull the InfluxDB 3 image using this command:

docker pull influxdb:3-core

Once the download is complete, run the InfluxDB container with the following command:

docker run -d\
	--name influxdb \
	–p 8086:8086 \
-v influxdb3_data:/var/lib/influxdb2 \
	-v influxdb3_config:/etc/influxdb2 \
-e DOCKER_INFLUXDB_INIT_MODE=setup \
     -e DOCKER_INFLUXDB_INIT_USERNAME=admin \
     -e DOCKER_INFLUXDB_INIT_PASSWORD=your_password \
     -e DOCKER_INFLUXDB_INIT_ORG=home_org \
     -e DOCKER_INFLUXDB_INIT_BUCKET=home_assistant \
     influxdb:3

This command starts InfluxDB on port 8086, configures an initial user, organization, and bucket, and stores data in Docker volumes so it survives container restarts.

Option B: Install Directly

First, you’ll need to install InfluxDB on your machine. You can find instructions for your specific operating system on the InfluxDB downloads page.

Step 2: Configure InfluxDB and Generate an API Token

After installing InfluxDB, you’ll need to configure it to accept data from Home Assistant. You can do this by creating a new InfluxDB database and user account.

Open your browser and navigate to http://localhost:8086.

If you used the environment variables in Step 1, you can log in with the username and password you specified. Otherwise, complete the initial setup process.

Next, generate an API Token by:

  • In the InfluxDB UI, click Load Data in the left sidebar
  • Click API Tokens
  • Click Generate API Token (All Access API Token)
  • Give it a description like “Home Assistant Token”
  • Grant Write permission to the home_assistant bucket
  • Click Generate

Lastly, copy and save the token, as you’ll need it for Home Assistant and Grafana configuration.

Step 3: Configure the InfluxDB integration in Home Assistant

Now, you’ll need to install the InfluxDB integration in Home Assistant. You can do this by navigating to the Home Assistant web interface, selecting Settings from the sidebar, and then selecting Integrations. From there, you can search for InfluxDB and follow the prompts to configure the integration. Next, open your Home Assistant configuration.yaml file and add the following influxdb configuration block:

 influxdb:
     api_version: 2
     ssl: false
     host: YOUR_INFLUXDB_IP
     port: 8086
     token: YOUR_API_TOKEN
     organization: home_org
     bucket: home_assistant
     tags:
       source: HomeAssistant
     tags_attributes:
       - friendly_name
     default_measurement: state
     exclude:
       entity_globs:
         - sensor.date*
         - sensor.time*
     include:
       domains:
         - sensor
         - binary_sensor
         - climate
         - light
         - switch

Then, restart Home Assistant to apply the changes.

For additional configuration options, see the Home Assistant InfluxDB integration documentation.

Verify Data is Flowing to InfluxDB

After restarting Home Assistant:

  • Return to the InfluxDB UI
  • Click the Data Explorer in the left sidebar
  • Select your home_assistant bucket
  • Within a few minutes, you should see measurements appearing

If you don’t see data, check the logs at Settings -> System -> Logs for connection errors.

Step 4: Install Grafana Using Docker

If you prefer to run Grafana in Docker rather than install it locally, follow these steps.

Install Docker

If you haven’t already, you’ll need to install Docker on your machine. You can find instructions for your specific OS on the Docker website.

Pull the Grafana Docker Image

Once Docker is installed, you can pull the Grafana Docker image by running the following command in your terminal:

docker pull grafana/grafana

This will download the latest version of the Grafana Docker image to your machine.

Run the Grafana Docker container

To start a new Grafana Docker container, run the following command in your terminal:

docker run -d -p 3000:3000 --name=grafana grafana/grafana

This will start a new container named grafana and map port 3000 on the container to port 3000 on your local machine.

Access the Grafana web interface

Once the container is running, you can access the Grafana web interface by navigating to http://localhost:3000 in your web browser.

Create a Grafana account and connect data sources

When you first access the Grafana web interface, you’ll be prompted to create a new user account. After creating your account, you can start configuring Grafana by adding a data source and creating dashboards, as described in the previous steps.

Configure Grafana

After installing Grafana, you’ll need to configure it to connect to the InfluxDB database. You can do this by following these steps:

Open the Grafana web interface by navigating to http://localhost:3000 in your web browser. Log in to Grafana using the default username admin and password admin.

  • Click on the Configuration icon in the sidebar and select Data Sources.
  • Click on the Add data source button and select InfluxDB. Enter the following information in the InfluxDB details section:
    • URL: http://localhost:8086
    • Query Language: SQL or InfluxQL
    • Database: homeassistant
    • User: homeassistant
    • Password: yourpassword
    • HTTP method: GET
  • Click on the Save & Test button to save the data source and test the connection to InfluxDB.
Create a Grafana dashboard

After configuring the InfluxDB data source in Grafana, you can create a new dashboard to visualize the Home Assistant data. To do this, follow these steps:

  • Click the Create icon in the sidebar, then select Dashboard.
  • Click on the Add new panel button and select Graph.
  • Click on Panel title.
  • In the Query tab, select the InfluxDB data source that you configured.
  • Enter your InfluxDB query in the Query editor. For example, you might enter a query like this to display the temperature from a temperature sensor:
SELECT mean("value") FROM "temperature" WHERE ("entity_id" = 'sensor.temperature') AND $timeFilter GROUP BY time($__interval)

This query selects the average temperature from the temperature measurement for the sensor.temperature entity in Home Assistant and groups the results by time interval.

Click on the Apply button to save the query and display the results.

Customize your panel as desired by selecting different visualization options, adding legends and annotations, etc.

Click on the Save icon in the toolbar to save the panel to your dashboard.

You can repeat these steps to add more panels to your dashboard, using different InfluxDB queries to display different data. Check InfluxDB’s Grafana documentation for more details.

Step 8: View Your Dashboard

After creating your Grafana dashboard, you can view it by navigating to http://localhost:3000/dashboards in your web browser and selecting the dashboard from the list. You should now see a visual representation of your Home Assistant data in Grafana!

Troubleshooting and FAQs

No data appears in InfluxDB after configuring Home Assistant

Check your Home Assistant logs (Settings > System > Logs). If the connection fails, you will see errors there. Ensure the token in configuration.yaml is correct and wrapped in quotes if it contains special characters.

Can I write to multiple InfluxDB databases or buckets from Home Assistant?

No. Home Assistant’s InfluxDB integration only supports writing to a single database or bucket. All your sensor data must be sent to a single location. If you need to separate data streams, you’ll need to use Home Assistant’s filtering options in configuration.yaml to exclude certain entities, or run multiple Home Assistant instances.

My Grafana can’t connect to InfluxDB even though both are running. What’s wrong?

This is often a Docker networking issue. If both services are running in Docker containers, they may not be able to reach each other via localhost.

Try using your host machine’s actual IP address (like 192.168.1.100:8086) instead of localhost:8086 in Grafana’s data source configuration. Also, verify that the port number matches; InfluxDB’s HTTP API uses port 8086 by default.

If you’re using Home Assistant add-ons, make sure you’re using the correct internal container names (like a0d7b954-influxdb:8086 instead of a0d7b954_influxdb:8086, note the hyphen vs underscore).

Can I use InfluxDB Cloud instead of running my own instance?

Yes. InfluxDB Cloud offers a fully-managed InfluxDB 3 service, and the setup is very similar. You’ll get a URL, organization, bucket, and API token from the InfluxDB Cloud console, then configure Home Assistant and Grafana to point at those cloud endpoints instead of a local instance.

This eliminates the need to manage Docker containers, backups, and updates yourself. However, you’ll need to consider data egress costs if you have high query volumes, and your Home Assistant data will be stored in the cloud rather than locally.

Can I migrate from InfluxDB 2.x to 3.x?

Yes, InfluxDB 3 maintains backward compatibility with the v2 write API. Your Home Assistant configuration will continue to work. For data migration, refer to the official InfluxDB migration documentation.

Next steps for Home Assistant and Grafana

Getting started with Home Assistant and Grafana requires installing InfluxDB and Grafana on your machine, configuring InfluxDB to accept data from Home Assistant, installing the InfluxDB integration in Home Assistant, configuring Grafana to connect to the InfluxDB database, and creating a Grafana dashboard to visualize your data. With these tools and techniques, you can easily monitor and analyze your Home Assistant data in real-time.