mschlenstedt / LoxBerry-Plugin-Weather4Lox

A LoxBerry Plugin: http://plugins.loxberry.de/plugin/weather4lox/
Apache License 2.0
10 stars 10 forks source link

openweathermap not getting data anymore #83

Closed sennevb1 closed 1 year ago

sennevb1 commented 1 year ago

Openweatherdata is not fetching the data anymore, logs sas 404. But it seems it's using the wrong url:

INFO: LoxBerry Version 2.2.2.2 ( is_vmware.cfg is_x64.cfg ) INFO: Weather 4 Loxone Version 4.10.0.1 INFO: Loglevel: 7 This is /opt/loxberry/bin/plugins/weather4lox/grabber_openweather.pl Version 4.10.0.1 INFO: Fetching Current Data for Location lat=51.1684&lon=5.1717 URL: https://api.openweathermap.org/data/2.5/3.0/onecall?appid=xxxxxxxx&lat=51.1684&lon=5.1717&lang=nl&units=metric Status: 404 Not Found CRITICAL: Failed to fetch data for lat=51.1684&lon=5.1717. Status Code: 404

when i paste in browser and adjust the url to: URL: https://api.openweathermap.org/data/3.0/onecall?appid=xxxxxxxx&lat=51.1684&lon=5.1717&lang=nl&units=metric it works again, so its a faulty url in use here

mschlenstedt commented 1 year ago

You have to do two things:

  1. Update to latest Master: https://github.com/mschlenstedt/LoxBerry-Plugin-Weather4Lox/archive/refs/heads/master.zip
  2. Subscribe to OpenWeatherMap's Onecall API 3.0. It's free for 1000 Calls/day, but you have to give your credit card to them.

Or just switch to (better) weatherservice Visual Crossing.

mwiedemeyer commented 1 year ago

The problem is the config file which contains .../data/2.5/ as the base OPENWEATHER.URL. This does not seem to be overwritten on update, therefore the requests are failing with 404 because of /data/2.5/3.0. After updating the url in ~/config/plugins/weather4lox/weather4lox.cfg to just /data and rebooting it works again.

mschlenstedt commented 1 year ago

Yes, that is why I wrote you should install latest Master. It is already fixed. But nevertheless you need subscription to the OneCall API 3.0

mschlenstedt commented 1 year ago

Fixed