How can we help?


Parser for german DWD (Deutscher Wetterdienst)

Pinned Featured

Comments

40 comments

  • Avatar
    Sebastian

    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

    0
    Comment actions Permalink
  • Avatar
    RainMachine Nicholas (Edited )

    Tested seems to work ok. Thanks !

    0
    Comment actions Permalink
  • Avatar
    Eric Selzer

    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?

    0
    Comment actions Permalink
  • Avatar
    Sebastian Kuhn

    Hello Eric, 

     

    I thinks this has nothing to do with the parse itself, but seems to be a generic problem on some (windows) systems.

    Please check this post here.

    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.

     

    0
    Comment actions Permalink
  • Avatar
    Eric Selzer (Edited )

    Thanks, Sebastian.

    I tried several versions. Uploading the .py, .txt, .py.txt without success.

    Also using Chrome or MS Edge instead of Fireworks did not work. :(

    0
    Comment actions Permalink
  • Avatar
    Sebastian Kuhn

    Okay, that's strange. Can you try uploading it and then check the log file for anything related to the parser?

    0
    Comment actions Permalink
  • Avatar
    Eric Selzer

    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
    0
    Comment actions Permalink
  • Avatar
    Sebastian Kuhn

    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".

    0
    Comment actions Permalink
  • Avatar
    Eric Selzer

    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:

    0
    Comment actions Permalink
  • Avatar
    Eric Selzer

    Now, I got it. Seemed to be a windows problem that the alternative station ID could not be saved.

    Now, I changed the ID in the android app. Problem solved.

    0
    Comment actions Permalink

Please sign in to leave a comment.