ICT – Domotics – Blog – [20220905] – Connecting Grafana to InfluxDB [V2]

Back to ICT – Domotics – Blog

Well, after closing the circle from nous and fibaro devices to InfluxDB [V2] (and creating several undocumented dashboards in InfluxDB), it became time to introduce Grafana to the domotics equation. So far, I had played a couple of times with Grafana without any success: I just couldn’t get InfluxDB data into Grafana.

To make a long story short: Today, again, I could not get Grafana to connect to InfluxDB using InfluxQL as query language. I could probably rant for about an hour about the epic shameless user-unfriendliness of the InfluxQL connection configuration (why is it even different from the Flux one?), but sometimes you just have to swallow defeat: I simply configured the Flux connection in a jiffie instead, and decided to work in Flux instead of InfluxQL. I don’t know either of them, so I decided to “just not care (TM)”…

The connection configuration with Flux is (as it should be) amazingly easy: You create (or reuse) a Token in InfluxDB (I created a dedicated Read-Only Token with access to all InfluxDB buckets), and you enter that Token in the Flux (connection) configuration (along with the Organization). No user name / password misery or HTTP trickery.

The Flux connection worked right away and reported (correctly) 6 buckets found from InfluxDB:

After about an hour of struggling with and studying Flux, I managed to come up with my first dashboard [taken from the domoticz bucket]:

I immediately like Flux:

So, as of today, Grafana is integrated into my domotics setup, and that setup is more or less complete now.

In the near future, I intend to use Grafana for showing a single or only a few dashboards providing full (highly aggregated) domotics overview, and InfluxDB for the detailed dashboards, for debugging and of course for hosting the (central) Time-Series Database.

Later in the evening, I managed to improve my Total Power dashboard in Grafana which resulted in:

I’m quite (well, really) happy with the ultimate result. Although I’m nowhere near to usefully compare InfluxDB to Grafana visualizations, my initial impression is that the (default) Grafana graphs look better and are easier to customize… So, having Grafana next to InfluxDB is (for me) worthwhile.