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.

    "Invalid Date" appears in Weather module. MM v2.29.0

    Scheduled Pinned Locked Moved Solved Troubleshooting
    25 Posts 5 Posters 6.0k Views 4 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.
    • R Offline
      reilley
      last edited by sdetweil

      Had to rebuild my mirror from scratch after my SSD croaked five months after purchase and my backup USB was corrupted, argh. Most everything works now except for my Weather modules, which are using OpenWeatherMap with API 3.0.

      When current weather loads, I see "Invalid Date where the time should be above the temperature. To add insult to injury, the temp displays as “NaN”. What the heck? Here’s my config:

      {
      			module: 'weather',
      			position: 'top_center',
      			header: 'Current Weather - Canton',
      			config: {
      				weatherProvider: 'openweathermap',
      				appendLocationNameToHeader: false,
      				type: 'current',
      				weatherEndpoint: '/onecall',
      				lat: '34.17188',
      				lon: '-84.57056',
      				apiVersion: '3.0',
      				apiKey: "XXXX"
      			}
      		},
      		{
      			module: 'weather',
      			position: 'top_center',
      			header: 'Forecast - Canton',
      			config: {
      				weatherProvider: 'openweathermap',
      				appendLocationNameToHeader: false,
      				type: 'forecast',
      				weatherEndpoint: '/onecall',
      				lat: '34.17188',
      				lon: '-84.57056',
      				apiVersion: '3.0',
      				apiKey: "XXXX"
      			}
      		},
      

      Units are set to imperial in the config.js file and my Raspberry PI time seems correct.

      Thoughts?

      S C 2 Replies Last reply Reply Quote 0
      • L Offline
        lif @sdetweil
        last edited by

        @sdetweil said in "Invalid Date" appears in Weather module. MM v2.29.0:

        @lif said in "Invalid Date" appears in Weather module. MM v2.29.0:

        > I have tried adding the apiVersion: '2.5'
        > weatherEndpoint: "/weather"
        

        each of those lines had trailing commas, right?

        Not that line but that wasn’t the problem :-)

        Thanks for the link showing how to subscribe to OpenWeathermap which solved the problem.

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

          @reilley I copied your config and used my apikey
          no other changes (well I wrapped your config in code block to keep the quotes correct for copy/paste)

          Screenshot at 2024-12-28 20-22-18.png

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          S R 2 Replies Last reply Reply Quote 0
          • S Do not disturb
            sdetweil @sdetweil
            last edited by

            @reilley this was with the config.js.sample copied as another

            units to imperial
            copy/paste your config over the two weather module entries
            add my apikey

            then

            # use env var to point to other config file
            export MMM_CONFIG_FILE=config/name_of_file.js
            npm start 
            

            Sam

            How to add modules

            learning how to use browser developers window for css changes

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

              @reilley technically you don’t need apiVersion or weatherEndpoint, as those are the defaults.

              Sam

              How to add modules

              learning how to use browser developers window for css changes

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

                @reilley that time is the sunrise or sunset time, sunrise is next, time is correct(in my display)

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                1 Reply Last reply Reply Quote 0
                • R Offline
                  reilley @sdetweil
                  last edited by

                  @sdetweil said in "Invalid Date" appears in Weather module. MM v2.29.0:

                  @reilley I copied your config and used my apikey
                  no other changes (well I wrapped your config in code block to keep the quotes correct for copy/paste)

                  Screenshot at 2024-12-28 20-22-18.png

                  So my code worked for you and the only change was the API key? This key worked two days ago, so not sure what’s happening here.

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

                    @reilley said in "Invalid Date" appears in Weather module. MM v2.29.0:

                    So my code worked for you and the only change was the API key?

                    correct

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

                    R 1 Reply Last reply Reply Quote 0
                    • R Offline
                      reilley @sdetweil
                      last edited by

                      @sdetweil said in "Invalid Date" appears in Weather module. MM v2.29.0:

                      @reilley said in "Invalid Date" appears in Weather module. MM v2.29.0:

                      So my code worked for you and the only change was the API key?

                      correct

                      That’s nuts. Why would an API key work two days ago and not today? Seems like maybe there’s a configuration problem elsewhere but I not sure where it would be since I made no changes to weather.js or other .js files associated with the Weather module.

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

                        @reilley I don’t know… try my approach
                        do

                        cd ~/MagicMirror/config
                        cp config.js.sample  testcfg.js
                        cd ..
                        

                        then edit the testcfg.js and paste your weather info from config.js here
                        then change the units to imperial
                        save
                        then on the terminal window

                        export MM_CONFIG_FILE=config/testcfg.js
                        npm start 
                        

                        Sam

                        How to add modules

                        learning how to use browser developers window for css changes

                        R 1 Reply Last reply Reply Quote 0
                        • R Offline
                          reilley @sdetweil
                          last edited by

                          @sdetweil - nope, same result

                          S R V 3 Replies Last reply Reply Quote 0
                          • S Do not disturb
                            sdetweil @reilley
                            last edited by

                            @reilley ok, next thing

                            weather is done all in browser,
                            on the MagicMirror screen ctrl-shift-i to
                            open the developer window, select the console tab,
                            put wea in the filter field

                            look for any messages

                            Sam

                            How to add modules

                            learning how to use browser developers window for css changes

                            R 1 Reply Last reply Reply Quote 0
                            • R Offline
                              reilley @reilley
                              last edited by

                              @reilley - oh, I think I know what’s wrong now.

                              1 Reply Last reply Reply Quote 0
                              • R Offline
                                reilley @sdetweil
                                last edited by

                                @sdetweil - you’re gonna laugh, but I found the issue. I was using an inactive API key. My backup was too old and was before the v2.29.0 API 3.0 requirement. Sorry to drag you through this!

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

                                  @reilley glad you found it!

                                  Sam

                                  How to add modules

                                  learning how to use browser developers window for css changes

                                  1 Reply Last reply Reply Quote 0
                                  • C Offline
                                    cgillinger @reilley
                                    last edited by cgillinger

                                    @reilley I just realized I experienced something similar, but I was preoccupied with other tasks and didn’t take the time to investigate.

                                    Here’s a screenshot for reference:
                                    https://github.com/cgillinger/MMM-WeatherEffects/blob/main/screenshots/rich.png

                                    Based on my screenshots (as mentioned, I was focused on tweaking the module and only noticed it afterward), it seems to be intermittent.

                                    I’m using api-free providers, eg SMHI.

                                    1 Reply Last reply Reply Quote 0
                                    • V Offline
                                      VinGroot @reilley
                                      last edited by

                                      I have the same issue. These are my settings:

                                        module: "weather",
                                        position: "top_right",
                                        config: {
                                          lat: "52.262524",
                                          lon: "6.797571",        
                                          apiKey: "****",
                                          appendLocationNameToHeader: false,
                                          type: "current",
                                          degreeLabel: true,
                                          decimalSymbol: ",",
                                          showWindDirection: false,
                                          showFeelsLike: false
                                      
                                      S 1 Reply Last reply Reply Quote 0
                                      • S Do not disturb
                                        sdetweil @VinGroot
                                        last edited by

                                        @VinGroot current release is 2.30 . still happening there ?

                                        Sam

                                        How to add modules

                                        learning how to use browser developers window for css changes

                                        V 1 Reply Last reply Reply Quote 0
                                        • V Offline
                                          VinGroot @sdetweil
                                          last edited by

                                          @sdetweil yes, still happening.
                                          just noticed this second page, trouble shooting now. I get a 401 unauthorized error.

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

                                            @VinGroot well 401 means apikey not right

                                            Sam

                                            How to add modules

                                            learning how to use browser developers window for css changes

                                            V 1 Reply Last reply Reply Quote 0
                                            • V Offline
                                              VinGroot @sdetweil
                                              last edited by

                                              I figured it out. I use the free plan, so I cannot use API version 3.0. I have to use API version 2.5. Furthermore I have to use the /weather endpoint.

                                              I got it working again by adding these 2 settings:

                                              apiVersion: '2.5'
                                              weatherEndpoint: "/weather"
                                              
                                              S 1 Reply Last reply Reply Quote 1

                                              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