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 SCRIPT 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'

STEP 5: CREATE AN AUTOMATION

alias: pvoutput
description: ''
trigger:
  - platform: time_pattern
    minutes: /4
condition: []
action:
  - service: shell_command.pvoutputcurl
    data: {}
mode: single

The technical information to understand the command is explained here.

That’s all, hope it helps 🙂

7 Comments

  1. Marc

    Hello,
    I added you rule, little bit converted to my own entities; but nothing is happening at pvoutput.
    this is the code I have in the confuguration.yaml;

    shell_command:
    pvoutputcurl: ‘curl -d “d={{now().strftime(“%Y%m%d”)}}” -d “t={{now().strftime(“%H:%M”)}}” -d “v4={{states.sensor.power_output|round(0)}}” -H “X-Pvoutput-Apikey: 2….200” -H “X-Pvoutput-SystemId: 7…” https://pvoutput.org/service/r2/addstatus.jsp

    is there anything else I have to do? I’m having a account at pvoutput, and also api key and systemic is correct

    Like

    1. javier mugueta

      Yes, create an automation and execute the command every 5 minutes:
      alias: pvoutput
      description: ”
      trigger:
      – platform: time_pattern
      minutes: /5
      condition: []
      action:
      – service: shell_command.pvoutputcurl
      data: {}
      mode: single

      Like

  2. Sirox01

    I have it working but the voltage isn’t uploading.
    Is there a way to see the values with are trying to uploaded?

    shell_command:
    pvoutputcurl: ‘curl -d “d={{now().strftime(“%Y%m%d”)}}” -d “t={{now().strftime(“%H:%M”)}}” -d “v1={{states.sensor.tdg2a4303y_energy_today.state|float *1000}}” -d “v2={{states(‘tdg2a4303y_output_power’)|round(0)}}” “v6={{states(‘tdg2a4303y_reactive_voltage’)|round(0)}}” -H “X-Pvoutput-Apikey: 2d” -H “X-Pvoutput-SystemId: 85” https://pvoutput.org/service/r2/addstatus.jsp

    Like

    1. javier mugueta

      Go to Developer Tools|Templates and put your voltage template expression [{{states(‘tdg2a4303y_reactive_voltage’)|round(0)}}] in the editor and see if a value is displayed. I am curious about reactive_voltage, shouldn’t it be active_voltage? (reactive voltage is non zero mostly in industrial loads and the like I believe…)

      Like

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 )

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.