[fronius] How to get the daily total energy consumption and grid import/export?

Can you try Clear the Cache ?

Yea its weird, the bridge and both inverters are showing as online and im getting info from the channels.
Do you have any more ideas as to what to try next?

Hmm Invalid JSON data received.

Please turn on DEBUG level

log:set DEBUG org.openhab.binding.fronius
log:tail org.openhab.binding.fronius

and post the logs. It should show you the actual data returned by the fronius.
To revert this, just set the level to DEFAULT instead of DEBUG

Also try this on your browser and show me the output please

http://<froniusip>/solar_api/v1/GetMeterRealtimeData.cgi?Scope=Device&DeviceId=0&DataCollection=MeterRealtimeData

Just cleared the cache without any change

Here’s the browser output, I’ll change the log level now.

{
   "Body" : {
      "Data" : {
         "Current_AC_Phase_1" : 6.4429999999999996,
         "Current_AC_Sum" : 6.4429999999999996,
         "Details" : {
            "Manufacturer" : "Fronius",
            "Model" : "Smart Meter 63A-1",
            "Serial" : "20270417"
         },
         "Enable" : 1,
         "EnergyReactive_VArAC_Phase_1_Consumed" : 30390,
         "EnergyReactive_VArAC_Phase_1_Produced" : 1380630,
         "EnergyReactive_VArAC_Sum_Consumed" : 30390,
         "EnergyReactive_VArAC_Sum_Produced" : 1380630,
         "EnergyReal_WAC_Minus_Absolute" : 674069,
         "EnergyReal_WAC_Phase_1_Consumed" : 339054,
         "EnergyReal_WAC_Phase_1_Produced" : 674069,
         "EnergyReal_WAC_Plus_Absolute" : 339054,
         "EnergyReal_WAC_Sum_Consumed" : 339054,
         "EnergyReal_WAC_Sum_Produced" : 674069,
         "Frequency_Phase_Average" : 49.899999999999999,
         "Meter_Location_Current" : 0,
         "PowerApparent_S_Phase_1" : 1561.78,
         "PowerApparent_S_Sum" : 1561.78,
         "PowerFactor_Phase_1" : -0.87,
         "PowerFactor_Sum" : -0.87,
         "PowerReactive_Q_Phase_1" : -303.01999999999998,
         "PowerReactive_Q_Sum" : -303.01999999999998,
         "PowerReal_P_Phase_1" : -1363.8399999999999,
         "PowerReal_P_Sum" : -1363.8399999999999,
         "TimeStamp" : 1610840485,
         "Visible" : 1,
         "Voltage_AC_Phase_1" : 242.40000000000001
      }
   },
   "Head" : {
      "RequestArguments" : {
         "DeviceClass" : "Meter",
         "DeviceId" : "0",
         "Scope" : "Device"
      },
      "Status" : {
         "Code" : 0,
         "Reason" : "",
         "UserMessage" : ""
      },
      "Timestamp" : "2021-01-17T12:41:26+13:00"
   }
}

Thanks. I understand the problem now. The binding was tested with a 3 phase system. I’ll have to make some changes to support a 1 phase system as well. For the time being, this won’t work for you. I’ll post an update here to let you know when it has been updated, probably in a day or two.

And the log file.

12:45:57.937 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - Update channel inverterdatachannelpac with state 2232.0 (ValueUnit)
12:45:57.941 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - Update channel inverterdatachanneldayenergy with state 3.1463 (ValueUnit)
12:45:57.954 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - Update channel inverterdatachanneltotal with state 0.525917 (ValueUnit)
12:46:08.021 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - URL = http://192.168.178.161/solar_api/v1/GetMeterRealtimeData.cgi?Scope=Device&DeviceId=0&DataCollection=MeterRealtimeData
12:46:09.187 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - aqiResponse = {
   "Body" : {
      "Data" : {
         "Current_AC_Phase_1" : 12.654,
         "Current_AC_Sum" : 12.654,
         "Details" : {
            "Manufacturer" : "Fronius",
            "Model" : "Smart Meter 63A-1",
            "Serial" : "20270417"
         },
         "Enable" : 1,
         "EnergyReactive_VArAC_Phase_1_Consumed" : 30390,
         "EnergyReactive_VArAC_Phase_1_Produced" : 1380850,
         "EnergyReactive_VArAC_Sum_Consumed" : 30390,
         "EnergyReactive_VArAC_Sum_Produced" : 1380850,
         "EnergyReal_WAC_Minus_Absolute" : 674256,
         "EnergyReal_WAC_Phase_1_Consumed" : 339054,
         "EnergyReal_WAC_Phase_1_Produced" : 674256,
         "EnergyReal_WAC_Plus_Absolute" : 339054,
         "EnergyReal_WAC_Sum_Consumed" : 339054,
         "EnergyReal_WAC_Sum_Produced" : 674256,
         "Frequency_Phase_Average" : 49.899999999999999,
         "Meter_Location_Current" : 0,
         "PowerApparent_S_Phase_1" : 3074.9200000000001,
         "PowerApparent_S_Sum" : 3074.9200000000001,
         "PowerFactor_Phase_1" : -0.96999999999999997,
         "PowerFactor_Sum" : -0.96999999999999997,
         "PowerReactive_Q_Phase_1" : -286.25,
         "PowerReactive_Q_Sum" : -286.25,
         "PowerReal_P_Phase_1" : -2990.7199999999998,
         "PowerReal_P_Sum" : -2990.7199999999998,
         "TimeStamp" : 1610840767,
         "Visible" : 1,
         "Voltage_AC_Phase_1" : 243
      }
   },
   "Head" : {
      "RequestArguments" : {
         "DeviceClass" : "Meter",
         "DeviceId" : "0",
         "Scope" : "Device"
      },
      "Status" : {
         "Code" : 0,
         "Reason" : "",
         "UserMessage" : ""
      },
      "Timestamp" : "2021-01-17T12:46:07+13:00"
   }
}

12:46:09.195 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - Error running fronius request: Invalid JSON data received
12:46:09.200 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - URL = http://192.168.178.161/solar_api/v1/GetInverterRealtimeData.cgi?Scope=Device&DeviceId=1&DataCollection=CommonInverterData
12:46:10.420 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - aqiResponse = {
   "Body" : {
      "Data" : {
         "DAY_ENERGY" : {
            "Unit" : "Wh",
            "Value" : 4674
         },
         "DeviceStatus" : {
            "ErrorCode" : 0,
            "LEDColor" : 2,
            "LEDState" : 0,
            "MgmtTimerRemainingTime" : -1,
            "StateToReset" : false,
            "StatusCode" : 7
         },
         "FAC" : {
            "Unit" : "Hz",
            "Value" : 49.939999999999998
         },
         "IAC" : {
            "Unit" : "A",
            "Value" : 15
         },
         "IDC" : {
            "Unit" : "A",
            "Value" : 13.789999999999999
         },
         "PAC" : {
            "Unit" : "W",
            "Value" : 3651
         },
         "TOTAL_ENERGY" : {
            "Unit" : "Wh",
            "Value" : 677268
         },
         "UAC" : {
            "Unit" : "V",
            "Value" : 243.59999999999999
         },
         "UDC" : {
            "Unit" : "V",
            "Value" : 274.10000000000002
         },
         "YEAR_ENERGY" : {
            "Unit" : "Wh",
            "Value" : 443269.5
         }
      }
   },
   "Head" : {
      "RequestArguments" : {
         "DataCollection" : "CommonInverterData",
         "DeviceClass" : "Inverter",
         "DeviceId" : "1",
         "Scope" : "Device"
      },
      "Status" : {
         "Code" : 0,
         "Reason" : "",
         "UserMessage" : ""
      },
      "Timestamp" : "2021-01-17T12:46:08+13:00"
   }
}

12:46:10.438 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - URL = http://192.168.178.161/solar_api/v1/GetPowerFlowRealtimeData.fcgi
12:46:10.592 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - aqiResponse = {
   "Body" : {
      "Data" : {
         "Inverters" : {
            "1" : {
               "DT" : 76,
               "E_Day" : 4674,
               "E_Total" : 677266,
               "E_Year" : 443269.5,
               "P" : 3651
            },
            "2" : {
               "DT" : 76,
               "E_Day" : 3152.699951171875,
               "E_Total" : 525924,
               "E_Year" : 348369.90625,
               "P" : 2246
            }
         },
         "Site" : {
            "E_Day" : 7826.699951171875,
            "E_Total" : 1203190,
            "E_Year" : 791639.40625,
            "Meter_Location" : "grid",
            "Mode" : "meter",
            "P_Akku" : null,
            "P_Grid" : -2990.7199999999998,
            "P_Load" : -2906.2800000000002,
            "P_PV" : 5897,
            "rel_Autonomy" : 100,
            "rel_SelfConsumption" : 49.28404273359336
         },
         "Version" : "12"
      }
   },
   "Head" : {
      "RequestArguments" : {},
      "Status" : {
         "Code" : 0,
         "Reason" : "",
         "UserMessage" : ""
      },
      "Timestamp" : "2021-01-17T12:46:08+13:00"
   }
}

12:46:10.600 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - Update channel inverterdatachannelpac with state 3651.0 (ValueUnit)
12:46:10.605 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - Update channel inverterdatachanneldayenergy with state 4.674 (ValueUnit)
12:46:10.627 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - Update channel inverterdatachanneltotal with state 0.677268 (ValueUnit)
12:46:10.649 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - Update channel powerflowchannelpgrid with state -2990.72 (Double)
12:46:10.655 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - Update channel powerflowchannelpload with state -2906.28 (Double)
12:46:10.662 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - URL = http://192.168.178.161/solar_api/v1/GetInverterRealtimeData.cgi?Scope=Device&DeviceId=2&DataCollection=CommonInverterData
12:46:11.711 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - aqiResponse = {
   "Body" : {
      "Data" : {
         "DAY_ENERGY" : {
            "Unit" : "Wh",
            "Value" : 3155.1999999999998
         },
         "DeviceStatus" : {
            "ErrorCode" : 0,
            "LEDColor" : 2,
            "LEDState" : 0,
            "MgmtTimerRemainingTime" : -1,
            "StateToReset" : false,
            "StatusCode" : 7
         },
         "FAC" : {
            "Unit" : "Hz",
            "Value" : 49.93
         },
         "IAC" : {
            "Unit" : "A",
            "Value" : 9.1199999999999992
         },
         "IDC" : {
            "Unit" : "A",
            "Value" : 6.0300000000000002
         },
         "PAC" : {
            "Unit" : "W",
            "Value" : 2214
         },
         "TOTAL_ENERGY" : {
            "Unit" : "Wh",
            "Value" : 525926.06000000006
         },
         "UAC" : {
            "Unit" : "V",
            "Value" : 243.19999999999999
         },
         "UDC" : {
            "Unit" : "V",
            "Value" : 374.19999999999999
         },
         "YEAR_ENERGY" : {
            "Unit" : "Wh",
            "Value" : 348372.40999999997
         }
      }
   },
   "Head" : {
      "RequestArguments" : {
         "DataCollection" : "CommonInverterData",
         "DeviceClass" : "Inverter",
         "DeviceId" : "2",
         "Scope" : "Device"
      },
      "Status" : {
         "Code" : 0,
         "Reason" : "",
         "UserMessage" : ""
      },
      "Timestamp" : "2021-01-17T12:46:10+13:00"
   }
}

12:46:11.720 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - URL = http://192.168.178.161/solar_api/v1/GetPowerFlowRealtimeData.fcgi
12:46:11.771 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - aqiResponse = {
   "Body" : {
      "Data" : {
         "Inverters" : {
            "1" : {
               "DT" : 76,
               "E_Day" : 4674,
               "E_Total" : 677268,
               "E_Year" : 443269.5,
               "P" : 3651
            },
            "2" : {
               "DT" : 76,
               "E_Day" : 3154,
               "E_Total" : 525925,
               "E_Year" : 348371.21875,
               "P" : 2240
            }
         },
         "Site" : {
            "E_Day" : 7828,
            "E_Total" : 1203193,
            "E_Year" : 791640.71875,
            "Meter_Location" : "grid",
            "Mode" : "meter",
            "P_Akku" : null,
            "P_Grid" : -2956.73,
            "P_Load" : -2934.27,
            "P_PV" : 5891,
            "rel_Autonomy" : 100,
            "rel_SelfConsumption" : 49.80937022576812
         },
         "Version" : "12"
      }
   },
   "Head" : {
      "RequestArguments" : {},
      "Status" : {
         "Code" : 0,
         "Reason" : "",
         "UserMessage" : ""
      },
      "Timestamp" : "2021-01-17T12:46:10+13:00"
   }
}

12:46:11.788 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - Update channel inverterdatachannelpac with state 2214.0 (ValueUnit)
12:46:11.796 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - Update channel inverterdatachanneldayenergy with state 3.1552 (ValueUnit)
12:46:11.809 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - Update channel inverterdatachanneltotal with state 0.5259260600000001 (ValueUnit)
12:46:21.868 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - URL = http://192.168.178.161/solar_api/v1/GetMeterRealtimeData.cgi?Scope=Device&DeviceId=0&DataCollection=MeterRealtimeData
12:46:23.262 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - aqiResponse = {
   "Body" : {
      "Data" : {
         "Current_AC_Phase_1" : 12.922000000000001,
         "Current_AC_Sum" : 12.922000000000001,
         "Details" : {
            "Manufacturer" : "Fronius",
            "Model" : "Smart Meter 63A-1",
            "Serial" : "20270417"
         },
         "Enable" : 1,
         "EnergyReactive_VArAC_Phase_1_Consumed" : 30390,
         "EnergyReactive_VArAC_Phase_1_Produced" : 1380870,
         "EnergyReactive_VArAC_Sum_Consumed" : 30390,
         "EnergyReactive_VArAC_Sum_Produced" : 1380870,
         "EnergyReal_WAC_Minus_Absolute" : 674267,
         "EnergyReal_WAC_Phase_1_Consumed" : 339054,
         "EnergyReal_WAC_Phase_1_Produced" : 674267,
         "EnergyReal_WAC_Plus_Absolute" : 339054,
         "EnergyReal_WAC_Sum_Consumed" : 339054,
         "EnergyReal_WAC_Sum_Produced" : 674267,
         "Frequency_Phase_Average" : 49.899999999999999,
         "Meter_Location_Current" : 0,
         "PowerApparent_S_Phase_1" : 3143.9200000000001,
         "PowerApparent_S_Sum" : 3143.9200000000001,
         "PowerFactor_Phase_1" : -0.96999999999999997,
         "PowerFactor_Sum" : -0.96999999999999997,
         "PowerReactive_Q_Phase_1" : -284.42000000000002,
         "PowerReactive_Q_Sum" : -284.42000000000002,
         "PowerReal_P_Phase_1" : -3065.8699999999999,
         "PowerReal_P_Sum" : -3065.8699999999999,
         "TimeStamp" : 1610840781,
         "Visible" : 1,
         "Voltage_AC_Phase_1" : 243.30000000000001
      }
   },
   "Head" : {
      "RequestArguments" : {
         "DeviceClass" : "Meter",
         "DeviceId" : "0",
         "Scope" : "Device"
      },
      "Status" : {
         "Code" : 0,
         "Reason" : "",
         "UserMessage" : ""
      },
      "Timestamp" : "2021-01-17T12:46:21+13:00"
   }
}

Awesome thanks!

@joedirt Out of curiosity, what’s your inverter model please?

Please try the following jar (rename .txt to .jar, delete the old 3.0.0-SNAPSHOT jar)
org.openhab.binding.fronius-3.1.0-SNAPSHOT.txt (45.1 KB)

openhab> bundle:list -s | grep fronius
266 │ Active │  80 │ 3.1.0.202101180259      │ org.openhab.binding.fronius

@JimT Sweet, I’ll try and sort that tomorrow, currently cooking dinner and other dad duties.

I have 2 of the Fronius Primo 5.0-1

@JimT: Thanks for your work!
I am a beginner with openhab and have the same problem.
I removed the 3.0.0. Fronius binding in the browser, copied …3.1.0-SNAPSHOT.txt to /usr/share/openhab/addons
restarted the system
I could create a bridge -> online
Creating an inverter with device ID 1 -> comm error
Creating a meter with device ID 0 -> comm errror
solarapi output:
solarapi.txt (1.3 KB)

bundle:list -s | grep fronius is not working in my console with access by openhabian and sudo

var/log/openhab/events.log shows:

Blockquote
2021-01-24 11:52:29.167 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing ‘fronius:powerinverter:48e8608b67’ changed from UNINITIALIZED to INITIALIZING
2021-01-24 11:52:29.190 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing ‘fronius:powerinverter:48e8608b67’ changed from INITIALIZING to OFFLINE
2021-01-24 11:52:43.242 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing ‘fronius:powerinverter:48e8608b67’ changed from OFFLINE to REMOVING
2021-01-24 11:52:43.258 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing ‘fronius:powerinverter:48e8608b67’ changed from REMOVING to REMOVED
2021-01-24 11:52:43.265 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing ‘fronius:powerinverter:48e8608b67’ changed from REMOVED to UNINITIALIZED
2021-01-24 11:52:43.292 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing ‘fronius:powerinverter:48e8608b67’ changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)
2021-01-24 11:52:59.642 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing ‘fronius:meter:8e3ca1cd11’ changed from UNINITIALIZED to INITIALIZING
2021-01-24 11:52:59.662 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing ‘fronius:meter:8e3ca1cd11’ changed from INITIALIZING to OFFLINE
2021-01-24 11:54:07.202 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing ‘fronius:powerinverter:cf42e625d2’ changed from UNINITIALIZED to INITIALIZING
2021-01-24 11:54:07.223 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing ‘fronius:powerinverter:cf42e625d2’ changed from INITIALIZING to OFFLINE

Stupid - I forgot to set the bridge in the process of creating the inverter and the meter, got help from
user violin

Everything is working - thanks!

@chilobo thanks for testing it. This fix should be included in the upcoming OpenHAB 3.1 release, at which time you should delete the snapshot jar and use the official binding from OH 3.1.

I did an upgrade to 3.1.0 M5 and tried to use the binding accessible from the user interface, added bridge, smartmeter, inverter by user interface.
The bridge seems to open fine, smartmeter and produce ERROR:COMM

2021-06-01 13:47:46.885 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'fronius:powerinverter:FroniusBR:FroniusSI' changed from OFFLINE (COMMUNICATION_ERROR): Invalid JSON data received to OFFLINE (COMMUNICATION_ERROR): java.util.concurrent.ExecutionException: java.io.EOFException: HttpConnectionOverHTTP@4610d9::SocketChannelEndPoint@d70725{l=/192.168.178.8:41500,r=/192.168.178.78:80,ISHUT,fill=-,flush=W,to=4/0}{io=0/0,kio=0,kro=1}->HttpConnectionOverHTTP@4610d9(l:/192.168.178.8:41500 <-> r:/192.168.178.78:80,closed=false)=>HttpChannelOverHTTP@a66a38(exchange=HttpExchange@1d856c9{req=HttpRequest[GET /solar_api/v1/GetPowerFlowRealtimeData.fcgi HTTP/1.1]@1905933[TERMINATED/null] res=HttpResponse[null 0 null]@1489ecb[PENDING/null]})[send=HttpSenderOverHTTP@42c370(req=QUEUED,snd=COMPLETED,failure=null)[HttpGenerator@151ac2f{s=START}],recv=HttpReceiverOverHTTP@bd24f7(rsp=IDLE,failure=null)[HttpParser{s=CLOSED,0 of -1}]]

bundle shows:

238 │ Active │ 80 │ 3.1.0.M5 │ openHAB Add-ons :: Bundles :: Fronius Binding

I removed Bridge, Smartmeter, Inverter by UI and the binding wirh bundle, copied
org.openhab.binding.fronius-3.1.0-SNAPSHOT.jar from above to /us/share/openhab/addons and restarted the system getting the error message:

org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.fronius [248]

  Unresolved requirement: Import-Package: javax.measure; version="[1.0.0,2.0.0)"

	at org.eclipse.osgi.container.Module.start(Module.java:463) ~[org.eclipse.osgi-3.16.200.jar:?]

	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:440) ~[org.eclipse.osgi-3.16.200.jar:?]

	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [bundleFile:3.6.8]

	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [bundleFile:3.6.8]

	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1221) [bundleFile:3.6.8]

	at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:515) [bundleFile:3.6.8]

	at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [bundleFile:3.6.8]

	at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [bundleFile:3.6.8]

bundle shows:
248 │ Installed │ 80 │ 3.1.0.202101180259 │ openHAB Add-ons :: Bundles :: Fronius Binding

They changed that. The binding needs a fix. Log a github issue.

So I don’t ask JimT to change his version but go to github and ask there to fix it, right?

@chilobo, don’t use the jar that I posted above. It’s old and outdated by now. The one that came with 3.1M5 is the latest one.

2 Likes

I presume your inverter is on 192.168.178.78 ?

What did you get when opening this in a browser?
http://192.168.178.78/solar_api/v1/GetPowerFlowRealtimeData.fcgi

Well - shame on me…
My router changed the IP adresse because I added a new device. I should find out how to make the IP permanent. Thanks go to JimT!

I connected the ethernet port on fronius to a wifi extender for a more reliable wifi connection. The built in wifi often dropped out requiring me to turn off/on the fronius access point. I also set the ip to static from within fronius settings.