Open euphi opened 4 years ago
Had same issues like this at the beginning. @euphi can you please check the query result without filter next time you have an active warning for Fürth in your app, by querying following URL:
Then please do a fulltext search for Fürth on the xml-result to compare CellIDs to the ones of warning,json.
In my case "Nürnberger Land->Leinburg" there always is no warning for Nürnberger Land but only for Leinburg and concret neighbor towns, which makes sence for querying Warnungen_Gemeinden in my opinion.
The XML-results should exactly contains the same content as displayed on this side: https://www.dwd.de/DE/wetter/warnungen_gemeinden/warntabellen/warntab_bay_node.html which although differs from the information inside the warnings.json.
As a concret example at the moment in warning.json there is a active "DAUERREGEN"-Warning for the "Kreis Nürnberger Land (109574000)" but not in binding results. But when you look at the map of DWD you can see only the north of the Landkreis has active warning.
Which can be although seen on the page mentioned above. For example "Lauf a.d. Pegnitz (809574138)" and Leinburg(809574139) has neither results on this page nor for the binding request, but "Hersbruck (809574132)" which is more north gives results on the page as well as in binding query.
Conclusion: It is a bit tricky to find really the "smallest" cell, which is the only one reported by the binding request and not the huger areas around. But it is the one with most concret information about your local warning situation.
Maybe the binding can be changed to accept "Kreis"-CellIDs as well by requesting another filter:
Unfortunately for changing my system to OH3 at the moment I don't have the time at the moment to dive deeper into bindings code, but maybe someone else can give it a try with this information.
Last comment is allmost 3,5 years old. Would be nice if anyone can verify if this is still relevant in current 4.2 snapshot / last milestone.
The dwdunwetter binding queries the DWD API by using a CQL query to match a cell id.
This is not reliable, because even if a warning is active within a cell, the query may return 0 results.
Details (see https://community.openhab.org/t/dwd-unwetter-warnungen-no-values/93847/13)
Steps to reproduce:
Thing dwdunwetter:dwdwarnings:fuerth "Unwetterwarnung Fürth" @ "Außen" [ cellId="909573999", warningCount=3, refresh=15 ]
items:
Analysis:
While the warning was active in https://www.dwd.de/DWD/warnungen/warnapp/json/warnings.json, I tried a manual query for the cell id (https://maps.dwd.de/geoserver/dwd/ows?service=WFS&version=2.0.0&request=GetFeature&typeName=dwd:Warnungen_Gemeinden&CQL_FILTER=WARNCELLID+LIKE+%27909573999%27) that returned 0 results:
<wfs:FeatureCollection numberMatched="0" numberReturned="0" timeStamp="2020-06-03T18:01:26.311Z" xsi:schemaLocation="http://www.dwd.de https://maps.dwd.de/geoserver/dwd/wfs?service=WFS&version=2.0.0&request=DescribeFeatureType&typeName=dwd%3AWarnungen_Gemeinden http://www.opengis.net/wfs/2.0 https://maps.dwd.de/geoserver/schemas/wfs/2.0/wfs.xsd http://www.opengis.net/gml/3.2 https://maps.dwd.de/geoserver/schemas/gml/3.2.1/gml.xsd"/>
I later tried a query for another cell in another region with active warnings in in that case the warning was loaded correctly.
I also tried to use cell id 109563000 (Stadt Fürth, the cell 909573999 is "Stadt und Landkreis Fürth", so cell 109563000 is completely within 909573999). The active warning fully covered this cell id, there was also no result.
While the warning was active, it was shown on the website not for the complete region of the cell, but only for the southern part of the cell.
Conclusion: The cell id is not reliable to be used to query for warnings. There shall be another way, e.g. query for region.