Reading Fronius inverters (Symo 15.0-3-M) with modbus binding

Tags: #<Tag:0x00007f6173dbd0e0> #<Tag:0x00007f6173dbce88>

Should be

Number PV_Current “Aktuelle Leistung [%0f W]” (PV,PV_Graf) { http=<[froniusrtd:5000:JSONPATH($.Body.Data.PAC.Values.1)]" }

not 50000!

But I’m not sure if this would help anyway. As far as I know, the UI won’t update this fast.

Thank you for your help.
How Can I calculate (W in kwH) ?
I tried a rule:
rule "pv-berechnung in kWh"
when
Item PV_DaySum received update
then
var PV_DaySumCalculated = PV_DaySum/1000;
end

in sitemap I use PV_DaySumCalculated instead of PV_DaySum.

Rule shows error in log:
2017-11-25 13:51:13.380 [ERROR] [.script.engine.ScriptExecutionThread] - Rule ‘pv-berechnung in kWh’: An error occurred during the script execution: The name ’ / ’ cannot be resolved to an item or type.

When updating the state of an item, you have to use either sendCommand or postUpdate, where the former will result in a command sent to every binding which is bound to the item and the latter only will change the state without sending this to the bindings.
So, the rule should be like

rule "pv-berechnung in kWh"
when
    Item PV_DaySum received update
then
    PV_DaySumCalculated.postUpdate((PV_DaySum.state as Number)/1000)
end

2017-11-26 11:23:02.335 [ERROR] [.script.engine.ScriptExecutionThread] - Rule ‘pv-berechnun g in kWh’: An error occurred during the script execution: The name ‘PV_DaySumCalculated’ ca nnot be resolved to an item or type.
2017-11-26 11:23:32.322 [ERROR] [.script.engine.ScriptExecutionThread] - Rule ‘pv-berechnung in kWh’: An error occurred during the script execution: The name ‘PV_DaySumCalculated’ cannot be resolved to an item or type.

Where do I have to initialize PV_DaySumCalculated and how ?
thanks,

You have to define PV_DaySumCalculated as an item in an .items file (same as the other items)
UIs do only display Items, so every value, which shall be displayed has to be stored in an item.

This item is not bound to any binding, so there is no {} part:

Number PV_DaySumCalculated  "Tagessumme [%.1f kWh]" <inverter>

thank you for your help!
do you know how I can manage the offline time of my inverter ? During that period the inverter the log says:
Exception: No route to host (Host unreachable)
2017-11-26 19:00:25.413 [ERROR] [ab.binding.http.internal.HttpBinding] - No response received from ‘froniusrtd’

is there any chance to use http binding url only if IP is available without error logging ?
thanks

I doubt that there is a way to prevent such error logging. But the inverter should not be offline anyway - or did I miss something? At least my inverter is online 24/7…

I can configure the inverter. If no solar power during night it goes offline. This makes sense not using standby power.
Is there a way to check if it is online and if so to update the values all in a rule? How could that be done?
I think the update url in the items must be deleted?

Well, you could use the network binding to get information about offline/online state. You would then have to get all data the hard way :wink: through a rule. But of course this would be possible. The network binding will also log information about offline state, but at least this is no error (at the moment I don’t remember if it’s warn or info level).

ok, separat filtering for log not possible, exactly for that prolem?

i must change the format=false to format=true in http.cfg in order to get other things like dimmers to trun.
Now my sitemap does not show all PV values. I only can find some '—'
How Can I deal with the problem?

I’m pretty sure this is not related to format=true. This is only to suppress formatting e.g. %2$ to the actual value of the item, and this parameter is only for outbound but not inbound traffic.

very strange… it worked… here is my pv config, only showing — for my values:

items:

Number PV_DaySumCalculated "Tagessumme [%.1f kWh]" <inverter>
Number PV_YearSumCalculated "Jahressumme [%.1f MWh]" <inverter>
Number PV_TotalCalculated "Gesamtsumme [%.1f MWh]" <inverter>
Number PV_Prozent "Auslastung [%.2f %%]" <inverter>
Number  PV_Current      "Aktuelle Leistung [%0f W]"     <inverter>      (PV)            { http="<[froniusrtd:5000:JSONPATH($.Body.Data.PAC.Values.1)]" }
Number  PV_DaySum       "Tagessumme [%0f Wh]"   <inverter>      (PV)            { http="<[froniusrtd:30000:JSONPATH($.Body.Data.DAY_ENERGY.Values.1)]" }
Number  PV_YearSum      "Jahressumme [%0f Wh]"  <inverter>      (PV)            { http="<[froniusrtd:30000:JSONPATH($.Body.Data.YEAR_ENERGY.Values.1)]" }
Number  PV_Total        "Gesamtsumme [%0f Wh]"  <inverter>      (PV)            { http="<[froniusrtd:30000:JSONPATH($.Body.Data.TOTAL_ENERGY.Values.1)]" }

config:

froniusrtd.url=http://192.168.1.180/solar_api/v1/GetInverterRealtimeData.cgi?Scope=System
froniusrtd.updateInterval=5000

sitemap:

Frame label="Photovoltaik Daten" {
        Text item=PV_Current label="PV Leistung: [%.0f W]" icon="none"
		Text item=PV_Prozent label="PV Auslastung: [%.2f %%]" icon="none"
                Text item=PV_DaySumCalculated label="PV Leistung Tag: [%.2f kWh]" icon="none"
                Text item=PV_YearSumCalculated label="PV Leistung Jahr: [%.2f MWh]" icon="none"
		Text item=PV_TotalCalculated label="PV Leistung Total: [%.2f MWh]" icon="none"
        Group item=PV label="Verlaufsdaten" icon="solarplant"
	}

rules:

rule "pv-berechnung in kWh"
when
	Item PV_DaySum received update
then
	PV_DaySumCalculated.postUpdate((PV_DaySum.state as Number)/1000);
end

rule "pv-berechnung in MWh"
when
	Item PV_YearSum received update
then
	PV_YearSumCalculated.postUpdate((PV_YearSum.state as Number)/1000000);
end

rule "pv-berechnung total in MWh"
when
	Item PV_Total received update
then
	PV_TotalCalculated.postUpdate((PV_Total.state as Number)/1000000);
end

rule "auslastung"
when
	Item PV_Current received update
then
	PV_Prozent.postUpdate((PV_Current.state as Number)/8100*100);
end

@Klaus_Schuster
This is a great example for me - I would like to add data from my Fronius Symo Hybrid to openhab 2.
I have problems defining the push service parameters in the Fronius firmware.
I am using a Raspi with openhabian, ip is 192.168.1.9.
Can someone help me please to find out what the push service line looks like so I can use the above items and rules in openhab?

Many thanks in advance!

Hi Martin,

you don’t need to configure a push service for getting Fronius json data !
Just try in your browser if you receive any data with the following URL:
http://192.168.1.9/solar_api/v1/GetInverterRealtimeData.cgi?Scope=System

Hallo Klaus

Thanks a lot, it is working in the browser and in openhab!

perfect! so can you tell me if you can find any values or also showing — in your sitemap?

As it would be great to get also data about level of battery and current power usage… like

I tried this in http.cfg
froniusrtd.url=http://192.168.1.39/solar_api/v1/GetPowerFlowRealtimeData.fcgi?Scope=System

and these in .items:
Number PV_Current “Aktuelle Leistung [%0f W]” { http="<[froniusrtd:5000:JSONPATH($.Body.Data.Inverters.1.P)]" }
Number PV_DaySum “Tagessumme [%0f Wh]” { http="<[froniusrtd:30000:JSONPATH($.Body.Data.Inverters.1.E_Day)]" }
Number PV_YearSum “Jahressumme [%0f Wh]” { http="<[froniusrtd:30000:JSONPATH($.Body.Data.Inverters.1.E_Year)]" }
Number PV_Total “Gesamtsumme [%0f Wh]” { http="<[froniusrtd:30000:JSONPATH($.Body.Data.Inverters.1.E_Total)]" }
Number PV_Battery “Batterieladung [%d %]” (gPV) { http="<[froniusrtd:30000:JSONPATH($.Body.Data.Inverters.1.SOC)]" }
Number PV_Battery “Batterieladung [%d Prozent]” (gPV) { http="<[froniusrtd:30000:JSONPATH($.Body.Data.Inverters.1.SOC)]" }
Number PV_Grid “Leistung vom Netz [%.1f W]” (gPV) { http="<[froniusrtd:5000:JSONPATH($.Body.Data.Site.P_Grid)]" }
Number PV_Akku “Leistung von Batterie [%.1f W]” (gPV) { http="<[froniusrtd:5000:JSONPATH($.Body.Data.Site.P_Akku)]" }
Number PV_PV “Leistung vom Dach [%.1f W]” (gPV) { http="<[froniusrtd:5000:JSONPATH($.Body.Data.Site.P_PV)]" }

and was successful in displaying all battery data!!!

Thanks a lot for pointing me in the right direction!

can you tell me if you do not get any data for “Leistung vom Dach” or do you have parsing errors ? Should there stand 0 W instead of - W ?

solved my problem: HTTP Binding http.cfg error