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.

    default Weather, current with wethergov issues

    Scheduled Pinned Locked Moved Bug Hunt
    16 Posts 4 Posters 4.2k 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.
    • S Offline
      scumbelly @scumbelly
      last edited by

      @linuxha

      That’s odd. Your wind speed looks like it could be in meters/seconds but it should be about 3.3 @ 7 miles per hour. So, are you using the current weather module or the ‘new’ weather module?

      Cheers

      L 1 Reply Last reply Reply Quote 0
      • L Offline
        linuxha @scumbelly
        last edited by

        @scumbelly , the new weather module, the old is call currentweather and weatherforecast. Those are commented out in my config.

        S 1 Reply Last reply Reply Quote 0
        • S Offline
          scumbelly @linuxha
          last edited by

          @linuxha

          With following set you should get correct weather… except wind chill.

          language: “en”,
          locale: “en-US”,
          logLevel: [“INFO”, “LOG”, “WARN”, “ERROR”], // Add “DEBUG” for even more logging
          timeFormat: 12,
          units: “imperial”,

          		config: {
          			type: "current",
          			weatherProvider: "weathergov", //Default value: openweathermap
          			weatherEndpoint: "/forecast/hourly",
          			degreeLabel: true,
          			showFeelsLike: false,
          			lat:        40.25571,
          			lon:        -74.39416,
          

          No matter what I tried Feels Like came up as 32degrees. The web site shows “wind chill” and openweathermap shows “feels like” and the current.njk translates “FEELS” - DEGREE. I’m scratching my head for now.

          Cheers.

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

            @linxha

            I captured an xml string from your location…

            e28cb8d0-fd62-4197-b794-3ede660df47f-image.png

            <current_observation version=“1.0”
            xmlns:xsd=“http://www.w3.org/2001/XMLSchema”
            xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”
            xsi:noNamespaceSchemaLocation=“http://www.weather.gov/view/current_observation.xsd”>
            NOAA’s National Weather Service
            <credit_URL>http://weather.gov/</credit_URL>

            http://weather.gov/images/xml_logo.gif

            NOAA's National Weather Service http://weather.gov 15 minutes after the hour 60 Belmar-Farmingdale, NJ KBLM 40.18333 -74.13333 Last Updated on Apr 14 2021, 12:56 pm EDT Wed, 14 Apr 2021 12:56:00 -0400 A Few Clouds 70.0 F (21.1 C) 70.0 21.1 39 from the West at 9.2 gusting to 17.3 MPH (8 gusting to 15 KT) West 270 9.2 17.3 8 15 1016.4 mb 1016.4 30.02 44.1 F (6.7 C) 44.1 6.7 10.00 http://forecast.weather.gov/images/wtf/small/ http://www.weather.gov/data/obhistory/KBLM.html few.png http://www.weather.gov/data/METAR/KBLM.1.txt http://weather.gov/disclaimer.html http://weather.gov/disclaimer.html http://weather.gov/notice.html

            … but I saw no ‘wind chill’ or ‘feels like’ information at the time I grabbed the file.

            I’ve gone about as far as I can. Hopefully someone can add more to this for you.

            Cheers.

            L 1 Reply Last reply Reply Quote 0
            • L Offline
              linuxha @scumbelly
              last edited by linuxha

              @scumbelly , huge thanks for the help. What URL did you use to get the XML? For weather.gov, I’ve been seeing JSON.

              I think I’ll toss in a few log statements and see what weather.gov code is using.

              S 1 Reply Last reply Reply Quote 0
              • S Offline
                scumbelly @linuxha
                last edited by

                @linuxha

                https://w1.weather.gov/xml/current_obs/KBLM.xml

                1 Reply Last reply Reply Quote 0
                • L Offline
                  linuxha
                  last edited by

                  I figured out the Feels like being 32F, it’s getting a null in the heat index from weather.gov. I’ve added code to check for null and use the currentWeather.temperature instead. I’ll send diffs later (where do I send them?) when I’ve finished with the windSpeed.

                  		if(currentWeatherData.heatIndex.value) {
                  			currentWeather.feelsLikeTemp = this.convertTemp(currentWeatherData.heatIndex.value);
                  		} else {
                  			// If null, set it to the current temperature
                  			currentWeather.feelsLikeTemp = currentWeather.temperature;
                  		}
                  
                  

                  Sorry it took so long for me to figure out this env. I’m using the browser to debug now. I’ve not done this much. :-)

                  1 Reply Last reply Reply Quote 0
                  • L Offline
                    linuxha
                    last edited by

                    Okay, I see the issue with windSpeed. The URL returns windSpeed in km_h-1 (k/h), the convertSpeed(metSec) function appears to be m/s. I’m not sure how to fix this for general use. I’ll try to fix it for my use first.

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

                      @linuxha google search on conversion says divide the km/h by 3.6 to get m/s

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

                      L 1 Reply Last reply Reply Quote 0
                      • L Offline
                        linuxha @sdetweil
                        last edited by linuxha

                        @sdetweil , thanks, I did find those but I’m also trying to figure out a way so when I change the code it doesn’t break the existing. I’m just giving it thought now.

                        To convert kph to mph: *0.621371. I 'm used to MPH and m/s or kph wouldn’t register with me. I can handle temperatures and distance in metric but not wind speeds.

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