Hello,
I am using the following Webservice URL with openHAB 3 new HTTP-Binding:
https://services7.arcgis.com/mOBPykOjAyBO2ZKk/arcgis/rest/services/DIVI_Intensivregister_Landkreise/FeatureServer/0/query?where=BL_ID=3&returnGeodetic=false&outFields=*&returnGeometry=false&returnCentroid=false&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&outStatistics=[{"statisticType":"sum","onStatisticField":"faelle_covid_aktuell","outStatisticFieldName":"faelle_covid_aktuell"},{"statisticType":"sum","onStatisticField":"faelle_covid_aktuell_beatmet","outStatisticFieldName":"faelle_covid_aktuell_beatmet"},{"statisticType":"sum","onStatisticField":"betten_frei","outStatisticFieldName":"betten_frei"},{"statisticType":"sum","onStatisticField":"betten_gesamt","outStatisticFieldName":"betten_gesamt"},{"statisticType":"sum","onStatisticField":"anzahl_standorte","outStatisticFieldName":"anzahl_standorte"},{"statisticType":"max","onStatisticField":"daten_stand","outStatisticFieldName":"daten_stand"}]&returnZ=false&returnM=false&returnExceededLimitFeatures=true&sqlFormat=none&f=json
Used on a Webbroser the above URL returns a valid json.
I started on openHAB 3.0.0 stable Build an figured out, that I have to use URL Encoding on of the special Characters AND that I have to double the % sign to get it work!
I am not sure if I encodede to many characters but it worked perfectly that way:
https://services7.arcgis.com/mOBPykOjAyBO2ZKk/arcgis/rest/services/DIVI_Intensivregister_Landkreise/FeatureServer/0/query?where=BL_ID=3&returnGeodetic=false&outFields=*&returnGeometry=false&returnCentroid=false&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&outStatistics=%%5B%%7B%%22statisticType%%22%%3A%%22sum%%22%%2C%%22onStatisticField%%22%%3A%%22faelle_covid_aktuell%%22%%2C%%22outStatisticFieldName%%22%%3A%%22faelle_covid_aktuell%%22%%7D%%2C%%7B%%22statisticType%%22%%3A%%22sum%%22%%2C%%22onStatisticField%%22%%3A%%22faelle_covid_aktuell_beatmet%%22%%2C%%22outStatisticFieldName%%22%%3A%%22faelle_covid_aktuell_beatmet%%22%%7D%%2C%%7B%%22statisticType%%22%%3A%%22sum%%22%%2C%%22onStatisticField%%22%%3A%%22betten_frei%%22%%2C%%22outStatisticFieldName%%22%%3A%%22betten_frei%%22%%7D%%2C%%7B%%22statisticType%%22%%3A%%22sum%%22%%2C%%22onStatisticField%%22%%3A%%22betten_gesamt%%22%%2C%%22outStatisticFieldName%%22%%3A%%22betten_gesamt%%22%%7D%%2C%%7B%%22statisticType%%22%%3A%%22sum%%22%%2C%%22onStatisticField%%22%%3A%%22anzahl_standorte%%22%%2C%%22outStatisticFieldName%%22%%3A%%22anzahl_standorte%%22%%7D%%2C%%7B%%22statisticType%%22%%3A%%22max%%22%%2C%%22onStatisticField%%22%%3A%%22daten_stand%%22%%2C%%22outStatisticFieldName%%22%%3A%%22daten_stand%%22%%7D%%5D&returnZ=false&returnM=false&returnExceededLimitFeatures=true&sqlFormat=none&f=json
Since my system stoped working sometimes during night, i decided to test the latest snapshot and I installed openHAB 3.1.0-SNAPSHOT - Build #2159.
After the upgrade the Items related to this Query did not update anymore. I had a look into the logs and discoverd the following (after enabling TRACE log level):
2021-01-22 21:38:27.020 [TRACE] [ttp.internal.http.RefreshingUrlCache] - Requesting refresh (retry=false) from 'https://services7.arcgis.com/mOBPykOjAyBO2ZKk/arcgis/rest/services/DIVI_Intensivregister_Landkreise/FeatureServer/0/query?where=BL_ID=3&returnGeodetic=false&outFields=*&returnGeometry=false&returnCentroid=false&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&outStatistics=%255B%257B%2522statisticType%2522%253A%2522sum%2522%252C%2522onStatisticField%2522%253A%2522faelle_covid_aktuell%2522%252C%2522outStatisticFieldName%2522%253A%2522faelle_covid_aktuell%2522%257D%252C%257B%2522statisticType%2522%253A%2522sum%2522%252C%2522onStatisticField%2522%253A%2522faelle_covid_aktuell_beatmet%2522%252C%2522outStatisticFieldName%2522%253A%2522faelle_covid_aktuell_beatmet%2522%257D%252C%257B%2522statisticType%2522%253A%2522sum%2522%252C%2522onStatisticField%2522%253A%2522betten_frei%2522%252C%2522outStatisticFieldName%2522%253A%2522betten_frei%2522%257D%252C%257B%2522statisticType%2522%253A%2522sum%2522%252C%2522onStatisticField%2522%253A%2522betten_gesamt%2522%252C%2522outStatisticFieldName%2522%253A%2522betten_gesamt%2522%257D%252C%257B%2522statisticType%2522%253A%2522sum%2522%252C%2522onStatisticField%2522%253A%2522anzahl_standorte%2522%252C%2522outStatisticFieldName%2522%253A%2522anzahl_standorte%2522%257D%252C%257B%2522statisticType%2522%253A%2522max%2522%252C%2522onStatisticField%2522%253A%2522daten_stand%2522%252C%2522outStatisticFieldName%2522%253A%2522daten_stand%2522%257D%255D&returnZ=false&returnM=false&returnExceededLimitFeatures=true&sqlFormat=none&f=json' with timeout 3000ms
2021-01-22 21:38:27.023 [TRACE] [ttp.internal.http.RefreshingUrlCache] - Sending to 'https://services7.arcgis.com/mOBPykOjAyBO2ZKk/arcgis/rest/services/DIVI_Intensivregister_Landkreise/FeatureServer/0/query?where=BL_ID=3&returnGeodetic=false&outFields=*&returnGeometry=false&returnCentroid=false&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&outStatistics=%255B%257B%2522statisticType%2522%253A%2522sum%2522%252C%2522onStatisticField%2522%253A%2522faelle_covid_aktuell%2522%252C%2522outStatisticFieldName%2522%253A%2522faelle_covid_aktuell%2522%257D%252C%257B%2522statisticType%2522%253A%2522sum%2522%252C%2522onStatisticField%2522%253A%2522faelle_covid_aktuell_beatmet%2522%252C%2522outStatisticFieldName%2522%253A%2522faelle_covid_aktuell_beatmet%2522%257D%252C%257B%2522statisticType%2522%253A%2522sum%2522%252C%2522onStatisticField%2522%253A%2522betten_frei%2522%252C%2522outStatisticFieldName%2522%253A%2522betten_frei%2522%257D%252C%257B%2522statisticType%2522%253A%2522sum%2522%252C%2522onStatisticField%2522%253A%2522betten_gesamt%2522%252C%2522outStatisticFieldName%2522%253A%2522betten_gesamt%2522%257D%252C%257B%2522statisticType%2522%253A%2522sum%2522%252C%2522onStatisticField%2522%253A%2522anzahl_standorte%2522%252C%2522outStatisticFieldName%2522%253A%2522anzahl_standorte%2522%257D%252C%257B%2522statisticType%2522%253A%2522max%2522%252C%2522onStatisticField%2522%253A%2522daten_stand%2522%252C%2522outStatisticFieldName%2522%253A%2522daten_stand%2522%257D%255D&returnZ=false&returnM=false&returnExceededLimitFeatures=true&sqlFormat=none&f=json': Method = {GET}, Headers = {Accept-Encoding: gzip, User-Agent: Jetty/9.4.20.v20190813}, Content = {null}
2021-01-22 21:38:27.182 [TRACE] [p.internal.http.HttpResponseListener] - Received from 'https://services7.arcgis.com/mOBPykOjAyBO2ZKk/arcgis/rest/services/DIVI_Intensivregister_Landkreise/FeatureServer/0/query?where=BL_ID=3&returnGeodetic=false&outFields=*&returnGeometry=false&returnCentroid=false&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&outStatistics=%255B%257B%2522statisticType%2522%253A%2522sum%2522%252C%2522onStatisticField%2522%253A%2522faelle_covid_aktuell%2522%252C%2522outStatisticFieldName%2522%253A%2522faelle_covid_aktuell%2522%257D%252C%257B%2522statisticType%2522%253A%2522sum%2522%252C%2522onStatisticField%2522%253A%2522faelle_covid_aktuell_beatmet%2522%252C%2522outStatisticFieldName%2522%253A%2522faelle_covid_aktuell_beatmet%2522%257D%252C%257B%2522statisticType%2522%253A%2522sum%2522%252C%2522onStatisticField%2522%253A%2522betten_frei%2522%252C%2522outStatisticFieldName%2522%253A%2522betten_frei%2522%257D%252C%257B%2522statisticType%2522%253A%2522sum%2522%252C%2522onStatisticField%2522%253A%2522betten_gesamt%2522%252C%2522outStatisticFieldName%2522%253A%2522betten_gesamt%2522%257D%252C%257B%2522statisticType%2522%253A%2522sum%2522%252C%2522onStatisticField%2522%253A%2522anzahl_standorte%2522%252C%2522outStatisticFieldName%2522%253A%2522anzahl_standorte%2522%257D%252C%257B%2522statisticType%2522%253A%2522max%2522%252C%2522onStatisticField%2522%253A%2522daten_stand%2522%252C%2522outStatisticFieldName%2522%253A%2522daten_stand%2522%257D%255D&returnZ=false&returnM=false&returnExceededLimitFeatures=true&sqlFormat=none&f=json': Code = {200}, Headers = {Content-Type: text/plain; charset=UTF-8, Content-Length: 199, Connection: keep-alive, Cache-Control: public, max-age=0, s-maxage=0, Content-Encoding: gzip, Server: Microsoft-IIS/10.0, X-ArcGIS-Correlation-Id: |349e999d00e97e499becb8dbba56e5ad.ae6d5a05_, X-ArcGIS-Instance: MTSDS_Web_IN_14, Strict-Transport-Security: max-age=63072000, X-Powered-By: ASP.NET, Access-Control-Allow-Origin: *, Date: Fri, 22 Jan 2021 20:38:27 GMT, Vary: Accept-Encoding, X-Cache: Miss from cloudfront, Via: 1.1 7b39f60eed6e589bf869ce2ecfe6ab8c.cloudfront.net (CloudFront), X-Amz-Cf-Pop: HAM50-C1, X-Amz-Cf-Id: N3eKw4QTz_J12H1UjYrEbxfUd1Xno0MfxvORxg5_3eZJTkrolIMANA==}, Content = {{"error":{"code":400,"message":"","details":["'outStatistics' parameter is invalid"]}}}
That looked pretty messed up on a first glance.
I found the following entry on GitHub,
wich could be a reason for the different behavior.
So I thought I might could get rid of the double % and removed them:
https://services7.arcgis.com/mOBPykOjAyBO2ZKk/arcgis/rest/services/DIVI_Intensivregister_Landkreise/FeatureServer/0/query?where=BL_ID=3&returnGeodetic=false&outFields=*&returnGeometry=false&returnCentroid=false&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&outStatistics=%5B%7B%22statisticType%22%3A%22sum%22%2C%22onStatisticField%22%3A%22faelle_covid_aktuell%22%2C%22outStatisticFieldName%22%3A%22faelle_covid_aktuell%22%7D%2C%7B%22statisticType%22%3A%22sum%22%2C%22onStatisticField%22%3A%22faelle_covid_aktuell_beatmet%22%2C%22outStatisticFieldName%22%3A%22faelle_covid_aktuell_beatmet%22%7D%2C%7B%22statisticType%22%3A%22sum%22%2C%22onStatisticField%22%3A%22betten_frei%22%2C%22outStatisticFieldName%22%3A%22betten_frei%22%7D%2C%7B%22statisticType%22%3A%22sum%22%2C%22onStatisticField%22%3A%22betten_gesamt%22%2C%22outStatisticFieldName%22%3A%22betten_gesamt%22%7D%2C%7B%22statisticType%22%3A%22sum%22%2C%22onStatisticField%22%3A%22anzahl_standorte%22%2C%22outStatisticFieldName%22%3A%22anzahl_standorte%22%7D%2C%7B%22statisticType%22%3A%22max%22%2C%22onStatisticField%22%3A%22daten_stand%22%2C%22outStatisticFieldName%22%3A%22daten_stand%22%7D%5D&returnZ=false&returnM=false&returnExceededLimitFeatures=true&sqlFormat=none&f=json
But this lead to a different Error:
2021-01-22 22:49:16.202 [WARN ] [ttp.internal.http.RefreshingUrlCache] - Creating request for 'https://services7.arcgis.com/mOBPykOjAyBO2ZKk/arcgis/rest/services/DIVI_Intensivregister_Landkreise/FeatureServer/0/query?where=BL_ID=3&returnGeodetic=false&outFields=*&returnGeometry=false&returnCentroid=false&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&outStatistics=%5B%7B%22statisticType%22%3A%22sum%22%2C%22onStatisticField%22%3A%22faelle_covid_aktuell%22%2C%22outStatisticFieldName%22%3A%22faelle_covid_aktuell%22%7D%2C%7B%22statisticType%22%3A%22sum%22%2C%22onStatisticField%22%3A%22faelle_covid_aktuell_beatmet%22%2C%22outStatisticFieldName%22%3A%22faelle_covid_aktuell_beatmet%22%7D%2C%7B%22statisticType%22%3A%22sum%22%2C%22onStatisticField%22%3A%22betten_frei%22%2C%22outStatisticFieldName%22%3A%22betten_frei%22%7D%2C%7B%22statisticType%22%3A%22sum%22%2C%22onStatisticField%22%3A%22betten_gesamt%22%2C%22outStatisticFieldName%22%3A%22betten_gesamt%22%7D%2C%7B%22statisticType%22%3A%22sum%22%2C%22onStatisticField%22%3A%22anzahl_standorte%22%2C%22outStatisticFieldName%22%3A%22anzahl_standorte%22%7D%2C%7B%22statisticType%22%3A%22max%22%2C%22onStatisticField%22%3A%22daten_stand%22%2C%22outStatisticFieldName%22%3A%22daten_stand%22%7D%5D&returnZ=false&returnM=false&returnExceededLimitFeatures=true&sqlFormat=none&f=json' failed: Conversion = 'm'
Last but not least I tried not to use URL Encoding except %22 for "
https://services7.arcgis.com/mOBPykOjAyBO2ZKk/arcgis/rest/services/DIVI_Intensivregister_Landkreise/FeatureServer/0/query?where=BL_ID=3&returnGeodetic=false&outFields=*&returnGeometry=false&returnCentroid=false&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&outStatistics=[{%22statisticType%22:%22sum%22,%22onStatisticField%22:%22faelle_covid_aktuell%22,%22outStatisticFieldName%22:%22faelle_covid_aktuell%22},{%22statisticType%22:%22sum%22,%22onStatisticField%22:%22faelle_covid_aktuell_beatmet%22,%22outStatisticFieldName%22:%22faelle_covid_aktuell_beatmet%22},{%22statisticType%22:%22sum%22,%22onStatisticField%22:%22betten_frei%22,%22outStatisticFieldName%22:%22betten_frei%22},{%22statisticType%22:%22sum%22,%22onStatisticField%22:%22betten_gesamt%22,%22outStatisticFieldName%22:%22betten_gesamt%22},{%22statisticType%22:%22sum%22,%22onStatisticField%22:%22anzahl_standorte%22,%22outStatisticFieldName%22:%22anzahl_standorte%22},{%22statisticType%22:%22max%22,%22onStatisticField%22:%22daten_stand%22,%22outStatisticFieldName%22:%22daten_stand%22}]&returnZ=false&returnM=false&returnExceededLimitFeatures=true&sqlFormat=none&f=json
which ended in:
2021-01-22 22:55:09.772 [WARN ] [ttp.internal.http.RefreshingUrlCache] - Creating request for 'https://services7.arcgis.com/mOBPykOjAyBO2ZKk/arcgis/rest/services/DIVI_Intensivregister_Landkreise/FeatureServer/0/query?where=BL_ID=3&returnGeodetic=false&outFields=*&returnGeometry=false&returnCentroid=false&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&outStatistics= [{%22statisticType%22:%22sum%22,%22onStatisticField%22:%22faelle_covid_aktuell%22,%22outStatisticFieldName%22:%22faelle_covid_aktuell%22},{%22statisticType%22:%22sum%22,%22onStatisticField%22:%22faelle_covid_aktuell_beatmet%22,%22outStatisticFieldName%22:%22faelle_covid_aktuell_beatmet%22},{%22statisticType%22:%22sum%22,%22onStatisticField%22:%22betten_frei%22,%22outStatisticFieldName%22:%22betten_frei%22},{%22statisticType%22:%22sum%22,%22onStatisticField%22:%22betten_gesamt%22,%22outStatisticFieldName%22:%22betten_gesamt%22},{%22statisticType%22:%22sum%22,%22onStatisticField%22:%22anzahl_standorte%22,%22outStatisticFieldName%22:%22anzahl_standorte%22},{%22statisticType%22:%22max%22,%22onStatisticField%22:%22daten_stand%22,%22outStatisticFieldName%22:%22daten_stand%22}]&returnZ=false&returnM=false&returnExceededLimitFeatures=true&sqlFormat=none&f=json' failed: Conversion = '2'
Does anyone has any suggestions on this error?
Should be a problem with the URL encoding, but I did not find the origin of the problem, yet.
Additional Information:
I don’t know if this is important, but I used file based configuration.
Part of the thing-file wich worked under 3.0.0 stable:
Thing http:url:diviintensiv_nds "http DIVI-Intensivregister auf Bundeslandebene" [ baseURL="https:// services7.arcgis.com /mOBPykOjAyBO2ZKk/arcgis/rest/services/DIVI_Intensivregister_Landkreise/FeatureServer/0/query?where=BL_ID=3&returnGeodetic=false&outFields=*&returnGeometry=false&returnCentroid=false&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&outStatistics=%%5B%%7B%%22statisticType%%22%%3A%%22sum%%22%%2C%%22onStatisticField%%22%%3A%%22faelle_covid_aktuell%%22%%2C%%22outStatisticFieldName%%22%%3A%%22faelle_covid_aktuell%%22%%7D%%2C%%0D%%0A%%7B%%22statisticType%%22%%3A%%22sum%%22%%2C%%22onStatisticField%%22%%3A%%22faelle_covid_aktuell_beatmet%%22%%2C%%22outStatisticFieldName%%22%%3A%%22faelle_covid_aktuell_beatmet%%22%%7D%%2C%%0D%%0A%%7B%%22statisticType%%22%%3A%%22sum%%22%%2C%%22onStatisticField%%22%%3A%%22betten_frei%%22%%2C%%22outStatisticFieldName%%22%%3A%%22betten_frei%%22%%7D%%2C%%0D%%0A%%7B%%22statisticType%%22%%3A%%22sum%%22%%2C%%22onStatisticField%%22%%3A%%22betten_gesamt%%22%%2C%%22outStatisticFieldName%%22%%3A%%22betten_gesamt%%22%%7D%%2C%%0D%%0A%%7B%%22statisticType%%22%%3A%%22sum%%22%%2C%%22onStatisticField%%22%%3A%%22anzahl_standorte%%22%%2C%%22outStatisticFieldName%%22%%3A%%22anzahl_standorte%%22%%7D%%2C%%0D%%0A%%7B%%22statisticType%%22%%3A%%22max%%22%%2C%%22onStatisticField%%22%%3A%%22daten_stand%%22%%2C%%22outStatisticFieldName%%22%%3A%%22daten_stand%%22%%7D%%5D&returnZ=false&returnM=false&returnExceededLimitFeatures=true&sqlFormat=none&f=json", refresh=3600] {
Channels:
Type number : anzahl_standorte "Anzahl Standort" [ stateTransformation="JSONPATH:$.features[0].attributes.anzahl_standorte" ]
Type number : betten_frei "Betten frei" [ stateTransformation="JSONPATH:$.features[0].attributes.betten_frei" ]
Type number : betten_gesamt "Betten gesamt" [ stateTransformation="JSONPATH:$.features[0].attributes.betten_gesamt" ]
Type number : faelle_covid_aktuell "Fälle COVID aktuell" [ stateTransformation="JSONPATH:$.features[0].attributes.faelle_covid_aktuell" ]
Type number : faelle_covid_aktuell_beatmet "Fälle COVID aktuell beatmet" [ stateTransformation="JSONPATH:$.features[0].attributes.faelle_covid_aktuell_beatmet" ]
Type string : daten_stand "Datenstand" [ stateTransformation="JSONPATH:$.features[0].attributes.daten_stand" ]
}
Part of the item-file:
Number diviintensiv_nds_anzahl_standorte "Anzahl Standort [%,d]" <krankenhaus> (gpDiviIntensivBL) {channel="http:url:diviintensiv_nds:anzahl_standorte"}
Number diviintensiv_nds_betten_frei "Betten frei [%,d]" <krankenhausbett> (gpDiviIntensivBL) {channel="http:url:diviintensiv_nds:betten_frei"}
Number diviintensiv_nds_betten_gesamt "Betten gesamt [%,d]" <krankenhausbett> (gpDiviIntensivBL) {channel="http:url:diviintensiv_nds:betten_gesamt"}
Number diviintensiv_nds_faelle_covid_aktuell "Fälle COVID aktuell [%,d]" <intensivist> (gpDiviIntensivBL) {channel="http:url:diviintensiv_nds:faelle_covid_aktuell"}
Number diviintensiv_nds_faelle_covid_aktuell_beatmet "Fälle COVID aktuell beatmet [%,d]" <koma> (gpDiviIntensivBL) {channel="http:url:diviintensiv_nds:faelle_covid_aktuell_beatmet"}
String diviintensiv_nds_daten_stand "Datenstand [%s]" <covid> (gpDiviIntensivBL) {channel="http:url:diviintensiv_nds:daten_stand"}
Edit: Fixed the format. Using the right code-tags.