Read the statement by Michael Teeuw here.
MMM-DynamicWeather Failed getting api: 401
-
@JohnGalt
Hi,this module uses the old OpenWeater Map Api in version 2.5 to get the current weather.
This version of the Api stopped working recently.
The module needs to be migrated to the new version 3 Api.
As the data is returned in nearly the same format as before it might be enough to change the version in the hard coded Url of 2.5 to 3.You will also need to get a new Api key for the new version. You will need to provide credit card information but 1000 calls a day a free.
-
@wishmaster270 – Thanks for the quick reply. I do already have the ver 3.0 API key, so I guess we will see if the module gets updated.
Meanwhile, would you happen to already know where the 2.5 call is hard-coded? I’d be willing to tinker and see if I can get it to work while waiting for an/the update to accommodate ver 3.0 APIs.
-
@JohnGalt
Hi,you will need to change line 108 in
MMM-DynamicWeather.js
and line 130 inMMM-DynamicWeather.ts
.Both show this at the moment:
this.url = "https://api.openweathermap.org/data/2.5/weather?appid=" + this.config.api_key;
And you will need to change it to:
this.url = "https://api.openweathermap.org/data/3.0/onecall?appid=" + this.config.api_key;
But no guarantee this will work.
-
I created a PR to switch to the new API :-)
-
@KristjanESPERANTO so, he could checkout your pr
in the module foldergit fetch origin pull/52/head:with_30_apikey
-
@wishmaster270 --Thanks! I appreciate the effort, but it didn’t work for me. I will wait for your PR to go thru…
-
@sdetweil – Thanks, Sam.
If I want to try this, can I just do it in the module folder now, or do I go back in there first and undo the edits I performed manually? I’m not clear on whether it does or doesn’t make a difference.
-
@JohnGalt in the module folder
if you made file changes, you should revert those first
git reset --hard HEAD
-
@sdetweil – I intended to try the above, but the MagicMirror indicated it was due for an update, so I ran your update script first… Now it won’t run.
Rather than hijacking this thread, I will put the particulars in a new thread.
i just didn’t want if to look like I left this one hanging out there…
-
@JohnGalt have you resolved this?