Howto: GoodWe via Home Assistant to PV output

I setup my GoodWe inverter yesterday and setup an upload stream to PV output via my local Home Assistant server.

Connect GoodWe to Home Assistant
Setup GoodWe inverter on home Wifi Network
Look for inverter IP in DHCP router
In Home Assistant, use the GoodWe integration and fill in the IP
36 new instances will be setup for the inverter/device, one of them is; sensor.pv_power.

Prepare PV output
Make a system setup
Enable API access
Copy the API key
Copy the system id

Setup upload script
In configuration.yaml include
pvoutputcurl: ‘curl -d “d={{now().strftime(”%Y%m%d")}}" -d “t={{now().strftime(”%H:%M")}}" -d “v2={{states.sensor.pv_power.state|round(0)}}” -d “v5={{states.sensor.inverter_temperature.state|round(0)}}” -d “v6={{states.sensor.pv_voltage.state|round(0)}}” -H “X-Pvoutput-Apikey: typeinyourapikeyhere” -H “X-Pvoutput-SystemId: typeinyoursystemidhere

Setup 5 minute upload
In your automations, setup a new automation, switch to the YAML format and copy:

alias: Upload PV output
description: ‘’

  • platform: time_pattern
    minutes: /5
    condition: []
  • service: shell_command.pvoutputcurl
    data: {}
    mode: single

Your setup may be a bit different, but these were the steps that worked for me.

Yes I adapt for my own setup… I added also the V1 & V3 infos since I can integrate them from an external device.

Thanks for this! I converted this to use rest_command instead of shell_command so that I could more easily store the api key etc in secrets.yaml.

I am not 100% sure I have mapped the right entities to the right API parameters yet, but the general idea is worth sharing:

  - id: 4f863af550147e9b3170
    alias: update pvoutput
      platform: time_pattern
      minutes: /5
      service: rest_command.update_pvoutput
      data: {}
    mode: single

    method: post
    content_type: "application/x-www-form-urlencoded"
      X-Pvoutput-Apikey: !secret pvoutput_api_key
      X-Pvoutput-SystemId: !secret pvoutput_system_id
    payload: >-
      d={{now().strftime("%Y%m%d")}}                                    {#- date -#}
      &t={{now().strftime("%H:%M")}}                                    {#- time -#}
      &c1=2                                                             {#- cumulative mode -#}
      &v1={{(states('sensor.inverter_pv_generation_today')|float * 1000)|round(0) }}
                                                                        {#- energy generation (Wh) -#}
      &v2={{states('sensor.inverter_active_power')|float|round(0)}}     {#- power generation (W) -#}
      &v3=                                                              {#- energy consumption (Wh) -#}
      &v4={{states('sensor.household_power_demand')|float|round(0)}}    {#- power consumption (W) -#}
      &v5={{states('sensor.home_weather_temperature')|float|round(1)}}  {#- ambient temperature -#}
      &v6={{states('sensor.inverter_phase_a_voltage')|float|round(1)}}  {#- voltage -#}


for some reason Home Assitant Visual studio code doesn’t accept the code into conif.yaml

Can you eloborate on that. I keep getting the “can not read a block mapping entry; a multiline key may not be an implicit key” error at the last line.

Am i missing something?