• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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.

Hourly weather showing up as undefined location

Scheduled Pinned Locked Moved Solved Troubleshooting
14 Posts 3 Posters 3.1k Views 3 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
    rejas Module Developer @jimmy_382837
    last edited by Sep 17, 2023, 7:13 AM

    @jimmy_382837 Can not reproduce it. What lat/lon and locationID are you using?

    S 1 Reply Last reply Sep 17, 2023, 11:37 AM Reply Quote 0
    • S Away
      sdetweil @rejas
      last edited by Sep 17, 2023, 11:37 AM

      @rejas he doesn’t have a locationID specified

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      R 1 Reply Last reply Sep 17, 2023, 12:37 PM Reply Quote 0
      • R Offline
        rejas Module Developer @sdetweil
        last edited by Sep 17, 2023, 12:37 PM

        @sdetweil In his first psot he has, just wanted to make sure I get the whole config related to weather.

        J 1 Reply Last reply Sep 17, 2023, 1:20 PM Reply Quote 0
        • J Offline
          jimmy_382837 @rejas
          last edited by Sep 17, 2023, 1:20 PM

          @rejas this is my exact config with the lat / lon below, minus the api key. i pulled the lat / lon off of openweathermap.org’s search for austin, us.

          i didn’t include the locationID, given i thought the module ignored it when on hourly mode.

          {
          	module: "weather",
          	position: "top_right",
          	header: "Hourly Weather Forecast",
          	config: {
          		weatherProvider: "openweathermap",
          		weatherEndpoint: "/onecall",
          		type: "hourly",
          		lat: 30.267,
          		lon: -97.743,
          		apiKey: "xxxxxxxxxx",
          		initialLoadDelay: 5000,
          		maxEntries: 12,
          		roundTemp: true,
          		fade: false
          	}
          },
          
          S 1 Reply Last reply Sep 17, 2023, 2:38 PM Reply Quote 0
          • S Away
            sdetweil @jimmy_382837
            last edited by sdetweil Sep 17, 2023, 2:39 PM Sep 17, 2023, 2:38 PM

            @jimmy_382837 openweathermap requires a location or locationID value

            see the note on the location property

            Screenshot at 2023-09-17 09-37-22.png

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            J 1 Reply Last reply Sep 17, 2023, 2:49 PM Reply Quote 0
            • J Offline
              jimmy_382837 @sdetweil
              last edited by Sep 17, 2023, 2:49 PM

              @sdetweil thanks - and sorry this is a pain and probably stupid user error on my part, but even when i put in a locationID, it still gives me the undefined error.

              
              {
              			module: "weather",
              			position: "top_right",
              			header: "Hourly Weather Forecast",
              			config: {
              				weatherProvider: "openweathermap",
              				weatherEndpoint: "/onecall",
              				type: "hourly",
              				lat: 30.267,
              				lon: -97.743,
              				locationID: 4671654,
              				apiKey: "xxxxxxx",
              				initialLoadDelay: 5000,
              				maxEntries: 12,
              				roundTemp: true,
              				fade: false
              			}
              		},
              
              
              S 1 Reply Last reply Sep 17, 2023, 3:12 PM Reply Quote 0
              • S Away
                sdetweil @jimmy_382837
                last edited by Sep 17, 2023, 3:12 PM

                @jimmy_382837 ok, looking thru the doc, as u picked hourly and and /onecall then locationID is not used…

                so, I would try to make the lat/lon more specific with additional decimal places. the example shows 4, u only have 3. all my code using the onecall api uses 6

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                J 1 Reply Last reply Sep 17, 2023, 3:52 PM Reply Quote 0
                • J Offline
                  jimmy_382837 @sdetweil
                  last edited by Sep 17, 2023, 3:52 PM

                  @sdetweil hmm, extending the lat / lon to 6 decimals doesn’t seem to help either.

                  if i go to the api url directly with the 6 decimal lat / lon and my api key, it does return something, so i know the inputs are working.

                  https://api.openweathermap.org/data/2.5/forecast?lat=30.266666&lon=-97.733330&appid=xxxxxx

                  however, it still is showing up as undefined on the mirror output itself.

                  it seems to be something with the onecall endpoint. if i comment out the endpoint and switch the “type” from hourly to forecast, it works again. but when i switch back to hourly and uncomment the endpoint, it says undefined again.

                  i signed up for an openweather subscription too, as it looked like the one call 3.0 api is only available to subscribers, but that didn’t seem to help either.

                  any other thoughts or ideas? sorry again for the basic questions and thank you for trying to help me troubleshoot this.

                  S 1 Reply Last reply Sep 17, 2023, 4:33 PM Reply Quote 0
                  • S Away
                    sdetweil @jimmy_382837
                    last edited by Sep 17, 2023, 4:33 PM

                    @jimmy_382837 I used your config and my apikey and opened the developers window (ctrl-shift-i) and selected the console tab and see this for hourly

                    https://api.openweathermap.org/data/2.5/onecall?lat=30.267&lon=-97.743&exclude=current,minutely,daily&units=metric&lang=en&APPID=ff733a72afeb5c35xxxxxxxxx757dd 401 (Unauthorized)
                    T https://api.openweathermap.org/data/3/onecall?lat=30.267&lon=-97.743&exclude=current,minutely,daily&units=metric&lang=en&APPID=ff733a72afeb5c35xxxxxxxxx757dd 401 (Unauthorized)

                    hourly is not available on my apikey

                    Screenshot at 2023-09-17 11-31-38.png

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

                    J 1 Reply Last reply Sep 17, 2023, 8:02 PM Reply Quote 0
                    • J Offline
                      jimmy_382837 @sdetweil
                      last edited by Sep 17, 2023, 8:02 PM

                      @sdetweil ah yes, i had to subscribe to the one call 3.0 api and then wait about a half an hour for my api to update. now it works - thanks for helping me troubleshoot!

                      S 1 Reply Last reply Sep 17, 2023, 11:33 PM Reply Quote 0
                      • 1
                      • 2
                      • 1 / 2
                      1 / 2
                      • First post
                        8/14
                        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