Hello community colleagues
hopefully you can help me with an issue that I have regarding jsonpath items.
With OH 2.5 I want to parse the probability of Aurora events for a certain location into items by using the JSON provides by NOAA: https://services.swpc.noaa.gov/json/ovation_aurora_latest.json.
I have the following entries in the http.cfg:
auroraNoaaGov.url=https://services.swpc.noaa.gov/json/ovation_aurora_latest.json
auroraNoaaGov.updateInterval=300000
My items file has those entires:
Number AuroraPropabilityHome "Aurora Home [%.0f%%]" <home> {http="<[auroraNoaaGov:300000:JSONPATH($.coordinates[?(@[0] == 51 && @[1] == 6)].2)]" }
Number AuroraPropabilityOther "Aurora Other [%.0f%%]" <other> {http="<[auroraNoaaGov:300000:JSONPATH($.coordinates[?(@[0] == 57 && @[1] == 15)].2)]" }
I successfully tested the JSONPATH at Online JSON Query Tester (jsonquerytool.com) using the Goessner 0.8.0 transform and it succeeded:
My logfiles have the following error:
2021-11-06 11:15:10.497 [ERROR] [b.core.service.AbstractActiveService] - Error while executing background thread HTTP Refresh Service
java.lang.IllegalArgumentException: given transformation function 'JSONPATH($.coordinates[?(@[0' does not follow the expected pattern '<function>(<pattern>)'
at org.openhab.binding.http.internal.HttpBinding.splitTransformationConfig(HttpBinding.java:261) ~[?:?]
at org.openhab.binding.http.internal.HttpBinding.execute(HttpBinding.java:211) ~[?:?]
at org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute(AbstractActiveBinding.java:146) ~[bundleFile:?]
at org.openhab.core.service.AbstractActiveService$RefreshThread.run(AbstractActiveService.java:169) [bundleFile:?]
Where is my fault - I don’t see it.
Could you please help?