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
- Run
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
- Modify start + end date in
tibber-pvoutput-hourly.jsscript - Run
node 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.jsto get thetibber_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
loadbutton
- Get token from network request in browser (logged in)
- Modify start + end date in
hegg-data-csv.jsscript - Run
node hegg-data-csv.js. Make sure HEGG_TOKEN is set as environment variable or present in.envor run withHEGG_TOKEN=<TOKEN HERE> node hegg-data-csv.js - Check output in
hegg-data.csv
Warning: not tested due to my data being from +90 days ago
- Get token from network request in browser (logged in)
- Modify start + end date in
hegg-data-csv.jsscript - Run
node hegg-pvoutput-hourly. Make surePVOUTPUT_SYSTEM_IDandPVOUTPUT_API_KEYare set as environment variable
First 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 surePVOUTPUT_SYSTEM_IDandPVOUTPUT_API_KEYare set as environment variable -
Csv uploads are done in chunks of max. 200, they should export to
hegg_pvoutput-<CHUNK_INDEX>progress is saved toprogress.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
loadbutton
Batch upload (Warning: not tested due to data +90 days ago)
- Upload via batch (only donation and up to 90 days ago) then set
UPLOAD_ENABLEDtotrue - Run
node hegg-pvoutput-historic.js. Make surePVOUTPUT_SYSTEM_IDandPVOUTPUT_API_KEYare set as environment variable - Check if values are correctly added