kizniche / Mycodo

An environmental monitoring and regulation system
http://kylegabriel.com/projects/
GNU General Public License v3.0
3k stars 500 forks source link

OpenWeatherMap (Lat/Lon, Current/Future) with Lat/Lon issue #1300

Closed pe2269 closed 1 year ago

pe2269 commented 1 year ago

Describe the problem/bug

Wen i add OpenWeatherMap (Lat/Lon, Current/Future) in Mycodo inputs.

The url create ( see in the mycodo logs) is like : https://api.openweathermap.org/data/2.5/onecall?lat={lat}&lon={lon}&units=metric&appid={API key})&exclude=minutely,hourly,daily,alerts

but it return

Response: {'cod': 401, 'message': 'Invalid API key. Please see https://openweathermap.org/faq#error401 for more info.'}

The issue is in the url, instead of onecall?, weather? works

ex: https://api.openweathermap.org/data/2.5/weather?lat={lat}&lon={lon}&units=metric&appid={API key})&exclude=minutely,hourly,daily,alerts

Versions: