MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord
    MagicMirror² v2.24.0 is available! For more information about this release, check out this topic.

    MM 2.11.0 Invalid Date error with weather module

    Troubleshooting
    weather invalid date
    2
    6
    358
    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.
    • Jarhead96097
      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
        sdetweil @Jarhead96097 last edited by

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

        Sam

        Create a working config
        How to add modules

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

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

          Jarhead96097

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

              Create a working config
              How to add modules

              Jarhead96097 1 Reply Last reply Reply Quote 1
              • Jarhead96097
                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 Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
                This forum is using NodeBB as its core | Contributors
                Contact | Privacy Policy