How to connect JupyterLab/Data Detective to InfluxDB

I have installed the Jupyterlab add-on on Hassio (running on a NUC) and I am able to connect to the mysql db I use for the hass recorder, using the provided sample code from the documentation:

from detective.core import db_from_hass_config
db = db_from_hass_config()

But, I have setup this database to record only a few days. Additionally, almost all of my HASS data is going into an InfluxDB instance where I keep longterm data. I want to connect Jupyterlab to that InfluxDB, but can’t figure out how to do that. I tried the REST API url for it, but no joy.

Anybody a tip on how to connect the two?

Did you figure this out?

nope not yet. That is: I understand you can enter the correct info in a notebook to connect to it, but I have not done that yet. When I posted the question, I thought I had to configure JupyterLab to connect to the influx db, but since the notebooks are basically running python, one would have to programm the notebook to connect. At least thats how I understand it.

1 Like

I’m trying to do the same thing.

InfluxDB has a Python API, influxdb_client, that installs with pip. Unfortunately it’s not part of the JupyterLab add-on, so I did

!pip install influxdb_client`

from a Notebook. That in turn resulted in an error (excerpt):

unable to execute 'x86_64-linux-gnu-gcc': No such file or directory
ERROR: Failed building wheel for ciso8601

Apparently the build failed because of the lack of a compiler in the add-on.

Does anyone have a suggestion - preferable short of modifying the Dockerfile and creating a custom add-on?