Integration with the Fronius inverter

Attention! The example uses the second generation Gate HTTP module with FW 1.1.0-2034C!


The following instructions show you how to integrate with the Fronius Symo 8.2-3-M inverter via the Fronius Solar API (JSON). The manual was prepared based on information available on the website: Fronius Solar API

After connecting the inverter to the local network, remember its IP address. The inverter changes its IP address cyclically, so remember to update the IP address or assign a permanent IP address to the inverter (in the router).


The example will read data regarding:

  • generated instantaneous power;
  • total energy generated during the day, year and since the beginning of the installation's operation.



If you want to integrate with the inverter, follow the steps described below:

1. In the user features of the Gate Http module called GateHttp, we create the following features:

* total_energy - energy produced since the beginning of the installation (in kWh);
* year_energy - energy produced over the last year (in kWh);
* day_energy - energy produced today (in kWh);
* current_energy - energy produced at the moment of reading (in Wh);

2. Then we create a HttpRequest virtual object called fronius_info:

3. The fronius_info virtual object settings are as follows:

Where:
Host: IP address of the inverter
Path: /solar_api/v1/GetInverterRealtimeData.cgi
QueryStringParams: Scope=System
ResponseType: JSON

Setting the QueryStringParams feature in this way will cause the information read to apply to the entire system.

An example response to the above query looks like this:

A detailed description and other possibilities (e.g. reading the currently generated current and voltage for the selected inverter) can be found in the documentation.

 

4. Then we create the fronius_info_resp script:

resp=Gate_Http->fronius_info->ResponseBody

if(Gate_Http->fronius_info->StatusCode==200) then

  Gate_Http->total_energy=resp.Body.Data.TOTAL_ENERGY.Values["2"]
  Gate_Http->total_energy=Gate_Http->total_energy/1000
  Gate_Http->year_energy=resp.Body.Data.YEAR_ENERGY.Values["2"]
  Gate_Http->year_energy=Gate_Http->year_energy/1000
  Gate_Http->day_energy=resp.Body.Data.DAY_ENERGY.Values["2"]
  Gate_Http->day_energy=Gate_Http->day_energy/1000
  Gate_Http->current_energy=resp.Body.Data.PAC.Values["2"]

end

 

5. We assign this script to the OnResponse event of the fronius_info virtual object:

 

6. By sending the configuration to GateHttp and triggering the SendRequest event in the fronius_info object:

user featres in the GateHttp module should take the appropriate values:

 

7. To download data periodically, we create a Timer virtual object called fronius_requests:

 

8. In the embedded features, set the Time (e.g. 1000ms) and change the Mode to Interval:

 

9. We assign the SendRequest method to the OnTimer event:

 

10. We assign the Start method of the virtual object to the OnInit event in the GateHttp module:

 

11. We send the configuration created in this way to the GateHttp module.