If you’re planning to set up InfluxDB running inside HA, so not on an external server like a NAS, you’re going to run into all sorts of problems arising from a combination of guides that either don’t apply or were correct when they were written but are no longer correct now, and mysterious failures and errors not covered in any writeup. This is a set of notes on the silly-walk that worked in August 2025. If it’s been more than a few months since the time in the topic heading then things may have changed again.
Anyway, assuming you’ve just installed InfluxDB you then need to take the following steps:
Settings | Add-ons | InfluxDB | Info | Open Web UI | [ Crown Icon ] | Create Database, Name = home_assistant, click OK. This will add a default retention policy “autogen” with Duration = infinite.
Users | Create User, Name = homeassistant, Password = somepassword. Note that these must be pure-alphabetical, no numbers, special characters, or squirrel noises. If you don’t do this then you’ll get a slew of 401 errors in the logs, see this thread.
By default this user won’t have access to anything so while you won’t get any error messages saying there’s a problem, nothing will work. To fix this, click on the HA user, then for the database home_assistant click on both Write and Read, for _internal click on Read, these will go from grey-on-grey to white-on-grey, click Apply Changes.
Edit configuration.yaml and add a new entry:
influxdb:
host: localhost
port: 8086
ssl: false
database: home_assistant
username: homeassistant
password: database1234
max_retries: 3
default_measurement: state
Note the ssl: false, this also appears to be needed to get rid of the 401 errors mentioned above.
Note also that various more recent instructions will tell you to use the v2 API, however this doesn’t use a username+password but a bucket and token name and no-one seems to know where to get this from when you’re running inside HA (if it’s on an external NAS it’s easy, you can specify it on creation). So the workaround is to use the v1 API as per this thread.
You may need to fully restart HA (so not just reload config but restart) to start using InfluxDB. To check that it’s working, Settings | Add-ons | InfluxDB | Open Web UI | [Backwards-Z Icon] | Schema, click on home_assistant, expand tags | entity_id, and you should see all the entities being recorded.
Finally, you should add a template sensor to let you keep an eye on the size of the database:
sensor:
- platform: influxdb
host: localhost
port: 8086
ssl: false
username: homeassistant
password: somepassword
scan_interval: 3600
queries:
- name: "InfluxDB Database Size"
unique_id: uniqueid__influxdb_database_size
value_template: "{{ (value | float(0) / 1024 / 1024) | round(1) }}"
group_function: sum
measurement: '"monitor"."shard"'
database: _internal
where: '"database"=''home_assistant'' AND time > now() - 5m'
field: diskBytes
unit_of_measurement: MB
See however the note in the next message, this may not be reliable, but the other options are a lot scarier.