Scripts for Tibber and Hegg to upload historic values and live data to PVOutput
Make sure to use node 16+ and run npm install before folowing instructions below.
Get your API token from https://developer.tibber.com/
Make sure .env file is present or environment variables are set:
PVOUTPUT_API_KEY=
TIBBER_API_TOKEN=
TIBBER_HOME_ID=
Comment or uncomment the values you want to upload at line 50 in tibber-live.js, default v2(export), v3(import), v4(power), and v7 ,v8 for tarrifs see https://forum.pvoutput.org/t/tariff-feeds/5798
node tibber-live.js. (Uploads every 5 minutes, reconnects automatically)Take note, that this data is partly incomplete due to Tibber only providing Kwh value which is often below 0.00 Kwh missing resolution
tibber-pvoutput-hourly.js scriptnode tibber-pvoutput-hourly.js.For historic data you can use manual bulk csv uploader in browser (https://pvoutput.org/load.jsp)
Run node tibber-pvoutput-historic.js to get the tibber_pvoutput_data.csv
Go to https://pvoutput.org/load.jsp, make sure the import settings match the csv 1: Output Date 2: Consumption 3: Exported optional: 4: Comments (profit)
Copy and past the csv rows (max 200). Hit the load button
hegg-data-csv.js scriptnode hegg-data-csv.js. Make sure HEGG_TOKEN is set as environment variable or present in .env or run with HEGG_TOKEN=<TOKEN HERE> node hegg-data-csv.jshegg-data.csvWarning: not tested due to my data being from +90 days ago
hegg-data-csv.js scriptnode hegg-pvoutput-hourly. Make sure PVOUTPUT_SYSTEM_ID and PVOUTPUT_API_KEY are set as environment variableFirst make sure the hegg-data.csv is filled with data from the dates you want
Choose either manual bulk csv upload in browser (https://pvoutput.org/load.jsp) or via batch upload (instructions below)
Run node hegg-pvoutput-historic.js. Make sure PVOUTPUT_SYSTEM_ID and PVOUTPUT_API_KEY are set as environment variable
Csv uploads are done in chunks of max. 200, they should export to hegg_pvoutput-<CHUNK_INDEX> progress is saved to progress.txt
Go to https://pvoutput.org/load.jsp, make sure the import settings match the csv 1: Output Date 2: Consumption 3: Exported optional: 5: Peak Power 6: Peak Time 4: Comments (total_cost)
Copy and past the csv rows. Hit the load button
Batch upload (Warning: not tested due to data +90 days ago)
UPLOAD_ENABLED to truenode hegg-pvoutput-historic.js. Make sure PVOUTPUT_SYSTEM_ID and PVOUTPUT_API_KEY are set as environment variable