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 13.9k 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.
    • E Offline
      erik.voznak
      last edited by

      Hey Guys,

      After latest update of MagicMirror (v2.12.0) module weatherforecast is showing only two day forecast no matter what I configure in “maxNumberOfDays” option.

      Can you please help me? I tried to search for any errors in logs regarding this module or api response, but I wasn`t lucky.
      Below is my config for this module and screenshot to show that it shows only two days.

      {
      module: “weatherforecast”,
      position: “top_right”,
      header: “Predpoveď počasia”,
      config: {
      lang: “sk”,
      location: “Bratislava”,
      locationID: “3060972”, //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
      appid: “6ba6364f776c4927bf2145c8582e8c3c”,
      maxNumberOfDays: “7”,
      colored: “true”,
      fade: “false”,
      fadePoint: “1”,
      showRainAmount: “true”,
      scale: “true”,
      }
      },
      alt text

      lavolp3L 1 Reply Last reply Reply Quote 0
      • lavolp3L Offline
        lavolp3 Module Developer @erik.voznak
        last edited by lavolp3

        @erik-voznak have you tried

        maxNumberOfDays: 7
        

        needs to be a number instead of a string.
        fadePoint as well.
        You need to be careful with the format of the values.
        Look into the readme what format is expected.
        https://docs.magicmirror.builders/modules/weatherforecast.html#configuration-options

        How to troubleshoot modules
        MMM-soccer v2, MMM-AVStock

        E 1 Reply Last reply Reply Quote 0
        • H Offline
          heeroy
          last edited by

          I have the same problem Tryed to change in module config to change numbers of days,tried in weatherforecast.js,always the same Anybody knows how to solve problem?

          1 Reply Last reply Reply Quote 0
          • E Offline
            erik.voznak @lavolp3
            last edited by

            @lavolp3

            tried right now and no change.

            maxNumberOfDays: 7,
            colored: “true”,
            fade: “false”,
            fadePoint: 1,

            lavolp3L 1 Reply Last reply Reply Quote -1
            • lavolp3L Offline
              lavolp3 Module Developer @erik.voznak
              last edited by lavolp3

              @erik-voznak @heeroy

              Have you updated?
              Seems to be fixed in latest release from this morning
              https://github.com/MichMich/MagicMirror/issues/2018

              https://forum.magicmirror.builders/topic/13182/v2-12-0

              How to troubleshoot modules
              MMM-soccer v2, MMM-AVStock

              E 1 Reply Last reply Reply Quote 0
              • E Offline
                erik.voznak @lavolp3
                last edited by erik.voznak

                @lavolp3
                I did update this morning and issue started after update…

                [2020-07-02 13:37:30.638] [LOG] Starting MagicMirror: v2.12.0
                [2020-07-02 13:37:30.651] [LOG] Loading config …

                1 Reply Last reply Reply Quote 0
                • ? Offline
                  A Former User
                  last edited by

                  This post is deleted!
                  1 Reply Last reply Reply Quote 0
                  • O Offline
                    oemel09
                    last edited by

                    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 Reply Quote 9
                    • E Offline
                      erik.voznak @oemel09
                      last edited by

                      @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

                        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 kayakbabeK 2 Replies Last reply Reply Quote 1
                        • S Do not disturb
                          sdetweil @castletonroad
                          last edited by

                          @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 Reply Quote 1
                          • C Offline
                            castletonroad @sdetweil
                            last edited by

                            @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

                              @oemel09 Thanks a lot!

                              1 Reply Last reply Reply Quote 0
                              • D Offline
                                dh1201
                                last edited by

                                Thanks for the ‘quick fix’ - Works perfectly.

                                1 Reply Last reply Reply Quote 0
                                • A Offline
                                  ArthurOff
                                  last edited by

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

                                  S 1 Reply Last reply Reply Quote 0
                                  • S Do not disturb
                                    sdetweil @ArthurOff
                                    last edited by sdetweil

                                    @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 Reply Quote 0
                                    • A Offline
                                      ArthurOff @sdetweil
                                      last edited by

                                      @sdetweil haha, got it!

                                      1 Reply Last reply Reply Quote 0
                                      • D Offline
                                        DavidCarreira @oemel09
                                        last edited by

                                        @oemel09 Thanks, your fix is working fine!

                                        1 Reply Last reply Reply Quote 0
                                        • F Offline
                                          FatTony123
                                          last edited by

                                          @oemel09… yep, just can confirm. This fix works like charm ;-)

                                          1 Reply Last reply Reply Quote 0
                                          • W Offline
                                            Wilfried @oemel09
                                            last edited by

                                            @oemel09 Perfect. Thanks for the workaround.

                                            1 Reply Last reply Reply Quote 0

                                            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                            With your input, this post could be even better 💗

                                            Register Login
                                            • 1
                                            • 2
                                            • 1 / 2
                                            • First post
                                              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