mschlenstedt / LoxBerry-Plugin-Weather4Lox

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

invalid url for openweathermap? #86

Closed mglatz closed 1 year ago

mglatz commented 1 year ago

I believe the url for openweathermap is invalid, specifically the part .../2.5/3.0/... I am not getting any data from openweathermap for some time. I think the correct url should be https://api.openweathermap.org/data/2.5/onecall?appid=XXXXXX&lat=YYY&lon=ZZZ&lang=en&units=metric

================================================================================
<LOGSTART> 20.12.2022 21:30:02 TASK STARTED
<LOGSTART> Weather4Lox GRABBER_OPENWEATHER process started
<INFO> LoxBerry Version 2.2.1.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=50.04248&lon=14.4267
URL: https://api.openweathermap.org/data/2.5/3.0/onecall?appid=XXXXXX&lat=YYY&lon=ZZZ&lang=en&units=metric
Status: 404 Not Found
<CRITICAL> Failed to fetch data for lat=50.04248&lon=14.4267. Status Code: 404
<LOGEND> 20.12.2022 21:30:02 TASK FINISHED
mglatz commented 1 year ago

could we pelase have an option which api version to use? I dont really want to give them my credit card

mschlenstedt commented 1 year ago

No, not possible anymore with API 2.5. Switch to VisualCrossing. It is much better and 100% free.

mglatz commented 1 year ago

Some time ago I made a comparison of weather precision (openweathermap vs weatherbit). Openweathermap gave better results so I'd like to stick with it at least for the current observations. Unfortunately I dont pearl so I can't contribute with reasonable effort but I'd appreciate if you'd consider allowing using owm on old api for current observations. Thank you :)

mschlenstedt commented 1 year ago

Well, it's not me, it's OpenWeatherMap who changed the API and restrict 2.5 API. I cannot change that, even if I want to. I can do nothing about that.

Contact OpenWeatherMap. Or give your payment accounts and restrict your API Key to 1000 calls/day. This way it's still free.

mschlenstedt commented 1 year ago

And as already mentioned: We now support VisualCrossing as Weather Service, which is the best I have ever seen so far. Including full radiation support in current and forecast data and 14 days hourly forecast. And 100% free.

Weatherbit is worse - you are absolutely right. VisualCrossing is not.

mglatz commented 1 year ago

(At least some) of the old endpoints still work, such as this one https://api.openweathermap.org/data/2.5/weather?units=metric&lat={lat}&lon={lon}&appid={OPENWEATHERMAP_API_KEY}