Skip to content

Weather examples don't work for newly-created OpenWeatherMap accounts #2

Open
@blakeNaccarato

Description

@blakeNaccarato

See domoticz/domoticz#5336 (comment) for this problem affecting another project as well. Basically, only the following URL works for newly-created accounts:

https://api.openweathermap.org/data/2.5/weather?lat=40&lon=-115&appid=$appid 

this URL differs from the URL in the tutorial in that onecall is replaced with weather. I think the URL above should work for old and new accounts alike.

But this may break again some day as well. If OpenWeatherMap fully shuts down their 2.5 API, as the onecall API requires users to follow this process (scroll to bottom of page, reply by Uwe Jacobs), which requires a credit card and a billing subscription even though you're signing up for the "free" plan. If this tutorial eventually has to go down that path (well, an alternative should be found in that case), then users should be instructed to set their billing limit to 1000 calls so that their credit card won't get charged for excess calls.

For now, swapping out onecall for weather in the URL should work, but you may want to try this on an old OpenWeatherMap account (over a year old) and a newly-created account just in case! The result of the API call is the following, so if the tutorial uses other keys not present here, the actual tutorial contents may need modification as well:

{ "coord": { "lon": -115, "lat": 40 }, "weather": [ { "id": 800, "main": "Clear", "description": "clear sky", "icon": "01d" } ], "base": "stations", "main": { "temp": 296.68, "feels_like": 295.48, "temp_min": 296.68, "temp_max": 296.68, "pressure": 1014, "humidity": 15, "sea_level": 1014, "grnd_level": 817 }, "visibility": 10000, "wind": { "speed": 4.37, "deg": 239, "gust": 5.02 }, "clouds": { "all": 6 }, "dt": 1697491946, "sys": { "country": "US", "sunrise": 1697464268, "sunset": 1697504381 }, "timezone": -25200, "id": 5707899, "name": "Rock House", "cod": 200 } 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      close