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

@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:

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=/,r=/,ISHUT,fill=-,flush=W,to=4/0}{io=0/0,kio=0,kro=1}->HttpConnectionOverHTTP@4610d9(l:/ <-> r:/,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 │ │ 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.


I presume your inverter is on ?

What did you get when opening this in a browser?

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.

Hi Jim!
my fronius was installed some weeks ago and since last week i also can export to grid.
i configured the binding with text files and i don’t get any errors, but the values i get from the binding differ from the values i see in the fronius app…

Binding data:

fronius:powerinverter:mybridge:myinverter:inverterdatachanneltotal = 0.3852054927777778 MWh
fronius:meter:mybridge:mymeter:energyrealsumconsumed = 1015811 Wh
fronius:meter:mybridge:mymeter:energyrealsumproduced = 93519 Wh

Here’s a screenshot from the app:

according to your post inverterdatachanneltotal + fronius:meter:mybridge:mymeter:energyrealsumconsumed - fronius:meter:mybridge:mymeter:energyrealsumproduced should equal household consuption, right?

but 385.21 kWh + 101.58 kWh - 93.52 kWh = 393,27 kWh whereas the app tells me consumption was 1319.99 kWh ?

What am i missing?

and which values should i use to replicate this info from the app?

the last one (“to grid”) is the value from fronius:meter:mybridge:mymeter:powerrealsum

first value shoud be fronius:powerinverter:mybridge:myinverter:powerflowchannelppv (same as fronius:meter:mybridge:mymeter:powerrealsum ?)
last one should be fronius:powerinverter:mybridge:myinverter:powerflowchannelpgrid
but is there also a channel for the 2nd value (total consumption)? or is this just the difference between the 2 (given) values?

hope you still use this binding and can provide some insight!

best regards,

The first one is fronius:powerinverter:mybridge:myinverter:inverterdatachannelpac
The second one fronius:powerinverter:mybridge:myinverter:powerflowchannelpload
The third one fronius:powerinverter:mybridge:myinverter:powerflowchannelpgrid

As for your first question, I can’t answer it off the top of my head. I don’t keep track of it myself. Your calculation “seems” to make sense although obviously something is amiss.

1 Like

could you maybe take a look at your data (when you find the time obviously)?
it would be very interesting to display daily/weekly/etc. data on the wallmount tablet…

I just did this on my system:

logger.info (Solar_Total_Energy.state + SmartMeter_Energy_Consumed.state - SmartMeter_Energy_Produced.state) | "MWh"

and I got: 39.980489 MWh

I logged in to Solarweb and it says my total consumption is 39.91MWh so the two are pretty close for my system, with the data from the binding / local being slightly more than what Solarweb reports.

For my wall mount display (a 24" touch screen monitor), I only display the current power stats (generation, consumption, export) to help me know when to start the dishwasher / dryer, etc. I store the usage stats in influxdb and can see them using Grafana / web browser. They were interesting at first but after a while I quite looking at them :slight_smile:

erm… where exactly did you run this command? tried the openhab console but that didn’t work… :neutral_face:

That was a jruby script. I created a file, e.g. test1.rb and saved that line in there. The log output shows up in the karaf console. You could do the same in any other supported scripting language.

To use the Console, you could just type status ItemX one by one and add them up manually.

oh well… my wH > kWh conversion went wrong…

394.70 + 1019.58-101.10=1313,18kWh

vs 1325,16kWh from the app.

it’s pretty close, but shouldn’t it be the same? fronius should be calculating with the same data, right?

Fwiw, I,m selling an Energy Management System based on openHAB that does all of this like to start the washing with surplus power only, and works with Fronius, too.
Free demo at https://storm.house/installation#demo.

You can then inspect the OH config it creates when you select your inverter.

Tweaking that to match inverters is always an individual hassle for every model but IIRC for Fronius I didn’t have to do anything special.

1 Like