This Python scripts grabs content of the REST API of a Kostal PIKO 7.0 and exports the data either to PostgreSQL, ClickHouse or InfluxDB v2).
- PostgreSQL: Import the
init.sqlinto your Database - ClickHouse: Create Database
pvwr - InfluxDB: Create Database
pvwr - Set environment variables with the relevant details
KOSTAL_USERNAMEKOSTAL_PASSWORDKOSTAL_HOST- For PostgreSQL:
DB_HOSTDB_PORTDB_NAMEDB_USERDB_PASSWORD
- For ClickHouse:
CLICKHOUSE_HOSTCLICKHOUSE_PORTCLICKHOUSE_USERCLICKHOUSE_PASSWORDCLICKHOUSE_DATABASE
- For InfluxDB (2.x):
INFLUXDB_ORGINFLUXDB_BUCKETINFLUXDB_URLINFLUXDB_TOKEN
- Run
python kostal-piko-dataexport.py--influx2 1(on, default) or--influx 0(off, optional)--postgres 1(on, optional) or--postgres 0(off, default)--clickhouse 1(on, optional) or--clickhouse 0(off, default)--interval {seconds}Scrape interval (default: 30)--oneshotScrape data, print to stdout and exit
There'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 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.
