Hallo 

i have  from weather365
try:
   import Queue as queue                   # python 2
   from urllib import urlencode            # python 2
   from urllib2 import Request             # python 2
except ImportError:
   import queue                            # python 3
   from urllib.parse import urlencode      # python 3
   from urllib.request import Request      # python 3


import and in def Format_url

    def format_url(self, record):
        data = self.convert_data(record)
        url_data = urlencode(data).encode('utf-8')
        url = '%s/%s?%s' % (self.server_url, self.api_key, url_data)
        if weewx.debug >= 2:
            logdbg('url: %s' % re.sub(r"api_key=.*", "api_key=XXX", url))
        return url
the result
Apr 17 08:45:27 wetter OWFS[29611]: vantage: Catch up complete.
Apr 17 08:45:27 wetter OWFS[29611]: restx: Windy: url: 
https://stations.windy.com/pws/update/F.KEY..SXotj0vR2l
?b'station=0&dateutc=2019-04-17+06%3A45%3A00&temp=7.444444444444445&wind=2.2352055573575282&winddir=67.5&gust=4.023370003243551&rh=63.0&dewpoint=0.8621488467080043&pressure=1019.9349670983149&baromin=1026.481978700465&precip=0.0&uv=0.5'
Apr 17 08:45:27 wetter OWFS[29611]: restx: WindFinder .....

Apr 17 08:45:36 wetter OWFS[29611]: manager: Daily summary version is 2.0
Apr 17 08:45:37 wetter OWFS[29611]: restx: Windy: Failed upload attempt 3: 
HTTP Error 400: Bad Request
Apr 17 08:45:37 wetter OWFS[29611]: restx: Windy: Failed to publish record 
2019-04-17 08:45:00 CEST (1555483500): Failed upload after 3 tries
Apr 17 08:45:38 wetter OWFS[29611]: imagegenerator: Generated 54 images for 
StandardReport in 2.30 seconds

I will continue testing
Hartmut

Reply via email to