HTTP Configuration OH2 -> OH3

In OH2 I had the following HTTP configuration successfully in use.

http.cfg (OH2)

FRONIUS_GEN24_FlowRealTimeData.url=http://192.168.0.195/solar_api/v1/GetPowerFlowRealtimeData.fcgi?Scope=System
FRONIUS_GEN24_FlowRealTimeData.updateInterval=15000

http.items (OH2)

Number PV1_Battery "Batterieladestand [%.1f %%]" <battery> (gPV) { http="<[FRONIUS_GEN24_FlowRealTimeData:5000:JSONPATH($.Body.Data.Inverters.1.SOC)]" }

Now I have migrated to OH3 and am trying to migrate the HTTP functions to OH3 as well.

http.things (OH3)

Thing http:url:FRONIUS_GEN24_FlowRealTimeData "FRONIUS_GEN24_FlowRealTimeData" [
	baseURL="http://192.168.0.195/solar_api/v1/GetPowerFlowRealtimeData.fcgi?Scope=System",
	headers="key1=value1", "key2=value2", "key3=value3",
    refresh=15] 
    {
		Channels:
			Type string : PV1_Battery "Batterieladestand [%.1f %%]" [ stateTransformation="JSONPATH($.Body.Data.Inverters.1.SOC)" ]
    }

http.items (OH3)

Number PV1_Battery "Batterieladestand [%.1f %%]" <battery> (gPV) { channel="http:url:FRONIUS_GEN24_FlowRealTimeData:PV1_Battery" }

Unfortunately, it does not work and the following message appears. I see no value.
the JSON Transformation Addon is installed.

2021-12-23 17:56:33.729 [WARN ] [form.CascadedValueTransformationImpl] - Transformation ignore, failed to parse JSONPATH($.Body.Data.Inverters.1.SOC): The transformation pattern must consist of the type and the pattern separated by a colon

What is the mistake in the HTTP configuration for OH3? I am a newbie in this topic and have no idea how to make this work. does anyone have experience with this could possibly give me a tip for successful conversion to OH3?

You didn’t read the documentation: HTTP - Bindings | openHAB. The correct syntax is JSONPATH:$.Body.Data.Inverters.1.SOC.

I had read it … but apparently too little accurate. this difference in syntax I had unfortunately not seen.
Now it works! Thanks for the prompt tip!

1 Like