Read the statement by Michael Teeuw here.
MMM-EnvCanada stopped working ...
-
@sunsetrider TT
Thanks so much! This really helped me get the weather module backup up and running. -
@sunsetrider just remember that OW has said they will terminate the 2.5 api
June/August/October 2024 (last year) … so remember this config when it fails…
we changed the default config to the new 3.0 api per their annoncements -
@crazylegs I have posted an update on GitHub that works with the new Environment Canada URL convention. I fetch the directory list and look for the most recent forecast xml file for the selected site code and then open the filename found, so I didn’t have to completely rewrite the module. I had issues with my http request to get the directory list that don’t occur when retrieving the xml files – no idea why, but my knowledge of JavaScript is very limited. I found a solution and the module now works.
I agree it looks like we are being pushed to the other API, so it is hard to know how long this approach of fetching an xml document will continue to work. But it works for now.
Comments welcome.
-
@sankum said in MMM-EnvCanada stopped working ...:
Weather module works. It is an issue with MMM-EnvCanada. I opened the issue on github, hoping to get a response from the author of the module. I don’t know how else to get in touch with the author. Thanks.
Glad to hear the main weather module works.
-
@jakabasej4 hmm … I don’t use it, but the author of the provider for the default module support tor Environment Canada posted in this thread that it is also broken. In any case, I have issued an update on GitHub for my MMM-EnvCanada module which supports the new Environment Canada url scheme. Two other users of the module have confirmed it works, so I gave closed the issue.
-
@sdIetweil
Hello:
Thanks for your info.I changed my config file to access apiVersion: 3.0
It does not work for me.
I did not change any other config values in the weather module calls (current and forecast).
Seems someone has updated the envCanada module. I will give it a shot later.
Thanks
MM -
@sunsetrider right. just changing apiVersion back to 3.0 isn’t all that is required…
the endpoints changed, and you now need lat and lon,
and the header location has to be added manually…api 3.0 requires a credit card , and provides 1000 uncharged api request per day.
-
@charlesf I took a quick look at your solution and happy to hear that it works! I agree that being able to preserve all the XML parsing is definitely the way to go. To be honest, I was assuming that your approach (parsing the correct file out of the directory listing) was going to be a massive PITA, but I think you did a very nice job! Congrats!
And if you don’t mind, I hope to lean on your solution to make updates to the envCanada provider code when I get a chance :)
To anyone using the envCanada provider in the default Weather module: I’m the original author of the envCanada provider. I have been traveling and unable to make corrections to the code, but I do hope to get it all working sometime in August (the earlier the better).
-
@crazylegs Thanks. And by all means use as you see fit. I borrowed heavily from your code when I wrote my module 2 years ago.
Perhaps you can educate me: when I fetch the xml file the async process seems to wait till it is done and then the data is available. But if I use the same steps to fetch the directory list, the calling function receives a pending promise. That’s why I implemented the fetching of the xml file within what is effectively a call back - it didn’t work otherwise, but I can’t see what is different between the two cases. But as I said earlier, I don’t know much about this environment - I am am old assembler/C/C++/C# coder from the mists of time.
-
@charlesf is the function for the directory list marked async?? if so, then you could await it