The setup page for InfluxDB Persistence does not seem clear. I have read multiple guides, including InfluxDB’s own setup guide for v2. No matter what settings I use or how I try to set up InfluxDBv2, I receive an “unauthorized access” in InfluxDB when attempting to save the persistence settings.
I have an existing organization in InfluxDBv2. What do I need to set up there so that OpenHab can actually use it?
You’ve not provided much details so about the only thing I can do is show the table saying how to set it up with the V1 stuff removed. Hopefully that will make it more clear.
This service can be configured in the UI under Settings → Other Services → InfluxDB Persistence Service or in the file services/influxdb.cfg. Attention: The file-based configuration overrides the UI configuration.
Property
Default
Required
Description
[What you should enter]
version
V1
No
InfluxDB database version V1 for 1.X and V2 for 2.x
I am trying to understand what specifically needs to be set up in InfluxDBv2 in order to have all the information necessary for that page. I have tried everything that seems right, and I just continually get “unauthorized access”; clearly something about my InfluxDBv2 setup is incomplete.
Did you already login to InfluxDB? You have to create an Organization - e.g. “private” and a user to administrate your InfluxDB.
After that, create a Bucket (e.g. “openHAB”). Set the retention policy to a reasonable value, e.g. “1 year”, which means InfluxDB will delete data older than one year.
Switch to “API tokens” and generate a token for openHAB - Custom API Token, read/write Access for bucket “openHAB”.
Copy the Token. Don’t use the “Copy to Clipboard” Button, it’s not functional (at least in Firefox)
Go to openHAB and setup the InfluxDB Persistence Addon.
Use the Token, not the password (there is no usable password in v2)
You don’t need to set a user name (but you could).
Of course you have to set the bucket to “openHAB” and the organization to “private” (if these are the correct values set by you in the first step).