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.

    MM 2.11.0 Invalid Date error with weather module

    Scheduled Pinned Locked Moved Troubleshooting
    weatherinvalid date
    6 Posts 2 Posters 1.1k Views 2 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.
    • Jarhead96097J Offline
      Jarhead96097
      last edited by

      Hi all, I’m a relative novice but have successfully built MM and upgraded it a couple of times. Recently, I recognized that Openweather wasn’t providing very accurate weather information, for either the current or the forecast. After switching to weathergov and figuring out the correct end points, I noticed an “Invalid date” error on the current weather. Note that I use the weather module for current and forecast weather for two different locations… I only receive the invalid date error for the first location.

      I’ve searched the forums and see similar issues related to much earlier versions of MM. None of them seem to relate directly to this issue.

      I use 24 hour military time and have specified that format for the clock module. Would that have any impact on how the weather module wants to interpret and display time? Would a “spring or summer” sunset time cause the issue? My config.js file is pasted below.

      On an unrelated note… should I use boolean true and false values or place them in quotes?

      Here’s a pic of the error:
      7c75e197-1be2-4622-848b-7588aa3887c3-image.png

      How the heck can I upload my config.js file? Everything I try screws up the formatting so that it’s hard to read and troubleshoot.

      Here’s the code for the weather with the invalid date error:

      	{
      		module: "weather",
      		position: "top_left",
      		classes: "daytime_scheduler",
      		config: {
      			weatherProvider: "weathergov",
      			type: "current",
      			degreeLabel: "true",
      			appendLocationNameToHeader: true,
      			apiBase: "https://api.weather.gov/gridpoints/MFR/",
      			weatherEndpoint: "/forecast/hourly",
      			lat: "104", // "-122.63157",
      			lon: "44", //"41.72403",
      		}
      	},
      

      Thanks in advance,
      Scott

      Jarhead96097

      S 1 Reply Last reply Reply Quote 0
      • S Offline
        sdetweil @Jarhead96097
        last edited by

        @Jarhead96097 if there are true/false values in config, they should not be quoted

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        Jarhead96097J 1 Reply Last reply Reply Quote 1
        • Jarhead96097J Offline
          Jarhead96097 @sdetweil
          last edited by

          @sdetweil thank you. I’ll make the corrections.

          Jarhead96097

          1 Reply Last reply Reply Quote 0
          • Jarhead96097J Offline
            Jarhead96097
            last edited by

            Is there a way for me to check the forecast data from the local weather station? Since I’m only getting the error using the “weathergov” source, and it’s only happening with the first of two weather instances… I’m wondering if the underlying data might be the issue. The only problem with that theory is that the error is constant, across all of the forecasts I’ve received since rebuilding MM using version 2.11.0.

            Jarhead96097

            S 1 Reply Last reply Reply Quote 0
            • S Offline
              sdetweil @Jarhead96097
              last edited by

              @Jarhead96097 you can read the code and try to build the request url string that you could put into the browser on your pc to get the response to examine…

              there are no prebuilt tools for this

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              Jarhead96097J 1 Reply Last reply Reply Quote 1
              • Jarhead96097J Offline
                Jarhead96097 @sdetweil
                last edited by

                @sdetweil Thank you for such quick responses…I do appreciate it! Here’s the link: https://api.weather.gov/gridpoints/MFR/104,44/forecast/hourly and here’s a snippet of the return that includes the dates and times that end up (apparently) causing the invalid date error:

                "properties": {
                    "updated": "2020-06-05T01:18:34+00:00",
                    "units": "us",
                    "forecastGenerator": "HourlyForecastGenerator",
                    "generatedAt": "2020-06-05T04:36:11+00:00",
                    "updateTime": "2020-06-05T01:18:34+00:00",
                    "validTimes": "2020-06-04T19:00:00+00:00/P7DT17H",
                    "elevation": {
                        "value": 868.98480000000006,
                        "unitCode": "unit:m"
                    },
                

                Based on what I can compare against the moment.js documentation, I don’t see anything obvious that would cause the error.

                Jarhead96097

                1 Reply Last reply Reply Quote 0
                • 1 / 1
                • 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