Hi
I’m setting up a routine which is writing data from an external source into the influx db on my raspberry with an python script.
Therefore i use the pandas module to import the external data source and then work with the dateframe afterwards. In order to write the dataframe into the influxdb I try to use the influxdb client which isn’t installed on the setup I guess. How can I acces to the influxdb client in order that the script as follow can write the data into the DB? Thx for your help!
Blockquote
import sys
import pandas as pd
import re
from Influxdb import InfluxDBClient
client = InfluxDBClient(host=‘localhost’, port=8086, username=‘admin’, password=’’)
df = pd.read_csv(’/etc/openhab2/scripts/grafiek’+room+’.dat’,
header=None,
skiprows = 1,
encoding=‘ISO-8859-1’,
names=[‘datum’,‘Lufttemperatur’,‘Feuchtigkeit Temperatur’,‘Kompost temp1’,‘Kompost temp2’,'Kompost tem$
df1 = df.iloc[:,[0,1,6,7,10,14,16,17,18,20,21,24,49,50]]
df1[df.duplicated(keep=False)]
db = Gicompar++room++
timeValues.index = df[ [‘datum’] ]
tags = {‘Lufttemperatur’: df[[‘Lufttemperatur’]], ‘Zuluft Temperatur’: df[[‘Zuluft Temperatur’]], ‘CO2’:df[[‘CO2’]]}
client.switch_database(‘db’)
client.write_points(db, tbName, timeValues, tags = tags)
- Platform information:
- Hardware:Raspberry 4
- OS: Openhabian
- Java Runtime Environment: which java platform is used and what version
- openHAB version: Openhab 2.5