I am running into a strange problem I don’t undertstand, so I am sure there are people here who are way more skilled than me and can point me to the right solution;-)
Now, I have two instances of Homeassistant, each one populating a different bucket (homeassistant_db and homeassistant2_db). With homeassistant_db everything works fine, I can connect to Grafana and can select all fields.
On homeassistant2_db on the other hand, I can connect the datasource in Grafana, which reports “Datasource connected” but then states “0 measurements”. When checking homeassistant2_db via the Influx Data Explorer, the Data is there. So obviously, Homeassistant is writing the data to the DB in the correct way, but for whatever reason, Grafana cannot read these fields.
I am using Grafana 10.4.1. Connection is made using Username & PW (same User and PW that works for homeassistant_db and should have the same rights to homeassistant2_db), hope I understood this question correct?.
I’d like to use InfluxQL, but as Grafana states that there a 2 measures, so I am not at this point.
The choice between InfluxQL and Flux changes the way Grafana connects to InfluxDB v2. Flux uses the /api/v2/ endpoint which requires a token to authenticate and won’t work with a username/password. With InfluxQL, there a few different ways to authenticate (basic auth, token, user/pass query params).
Edit: InfluxQL also requires you to map database and retention policy combinations to a v2 bucket. If you migrated from v1 to v2 using the automated migration process, these were added for you. But for your new bucket, you’d have to create the mappings manually:
Scott, mind reading my first post, second paragraph, please?
All you wrote has been set up already. V1 Access and DBRP Mapping has been done and Influx responded with no errors.
homeassistant_db and homeassistant2_db have both been created AFTER the migration (migrated ones carry a "/autogen in their names). One works, the the other doesn’t, makes no sense to me.
Connection can be established, but Grafana can’t see ANY fields in the DB
If you have the v2 influx CLI install, can you return the output of the following commands (just as a sanity check):
influx v1 dbrp list
and
influx v1 auth list
Also–I’m sure it is, but just asking–is your homeassistant2_db connection configuration identical to your homeassistant_db configuration other than the database name?
Despite the fact, that the commands for enabling V1 authentication and retention policy returned ok, I was never able to see homeassistant2_db in the auth list.
My guess would be, I messed up something with the rights for the DB itself, but not sure how to check this.
Note: I Replaced my real OrgID with MYORGID, which was the same on all outputs.
For whatever reason, I am not able to create the new user of Option 1. The command returns “-org missing”, but it won’t accept any variation of “-o”, “-org” as well as the org name in lower keys or capitals. I don’t know what I am doing wrong…
Finally, it works. I don’t know what the problem was, but creating a new user homeassistant2, like in your first example, only worked on my PC. On a Mac, it always complained about an invalid Organisation. Maybe something weird with copy & paste into the terminal, I don’t know but I don’t care now
Needed to add two lines for authentication and the ORG though: