Publishing solar production data to pvoutput.org from Home Assistant


PVOutput is a website in which you can share your solar production data. Home Assistant is an open source home automation solution that can be run in Raspberry Pi among other options.

Sharing photovoltaic (PV) production can help the community to learn, analyse and help make decisions regarding solar production plants investments, either residential or commercial.

In this post we are explaining how to automate data load in Home Assistnat

STEP 1: GET APIKEY FROM PVOUTPUT.ORG

Go to pvoutput.org, register yourself and obtain an apikey, grab the key for later use

STEP 2: REGISTER YOUR SOLAR PLANT

Click on [Add System] button and register your plant data, at he end you’ll have a System Id which is needed for loading data later on

STEP 3: GET VARIABLES THAT HOLD PRODUCTION DATA

Depending the inverter or smart meter you have, an integration for Home Assistant is needed. The integration provides you sensor variables that you can use in automations and the like.

In my particular case, for a GoodWe inverter, I’m using an integration provided by the HACS community, called GoodWe Inverter Solar Sensor (UDP – no cloud), this integration provides direct UDP communication with the inverter not needing a cloud account and, because the direct communication, the integration is much more better.

STEP 4: CONFIGURE SCRIP IN CONFIGURATION.YAML

Home Assistant has a “famous” configuration file in which you can set up a bunch of things, in this particular case we are setting a shell script that send data to pvoutput.org as follows:

shell_command:
  pvoutputcurl: 'curl -d "d={{now().strftime("%Y%m%d")}}" -d "t={{now().strftime("%H:%M")}}" -d "v2={{states.sensor.goodwe_ppv.state|round(0)}}"  -d "v4={{states.sensor.goodwe_house_consumption.state|round(0)}}" -d "v5={{states.sensor.goodwe_temperature.state|float}}" -d "v6={{states.sensor.goodwe_vgrid.state|round(0)}}" -H "X-Pvoutput-Apikey: 33f03........310a" -H "X-Pvoutput-SystemId: 8...7" https://pvoutput.org/service/r2/addstatus.jsp'

The technical information to understand the command is explained here.

That’s all, hope it helps 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.