Page 1 of 1

InfluxDB 2.4

Posted: Monday 22 August 2022 12:57
by jefft
Hi All,

Does anyone have domoticz working with InfluxDB v2.4? I've just created a new influxd server because of some issues with my old one and I went for the latest version, but I can't get it to connect.

The error in the dz log reports 'unauthorized access'. When I create a token for domoticz in Influx, all I can see is the descriptive name, no actual token value; what do I need to give domoticz for the 'token' value and where in Influx's UI or CLI do I find that?

Thanks!

Re: InfluxDB 2.4

Posted: Monday 22 August 2022 13:18
by waltervl
Just to be sure: You have enabled the Influx V2.0 API switch in the influx General settings page (Setup - More options - Data Push - InfluxDB)?
See wiki page https://www.domoticz.com/wiki/Influxdb
Available in Stable 2022.1

Re: InfluxDB 2.4

Posted: Monday 22 August 2022 13:38
by waltervl

Re: InfluxDB 2.4

Posted: Monday 22 August 2022 14:15
by jefft
Yes, v2 API enabled, I should have said that (though I didn't notice the input fields change, even when I cleared the cache and refreshed the page) and yes, I've read both those Influx articles; sadly I'm no wiser as a result!

I was expecting Influx to generate a token string, or to ask me to provide one, which I'd then give to domoticz. All that happens when I create a token in Influx v2.4 is that it takes the descriptive name and the list of permitted buckets, but no sign of a token string to give to the API client!

Does domoticz want the org and bucket hex IDs, or their names? Are hex IDs 0x123abc or just abc123?

However... tried to list organisations with the influx CLI to check the org ID and got 'unauthorised' there too. I think this problem might be a bit wider than just the API access. Something wrong with my influxdb.conf, I'll bet...

Re: InfluxDB 2.4

Posted: Monday 22 August 2022 15:33
by jefft
Okay, got it fixed :-)

Turns out that when the documentation says that the Influx UI will show you the token value just once at creation, what it really means is that it won't do that and in fact you can - and must - click on the token name to see it at any time after creation :roll:
Config file is not as the docs say, either, it's some .toml file pointing to a nasty file in /var; I guess Influxdata haven't updated all their documentation for the latest version.

Domoticz is fine with the org ID in hex, no '0x' prefix, and the token is just pasted in as raw text. Database can be the friendly name, no need for IDs there.