Hi,
I have Habian with OH2.4Snapshot running on Debian9-laptop.
I am trying to pull in data from the Dutch weather data centre with use of http-binding and JSONPath (both bindings installed) but I am doing something wrong. I hope someone can spot my error.
I have tryed several item declarations but one will give me just nothing and others give me an error message in the log accompanied by the complete JSON-dump which overfloods my log so that I cannot read the error in time.
The url is with https, I don’t know how to deal with this.
The url in a browser gives me the expected JSON: https://api.buienradar.nl/data/public/2.0/jsonfeed.
This JSONPath expression:
$.actual.stationmeasurements.[?(@.stationid = 6391)].temperature
gives me the desired data when tested in a json-test-site: https://jsonpath.curiousconcept.com/
http.cfg:
Buienradar_JSON.url=https://api.buienradar.nl/data/public/2.0/jsonfeed
Buienradar_JSON.updateInterval=60000
buien.items:
// itemtype itemname descrition/units { http="<[<url>:<refreshintervalinmilliseconds>:<transformationrule>]"}
String Temperatuur_buienradar1 "Temp. buienradar: [%.1f °C]" { http="<[Buienradar_JSON:10000:JSONPATH($.actual.stationmeasurements.[?(@.stationid = 6391)].temperature)]" } //floods the log
Number Temperatuur_buienradar1 "Temp. buienradar: [%.1f °C]" { http="<[Buienradar_JSON:10000:JSONPATH($.actual.stationmeasurements.[?(@.stationid = 6391)].temperature)]" } // floods the log
String Temperatuur_buienradar1 "Temp. buienradar: [%.1f °C]" { http="<[Buienradar_JSON:10000:JSONPATH($.actual.stationmeasurements.[?(@.stationid = 6391)].temperature)]" } //floods the log
Number Temperatuur_buienradar1 "Temp. buienradar: [%.1f °C]" { http="<[Buienradar_JSON:10000:JSONPATH($.actual.stationmeasurements.[?(@.stationid = 6391)].temperature)]" } // item gets updated but empty
Number Temperatuur_buienradar1 "Temp. buienradar: [%.1f °C]" { http="<[https://api.buienradar.nl/data/public/2.0/jsonfeed:10000:JSONPATH($.actual.stationmeasurements.[?(@.stationid = 6391)].temperature)]" } //item gets updated but empty
String Temperatuur_buienradar1 "Temp. buienradar: [%.1f °C]" { http="<[https://api.buienradar.nl/data/public/2.0/jsonfeed:10000:JSONPATH($.actual.stationmeasurements.[?(@.stationid = 6391)].temperature)]" } // item gets updated but empty
I hope someone can spot my error!
Cheers,
Guido