Parser for german DWD (Deutscher Wetterdienst)
Pinned FeaturedHello everybody,
as discussed - among others - here, WeatherUnderground is not giving out any more free API keys. The future of already existing API keys and the associated services is unknown.
Therefore I'm looking for alternatives that do not have parsers yet. Since I'm from germany, I had a look at the OpenData services from the German Meteorological Office ("Deutscher Wetterdienst")/DWD.
I forked the developer ressources repository on GitHub and added the parser to my fork. A pull request is already raised.
If you want to try it, you can just grab the file here. An then upload it to your rainmachine.
You have to enter a stationID. The list of available stations can be found in the DWDs opendata station catalogue:
It's my first python project. So maybe someone more experienced can review the code and add some improvements.
-
Nevermind, figured out that etree.xml is available.
New parser available for testing here: https://github.com/SgtSeppel/rainmachine-developer-resources/blob/master/sdk-parsers/RMParserFramework/parsers/dwd-parser.py
-
Thanks for this project!
I wanted to uploead the .py file from the link above, but get an error message: Error uploading dwd-parser.py
I am not so familiar with py-files. I chose "save target as" and had the py-file on the desktop, but was not able to upload it to my RM.
Any idea what my mistake is?
-
Hello Eric,
I thinks this has nothing to do with the parse itself, but seems to be a generic problem on some (windows) systems.
Additionally, I'd propose to try a different browser.
Also, please make sure that you are uploading the file via a local connection, not via remote.
-
I managed to upload the parser by copying the whole script into an editor and saved it locally. Then I set the station to the closest one.
Everythings seems to be okay, but it does not download data from DWD.
2019-06-07 07:32:18,900 - ERROR - rmParser:133 - *** Error in parser 'DWD Parser' while downloading data from http://opendata.dwd.de/weather/local_forecasts/mos/MOSMIX_L/single_stations/99801/kml/MOSMIX_L_LATEST_99801.kmz, error: HTTP Error 404: Not Found 2019-06-07 07:32:18,913 - WARNING - rmParserManager:181 - * Parser DWD Parser returned no values
-
Hello Eric,
99801 does not seem to be a valid station ID. At least I could not find one with this identifier.
Please make sure that you are using the value from the column "id" in the document under: https://www.dwd.de/DE/leistungen/opendata/help/stationen/mosmix_stationskatalog.cfg?view=nasPublication&nn=16102
It seem as if you are using the first column, "clu".
-
That was my mistake, many thanks!!!
No, the parser can download the data.
But it only seems to work with the default ID. I changed the changed the station to "N2219", but it's does not seem to work:

Here is the relevant part from the py:
lass DWDParser(RMParser):
parserName = "DWD Parser"
parserDescription = "Parser for the german \"Deutscher Wetterdienst\". To get station ID please see: https://www.dwd.de/DE/leistungen/opendata/help/stationen/mosmix_stationskatalog.cfg?view=nasPublication&nn=16102"
parserForecast = True
parserHistorical = True
parserInterval = 6 * 3600
parserDebug = False
params = {"station": "N2219"}
defaultParams = {"station": "10637"}def perform(self):
station = self.params.get("station", None)
if station is None or station == "":
station = "10637"
log.debug("No station set, using Frankfurt am Main (%s)" % station)url = "http://opendata.dwd.de/weather/local_forecasts/mos/MOSMIX_L/single_stations/" + str(station) + "/kml/MOSMIX_L_LATEST_" + str(station) + ".kmz"
try:
datafile = self.openURL(url)
if datafile is None:
self.lastKnownError = "Cannot read data from DWD Service."
return
else:
Please sign in to leave a comment.
Comments
44 comments