• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

weatherforecast showing only two days.

Scheduled Pinned Locked Moved Troubleshooting
31 Posts 22 Posters 9.2k Views 21 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ? Offline
    A Former User
    last edited by Jul 2, 2020, 5:25 PM

    This post is deleted!
    1 Reply Last reply Reply Quote 0
    • O Offline
      oemel09
      last edited by Jul 2, 2020, 6:35 PM

      Had the same issue after the update.
      The problem is, that the weatherforecast first checks the paid version of the API to get full day forecasts (https://api.openweathermap.org/data/2.5/forecast/daily?id=xxx&cnt=7&units=metric&lang=de&APPID=xxx)

      This results in a 401 for me because I’m using a free API token.

      Next the weatherforecast module falls back using the 5 day / 3 hour Forecast API by using the same cnt value (https://api.openweathermap.org/data/2.5/forecast?id=xxx&cnt=7&units=metric&lang=de&APPID=xxx). Here the value 7 for cnt returns 7 entries, that’s why there is only a two day forecast.

      I’ll try to write a fix.
      In the meantime as a quick fix you can change line 297 of weatherforecast.js from:

      params += "&cnt=" + (this.config.maxNumberOfDays < 1 || this.config.maxNumberOfDays > 17 ? 7 : this.config.maxNumberOfDays);
      

      to

      params += "&cnt=" + (this.config.maxNumberOfDays < 1 || this.config.maxNumberOfDays > 5 ? 40 : this.config.maxNumberOfDays * 8);
      

      Remeber the fallback API provides only a 5 day forecast, that’s why maxNumberOfDays is limited to 5.

      E T D W H 6 Replies Last reply Jul 3, 2020, 6:47 AM Reply Quote 9
      • E Offline
        erik.voznak @oemel09
        last edited by Jul 3, 2020, 6:47 AM

        @hango, yeah I know I shouldn`t but I am using free API so… but anyway I will change appid.

        @oemel09, Many thanks man, your fix helped and finally it is working as intended.

        alt text

        1 Reply Last reply Reply Quote 0
        • C Offline
          castletonroad
          last edited by castletonroad Jul 3, 2020, 10:37 AM Jul 3, 2020, 10:36 AM

          This fix worked for me too, so thanks very much.

          Also, showRainAmount: “false” does not work - i still see mm rain forecast against each day.

          This is all a little disappointing as up until the recent upgrade, ‘weatherforecast’ was working perfectly.

          And BTW, in trying to resolve the problem with ‘weatherforecast’, before coming to this thread, I also tried the ‘weather’ module, the replacement for ‘currentweather’ and ‘weatherforecast’. I couldn’t get that to work in ‘forecast’ mode, only in ‘current’ mode. The module just displays ‘Loading…’.

          Ho-hum…

          S K 2 Replies Last reply Jul 3, 2020, 11:32 AM Reply Quote 1
          • S Offline
            sdetweil @castletonroad
            last edited by Jul 3, 2020, 11:32 AM

            @castletonroad

            how about no quotes

            showRainAmount: false,
            

            values that are all numbers, or true and false do not need quotes
            everything else does need quotes

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            C 1 Reply Last reply Jul 4, 2020, 9:34 AM Reply Quote 1
            • C Offline
              castletonroad @sdetweil
              last edited by Jul 4, 2020, 9:34 AM

              @sdetweil Great, that sorted things nicely!

              How ever did I miss that in the config instructions… :astonished_face:

              1 Reply Last reply Reply Quote 0
              • T Offline
                tenyo @oemel09
                last edited by Jul 5, 2020, 11:44 AM

                @oemel09 Thanks a lot!

                1 Reply Last reply Reply Quote 0
                • D Offline
                  dh1201
                  last edited by Jul 5, 2020, 5:51 PM

                  Thanks for the ‘quick fix’ - Works perfectly.

                  1 Reply Last reply Reply Quote 0
                  • A Offline
                    ArthurOff
                    last edited by Jul 5, 2020, 5:54 PM

                    Will this be fixed in the next update or do we need to adjust manually?

                    S 1 Reply Last reply Jul 5, 2020, 5:55 PM Reply Quote 0
                    • S Offline
                      sdetweil @ArthurOff
                      last edited by sdetweil Jul 6, 2020, 9:36 AM Jul 5, 2020, 5:55 PM

                      @ArthurOff next release (3 months), OR you can use the develop branch now til then, 2.12+.

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

                      A 1 Reply Last reply Jul 5, 2020, 5:56 PM Reply Quote 0
                      • 1
                      • 2
                      • 3
                      • 4
                      • 2 / 4
                      2 / 4
                      • First post
                        11/31
                        Last post
                      Enjoying MagicMirror? Please consider a donation!
                      MagicMirror created by Michael Teeuw.
                      Forum managed by Sam, technical setup by Karsten.
                      This forum is using NodeBB as its core | Contributors
                      Contact | Privacy Policy