Read the statement by Michael Teeuw here.
Problem with Weather forecast
-
Well… Yesterday I submitted a patch to hack the situation with the new accounts in OpenWeather.
If you can test it will be great!
https://github.com/roramirez/MagicMirror/commit/e8438d37d78acc7a9e29e694a6987ce068324bcd -
Hi Roramirez, brother, it worked! but the day of the week, which should show “Monday” “Tuesday” “Wednesday” … shows everyone how “Sunday” to solve?
Thank you so much… -
@roramirez
Hello Ramirez, I had the same problem. But with your patch I can see the weatherforeast now
Thanks Frank -
Hello, I have exactly the same problem and I am trying to use your patch Ramirez. However, I am coming from the “mechanical world” and I’m new to Linux and GitHub. Could any of you write me how to apply such a patch?
-
@Azrael said in Problem with Weather forecast:
Could any of you write me how to apply such a patch?
You have to edit your weatherforecast.js file. Go to the link for the fix. The line you see highlighted in RED has to be removed (or commented out) of your weatherforecast.js file. The lines you see highlighted in GREEN have to be added in your weatherforecast.js file. The line numbers on the left make it easy for you to find exactly where the edits belong.
-
Thank you Mykle1. Now the weather forecast shows up where it should be.
However, I have exactly the same problem what luizcarlosnery mentioned earlier. Today (Saturday) I see: Sat,Sat,Sat,Sat,Sat,Sun,Sun. -
Sorry to hear that. Until the issues are resolved, you could always try another weather module. There are many to choose from.
Scroll down to the weather category
https://github.com/MichMich/MagicMirror/wiki/MagicMirror²-Modules#3rd-party-modules
-
You see the same day multiple times because this API is a “5 days/3 hour forecast API”, so you won’t get one result per day, but multiple forecasts for one single day with 3 hours between them.
E.g.
Result 1: "2017-09-24 00:00:00" Sunday Result 2: "2017-09-24 03:00:00" Sunday Result 3: "2017-09-24 06:00:00" Sunday
and so on
-
OK, it makes sense.
Is there any option to get only one forecast for one day? Or to display somehow the time periods? -
I made a quick’n’dirty hack to make it only display the weather at noon each day. Around line 340, I added a simple if statement. I’m in UTC+2, so I had to put 14 instead of 12 in the comparison.
this.parserDataWeather(forecast); // hack issue #1017 if ( moment(forecast.dt, "X").format("HH") != "14") continue; //new if statement this.forecast.push({
The limit of 16 no longer means 16 days, but 16 forecasts. Therefore, we need to change the enforced limit, around line 300, I set it to something higher (I chose 57):
params += "&cnt=" + (((this.config.maxNumberOfDays < 1) || (this.config.maxNumberOfDays > 16)) ? 57
Don’t forget to change the value in the actual config to the same number (57 in my case).
I chose 57 to get a full week, but it seems the API won’t return more than 5 days’ worth of data anyway.