Community
OpenEnergyMonitor

Community

Fronius Inverter Push Service

I am wondering if there is any way we can use the Fronius push service to send data to emoncms.
it can be XML, JSON formats by the instructions.

Here is a link to the push service operation instructions.

using an input/post e.g. emoncms.url.com/input/post?apikey=

the response in the log is

2019-08-16 06:34:53.458|ERROR|input_controller.php|{"success": false, "message": "Request contains no data via csv, json or data tag"} for User: 1

Hi Benjamin, I’m afraid I don’t think this is going to work directly as none of the push formats suits the input formats of emoncms.

(the English version starts at page 31 for anyone else looking at the pdf)

you can see examples of the emoncms input formats used here https://emoncms.org/site/api#input

is there any way to query, request, pull or poll data from the inverter? Then yopu could use nodered or a custom script to read the inverter, parse the data and post it t emoncms that way. Or I guess you could still use the push service to push a text file via FTP and the read that, parse and post to emoncms I guess.

Have you searched this forum for “Fronius” ? I’m pretty sure some users have indeed interfaced with some Fronius inverters and posted about it. eg Monitor Fronius Primo 5

I just thought I would post the simple php script that I am using currently to get the fronius symo data into openenergy monitor. I have a fronius smart meter also so that data is the second $data string. showing consumption data for the solar app.
I then call the script below with a bash script that loops every 5 seconds.

<?php

$data = json_decode(file_get_contents('http://192.168.XXX.xXX/solar_api/v1/GetInverterRealtimeData.cgi?Scope=Device&DeviceID=1&DataCollection=3PInverterData'),true);
if(isset($data['Body']['Data']['IAC_L1']['Value'])) {

// Phase 1 Data
$p1_a = $data['Body']['Data']['IAC_L1']['Value'];
$p1_v = $data['Body']['Data']['UAC_L1']['Value'];
$p1_w = ($p1_a * $p1_v); // Phase 1 Watts

// Phase 2 Data
$p2_a = $data['Body']['Data']['IAC_L2']['Value'];
$p2_v = $data['Body']['Data']['UAC_L2']['Value'];
$p2_w = ($p2_a * $p2_v); // Phase 2 Watts	

// Phase 3 Data
$p3_a = $data['Body']['Data']['IAC_L3']['Value'];
$p3_v = $data['Body']['Data']['UAC_L3']['Value'];
$p3_w = ($p3_a * $p3_v); // Phase 3 Watts

$timestamp = $data['Head']['Timestamp'];

//echo "<b>Phase 1: </b>" . $p1_v . "Volts, " . $p1_a . "Amps, " . $p1_w . "Watts<br>";
//echo "<b>Phase 2: </b>" . $p2_v . "Volts, " . $p2_a . "Amps, " . $p2_w . "Watts<br>";
//echo "<b>Phase 2: </b>" . $p3_v . "Volts, " . $p3_a . "Amps, " . $p3_w . "Watts<br><br>";
//echo "<b>Total Current: </b>" . ($p1_a + $p2_a + $p3_a) . "Amps<br>";
//echo "<b>Total Watts: </b>" . ($p1_w + $p2_w + $p3_w) . "Watts<br><br>";

$url = "http://url.com/emoncms/input/post?apikey=APIKEY&node=emontx&fulljson={\"p1_current\":$p1_a,\"p2_current\":$p2_a,\"p3_current\":$p3_a,\"p1_voltage\":$p1_v,\"p2_voltage\":$p2_v,\"p3_voltage\":$p3_v,\"p1_power\":$p1_w,\"p2_power\":$p2_w,\"p3_power\":$p3_w,\"time\":\"$timestamp\"}";
$result = file_get_contents($url, false);
//var_dump($result);
}

/* ******** SMART METER FOR GRID INFORMATION ******** */
$data = json_decode(file_get_contents('http://192.168.XXX.XXX/solar_api/v1/GetPowerFlowRealtimeData.fcgi'),true);
if(isset($data['Body']['Data']['Site']['E_Day'])) {

// Grid Data
$p_grid = $data['Body']['Data']['Site']['P_Grid']; //Power to or from Grid
$p_load = $data['Body']['Data']['Site']['P_Load']; //Self Consumption
$p_load = ($p_load - $p_load) - $p_load; // make positive number as fronius shows in negative
$p_pv = $data['Body']['Data']['Site']['P_PV']; //Power Produced by Solar

$timestamp = $data['Head']['Timestamp'];

//echo "<br><br>";
//echo "<b>Grid Power: </b>" . $p_grid . "Watts<br>";
//echo "<b>Solar Power: </b>" . $p_pv . "Watts<br>";
//echo "<b>Power Consumption: </b>" . $p_load . "Watts<br><br>";

$url = "http://url.com/emoncms/input/post?apikey=APIKEY&node=emontx&fulljson={\"solar\":$p_pv,\"grid\":$p_grid,\"use\":$p_load,\"time\":\"$timestamp\"}";
$result = file_get_contents($url, false);
//var_dump($result);
}

?>
1 Like

Just a note about using python and node-red to get Fronius inverter data into emoncms.
I use the python http request to get data from the inverter via a python script. The key line is basically

r = get('http://192.168.xx.xxx/solar_api/v1/GetPowerFlowRealtimeData.fcgi')
data = r.json()

but with obviously all the other stuff to support it (writing to csv file etc).
This python script is then run from a node-red-contrib-pythonshell which provides a JSON object with key:value pairs.
The output from python is converted to string with the json parser node (not sure if actually needed!)
As I only want the PV value, I use a function node to extract the PV value, which is then passed on to the MQTT output node that connects to the OEM emoncms server on the rPi.

So far seems to be working…