Using flux queries in influxdb.sensor?
ruant opened this issue · 2 comments
Problem/Motivation
I'm using this addon to run influxdb, and my flux queries work fine in the UI.
But i'm having troubles with how to set up the influxdb sensor to get data back into HA using Flux queries.
As soon as you you use the queries_flux:
it's asking for: bucket
, token
and organization
I can't find anything in the docs here how to find this or set up tokens etc.?
Anyone have any idea how to solve this? If it's solvable at all?
Answered on Discord, the addon runs 1.x, not 2.x, the HA documentation would help you here.
Just a follow up from me here.
Looks like the HA sensor for InfluxDB doesn't take into account that InfluxDB v1.8 supports both query languages (influxQL and Flux). So even tho Flux queries work fine in 1.8 you won't be able to use the influxdb.sensor to do Flux queries because of dependencies on what fields are mandatory etc. when using the queries_flux
field.
It actually don't have any thing to do with this addon at all, but the InfluxDB sensor integration in HA.
How I solved this was with node-red which has 1.8-flux as an option when selecting what version of influx you're running.
This then allows you to run flux queries.