InfluxDB is an open source time series database optimized for high-write-volume. It's useful for recording metrics, sensor data, events, and performing analytics. It exposes an HTTP API for client interaction and is often used in combination with Grafana to visualize the data.
This add-on runs the InfluxDB v2.x build channel.
For InfluxDB v1.x build channel, remove this add-on and install https://github.com/hassio-addons/addon-influxdb
This add-on doesn't come from the commmunity store and needs to be added from a GitHub repository. Don't worry - the process isn't too hard!
- Within Home Assistant, navigate to Configuration > ** Add-ons, Backups & Supervisor**
- Click ADD-ON STORE > Menu (3 dot elipsis, top right) > Repositories
- Add the following Repository: https://github.com/Jays-Home-Assistant-Add-ons/repository
- Install the InfluxDB2 add-on
- After install, click Start
- Check the logs tab to see if everything went well.
- Navigate to the interface using
When running the web UI provided by this add-on for the first time, you'll need to setup an account. Navigate to the interface using the link above and create your first user
Note: If you're planning on pushing Home Assistant data into InfluxDB using the Home Assistant Intergration, then set your first bucket name to be home_asssistant
Refer to Integrating into Home Assistant later in this document
Note: Remember to restart the add-on when the configuration is changed.
Example add-on configuration:
reporting: true
ssl: true
certfile: fullchain.pem
keyfile: privkey.pem
envvars:
- name: INFLUXD_LOG_LEVEL
value: "info"
Note: This is just an example, don't copy and paste it! Create your own!
The log_level
option controls the level of log output by the addon and can
be changed to be more or less verbose, which might be useful when you are
dealing with an unknown issue. Possible values are:
trace
: Show every detail, like all called internal functions.debug
: Shows detailed debug information.info
: Normal (usually) interesting events.warning
: Exceptional occurrences that are not errors.error
: Runtime errors that do not require immediate action.fatal
: Something went terribly wrong. Add-on becomes unusable.
Please note that each level automatically includes log messages from a
more severe level, e.g., debug
also shows info
messages. By default,
the log_level
is set to info
, which is the recommended setting unless
you are troubleshooting.
The logging level set here doesn't change the logging level of InfluxDB. Use envvars for that.
This option allows you to disable the reporting of usage data to InfluxData.
Note: No data from user databases is ever transmitted!
Enables/Disables SSL (HTTPS) on the web interface.
Set it true
to enable it, false
otherwise.
Note: This does NOT activate SSL for InfluxDB, just the web interface
The certificate file to use for SSL.
Note: The file MUST be stored in /ssl/
, which is the default
The private key file to use for SSL.
Note: The file MUST be stored in /ssl/
, which is the default
This allows the setting of Environment Variables to control InfluxDB configuration as documented at:
https://docs.influxdata.com/influxdb/v2.1/reference/config-options
A common one might be to change the logging level of InfluxDB2. For example:
envvars:
- name: INFLUXD_LOG_LEVEL
value: "info"
Log levels include: debug, info, error
Note: Changing these options can possibly cause issues with you instance. USE AT YOUR OWN RISK!
These are case sensitive.
The name of the environment variable to set which must start with INFLUXDB_
The value of the environment variable to set, set the Influx documentation for full details. Values should always be entered as a string (even true/false values).
Adding this option to the add-on configuration allows you to disable
authentication on the Web Terminal by setting it to true
and leaving the
username and password empty.
Note: We STRONGLY suggest, not to use this, even if this add-on is only exposed to your internal network. USE AT YOUR OWN RISK!
The influxdb
integration of Home Assistant makes it possible to transfer all
state changes to an InfluxDB database.
You need to do the following steps in order to get this working:
- Navigate to the InfluxDB2 UI using the link under the Installation section of this document.
- On the left menu click on InfluxDB icon at the top.
- Navigate to Load Data > API Tokens > + Generate API Token >> Read/Write API Token
- Set the decription to Home Assistant InfluxDB Intergration API Token
- Select the home_assistant bucket for both Read & Write << IMPORTANT!!
- Click Save
- Click on the name of the newly created token
- Click Copy to Clipboard ->> This will be required in the yaml below
Now we need to get your organisation ID
- Looking at the URL in your browser, the organisation ID is the 16 digit text between the two slashs just to the right of the orgs text
- fc08dc2f07e50755 is the organization you'll need to use in the yaml configuration based on this URL: http://homeassistant.local:8086/orgs/fc08dc2f07e50755/load-data/tokens
Next, add the following snippet to your Home Assistant
configuration.yaml
file.
influxdb:
host: localhost
port: 8086
api_version: 2
max_retries: 3
default_measurement: state
token: _YOUR_TOKEN_GOES_HERE_
organization: _YOUR_ORG_ID_GOES_HERE_
bucket: home_assistant
ssl: false
veryify_ssl: false
If you have implimented SSL, you may need to make the following changes to the above configuration:
influxdb:
host: _CHANGE_TO_YOUR_CERTIFICATE_HOSTNAME_
ssl: true
veryify_ssl: true
Restart Home Assistant.
You should now see the data flowing into InfluxDB by visiting the web-interface and using the Data Explorer.
Full details of the Home Assistant integration can be found here:
https://www.home-assistant.io/components/influxdb/
- InfluxDB2 only supports x64 architecture
This repository keeps a change log using GitHub's releases functionality.
Releases are based on Semantic Versioning, and use the format
of MAJOR.MINOR.PATCH
. In a nutshell, the version will be incremented
based on the following:
MAJOR
: Incompatible or major changes.MINOR
: Backwards-compatible new features and enhancements.PATCH
: Backwards-compatible bugfixes and package updates.
Got questions?
You have several options to get them answered:
- Start a discussion On GitHub Here
- The Home Assistant Discord chat server for general Home Assistant discussions and questions.
- The Home Assistant [Community Forum][forum].
- Join the Reddit subreddit in /r/homeassistant
You could also open an issue here GitHub.
The original setup of this repository is by Jay Antoney
The original InfluxDB v1.x add-on that this was based on is by Franck Nijhof
For a full list of all authors and contributors, check the contributor's page.
MIT License
Copyright (c) 2022 Jay Antoney
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.