This Python scripts grabs content of the REST API of a Kostal PIKO 7.0 and exports the data either to PostgreSQL Database, InfluxDB v1 or InfluxDB v2).
init.sql
into your Databasepv
)KOSTAL_USERNAME
KOSTAL_PASSWORD
KOSTAL_HOST
DB_HOST
DB_PORT
DB_NAME
DB_USER
DB_PASSWORD
INFLUXDB_HOST
INFLUXDB_PORT
INFLUXDB_NAME
INFLUXDB_USER
INFLUXDB_PASSWORD
INFLUXDB_ORG
INFLUXDB_BUCKET
INFLUXDB_URL
INFLUXDB_TOKEN
python kostal-piko-dataexport.py
--influx 1
(on, optional) or --influx 0
(off, optional)--influx2 1
(on, default) or --influx 0
(off, optional)--postgres 1
(on, optional) or --postgres 0
(off, default)--interval {seconds}
Scrape interval (default: 30)--oneshot
Scrape data, print to stdout and exitThere's also a Docker Image available on GitLab's project Container Registry.
By logging the data with this script it's easily possible to create a nice Grafana Dashboard to display some of the interesting data:
You can import the dashboard-postgresql.json for PostgreSQL, dashboard-influx.json for influxdb v1 or dashboard-influxdb2.json to use it in your Grafana instance.
This is just a quick-and-dirty script to grab to content of the REST-API of my Kostal Piko 7.0 Inverter. This might be usable on other Inverters aswell.