InfluxDB


The influxdb component makes it possible to transfer all state changes to an external InfluxDB database. See the official installation documentation for how to set up an InfluxDB database, or if you’re using Hass.io, there is a community add-on available.

The influxdb database component runs parallel to the Home Assistant database. It does not replace it.

Configuration

The default InfluxDB configuration doesn’t enforce authentication. If you have installed InfluxDB on the same host where Home Assistant is running and haven’t made any configuration changes, add the following to your configuration.yaml file:

# Example configuration.yaml entry
influxdb:

You will still need to create a database named home_assistant via InfluxDB’s command line interface. For instructions on how to create a database check the InfluxDB documentation relevant to the version you have installed.

Configuration Variables

host

(string)(Optional)IP address of your database host, e.g., 192.168.1.10

Default value: localhost

port

(integer)(Optional)Port to use

Default value: 8086

username

(string)(Optional)The username of the database user. The user needs read/write privileges on the database

password

(string)(Optional)The password for the database user account.

database

(string)(Optional)Name of the database to use. The database must already exist.

Default value: home_assistant

ssl

(boolean)(Optional)Use https instead of http to connect.

Default value: false

verify_ssl

(boolean)(Optional)Verify SSL certificate for https request.

Default value: true

max_retries

(integer)(Optional)Set this to allow the component to retry if there was a network error when transmitting data.

Default value: 0

default_measurement

(string)(Optional)Measurement name to use when an entity doesn’t have a unit.

Default value: uses the entity id of the entity

override_measurement

(string)(Optional)Measurement name to use instead of unit or default measurement. This will store all data points in a single measurement.

exclude

(list)(Optional)Configure which components should be excluded from recording to InfluxDB.

entities

(list)(Optional)The list of entity ids to be excluded from recording to InfluxDB.

domains

(list)(Optional)The list of domains to be excluded from recording to InfluxDB.

include

(list)(Optional)Configure which components should be included in recordings to InfluxDB. If set, all other entities will not be recorded to InfluxDB. Values set by the exclude lists will take precedence.

entities

(string | list)(Optional)The list of entity ids to be included in recording to InfluxDB.

domains

(string | list)(Optional)The list of domains to be included in recording to InfluxDB.

tags

(string | list)Tags to mark the data.

Default value: 0

tags_attributes

(string | list)(Optional)The list of attribute names which should be reported as tags and not fields to InfluxDB. For example, if set to friendly_name, it will be possible to group by entities’ friendly names as well, in addition to their ids.

Default value: 0

component_config

(string)(Optional)This attribute contains component-specific override values. See Customizing devices and services for format.

override_measurement

(string)(Optional)Measurement name to use instead of unit or default measurement. This will store all data points in a single measurement.

component_config_domain

(string)(Optional)This attribute contains domain-specific component override values. See Customizing devices and services for format.

override_measurement

(string)(Optional)Measurement name to use instead of unit or default measurement. This will store all data points in a single measurement.

component_config_glob

(string)(Optional)This attribute contains component-specific override values. See Customizing devices and services for format.

override_measurement

(string)(Optional)Measurement name to use instead of unit or default measurement. This will store all data points in a single measurement.

Examples

Full configuration

influxdb:
  host: 192.168.1.190
  port: 20000
  database: DB_TO_STORE_EVENTS
  username: MY_USERNAME
  password: MY_PASSWORD
  ssl: true
  verify_ssl: true
  max_retries: 3
  default_measurement: state
  exclude:
    entities:
       - entity.id1
       - entity.id2
    domains:
       - automation
  include:
    entities:
       - entity.id3
       - entity.id4
  tags:
    instance: prod
    source: hass