InfluxDB v1 Home Assistant Add-on

repository·main·Indexed 41 days ago

https://github.com/hassio-addons/addon-influxdb

A time series database add-on for Home Assistant providing InfluxDB 1.x, Chronograf for administration, and Kapacitor for analytics. Optimized for high-write-volume metrics and sensor data using the InfluxQL query language and 1.x HTTP API.

Tokens
1.2K
Snippets
2
Records
7
Agent score
3%

What's inside InfluxDB

  1. Overview of InfluxDB v1 Add-on

    main

    This add-on provides InfluxDB 1.x, a time series database optimized for high-write-volume metrics, sensor data, and events. It uses the InfluxQL query language and the 1.x HTTP API.

    Key features included in this add-on:

    • InfluxDB 1.x core: The database engine using the classic database, user, and retention policy model.
    • Chronograf: An admin interface for managing users, databases, and retention settings, and for exploring data via the Data Explorer.
    • Kapacitor: A streaming analytics and alerting engine.

    Note: This is specifically the 1.x series. It is not InfluxDB 2 or 3, which use different APIs and data models.

  2. Integrate InfluxDB v1 with Home Assistant

    main

    To send Home Assistant state changes to InfluxDB, follow these steps:

    1. Prepare InfluxDB

    1. Click OPEN WEB UI in the add-on.
    2. In the left menu, select InfluxDB Admin.
    3. Create a database (e.g., homeassistant).
    4. Go to the Users tab and create a user (e.g., homeassistant).
    5. Grant the user ALL permissions to allow writing to the database.

    2. Configure Home Assistant

    Add the following to your configuration.yaml file. Replace <yourpassword> with the password created in the step above.

    Note: Ensure api_version is set to 1.

    influxdb:
      api_version: 1
      host: a0d7b954-influxdb
      port: 8086
      database: homeassistant
      username: homeassistant
      password: <yourpassword>
      max_retries: 3
      default_measurement: state
  3. Backup and restore InfluxDB v1

    main

    Full Add-on Backup

    Because all databases, Chronograf settings, and Kapacitor data are stored in the add-on's data directory, a standard Home Assistant backup includes everything.

    Database-level Backup/Restore

    To perform database-level operations from another machine:

    1. Ensure port 8088/tcp is enabled in the add-on network settings.
    2. Use the influxd backup and influxd restore tools.
    3. You can also use the influx CLI to import/export data via the /share folder, which is accessible inside the add-on.
  4. Install the InfluxDB v1 Add-on

    main

    To install the InfluxDB v1 add-on in Home Assistant:

    1. Open the add-on via the Home Assistant My button.
    2. Click the Install button.
    3. Start the "InfluxDB v1" app.
    4. Check the add-on logs to verify a successful startup.
    5. Click OPEN WEB UI to access the Chronograf admin interface.
  5. Configure InfluxDB v1 add-on options

    main

    The add-on can be configured via the Home Assistant add-on configuration UI. Note: You must restart the add-on after changing any configuration.

    Available Options

    OptionDescription
    log_levelControls verbosity. Options: trace, debug, info (default), warning, error, fatal.
    authEnables/disables InfluxDB user authentication. (Not recommended to disable).
    reportingEnables/disables anonymous usage data reporting to InfluxData. (Disabled by default).
    sslEnables/disables SSL (HTTPS) for the Chronograf web interface on port 80. Does NOT affect the InfluxDB API on port 8086.
    certfileThe certificate file for SSL. Must be stored in /ssl/.
    keyfileThe private key file for SSL. Must be stored in /ssl/.
    envvarsA list of environment variables to control InfluxDB configuration. Use this to set variables starting with INFLUXDB_.
    leave_front_door_openIf true, disables Home Assistant authentication on the Chronograf web interface (port 80). Use with extreme caution.
  6. Set InfluxDB configuration via envvars

    main

    You can use the envvars option to pass configuration to InfluxDB using environment variables. Each entry requires a name (must start with INFLUXDB_) and a value (must be a string).

    Example: Enabling the InfluxDB UDP listener on port 8089:

    envvars:
      - name: INFLUXDB_UDP_0_ENABLED
        value: "true"
      - name: INFLUXDB_UDP_0_BIND_ADDRESS
        value: ":8089"
      - name: INFLUXDB_UDP_0_DATABASE
        value: "udp"
  7. Reference InfluxDB v1 network ports

    main

    The following ports are exposed by the add-on:

    • 8086/tcp: InfluxDB HTTP API (used by Home Assistant, Grafana, etc.).
    • 8088/tcp: InfluxDB RPC service (used for influxd backup and influxd restore).
    • 8089/udp: InfluxDB UDP listener (disabled by default; enable via envvars).
    • 9092/tcp: Kapacitor HTTP API (for managing Kapacitor tasks externally). Warning: Kapacitor has no authentication; only expose this on a trusted network.