• 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.

How to use Yr as a weather provider

Scheduled Pinned Locked Moved Solved Troubleshooting
12 Posts 3 Posters 1.4k 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.
  • M Offline
    MajorC Project Sponsor
    last edited by Jan 14, 2023, 10:30 AM

    Hi,

    I would like to use the new v2.22.0 feature of Yr as weather provider.

    I changed

    weatherProvider: "yr",
    

    I think I need a new apiKey. What about the location and locatioID?

    Any advise are appreciated.

    Thank you

    K 1 Reply Last reply Jan 14, 2023, 11:59 AM Reply Quote 0
    • K Offline
      karsten13 @MajorC
      last edited by Jan 14, 2023, 11:59 AM

      @MajorC

      see https://github.com/MichMich/MagicMirror-Documentation/pull/134/files

      will hopefully soon merged into official documentation (there are merge conflicts …)

      K 1 Reply Last reply Jan 14, 2023, 10:10 PM Reply Quote 1
      • K Offline
        karsten13 @karsten13
        last edited by Jan 14, 2023, 10:10 PM

        as follow up: That was merged today so you find it now in the offical documentation https://docs.magicmirror.builders/modules/weather.html#yr-options

        M 1 Reply Last reply Sep 23, 2023, 2:28 PM Reply Quote 0
        • M Offline
          MajorC Project Sponsor @karsten13
          last edited by MajorC Sep 23, 2023, 2:29 PM Sep 23, 2023, 2:28 PM

          @karsten13

          My config looks like this:

          {
          			module: "weather",
          			position: "top_right",
          			config: {
          				showHeader: true,
          				weatherProvider: "yr",
          				type: "current",
          				lat: "52.5544",
          				lon: "13.4635",
          				roundTemp: true,
          			}
          		},
          

          But the mirror only says “loading…” all the time.

          Any ideas how to deal with that? I use MM v2.24.0

          S 1 Reply Last reply Sep 23, 2023, 2:29 PM Reply Quote 0
          • S Offline
            sdetweil @MajorC
            last edited by sdetweil Sep 23, 2023, 2:33 PM Sep 23, 2023, 2:29 PM

            @MajorC said in How to use Yr as a weather provider:

              		type: "current",
              		lat: "52.5544",
              		lon: "13.4635",
            

            numbers and true/false do not use quotes…

            open the developers window, ctrl-shift-i on the MM page,
            select the console tab and put,

            wea 
            

            in the filter field to see only messages from the weather module

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            M 1 Reply Last reply Sep 23, 2023, 2:55 PM Reply Quote 0
            • M Offline
              MajorC Project Sponsor @sdetweil
              last edited by MajorC Sep 23, 2023, 2:56 PM Sep 23, 2023, 2:55 PM

              @sdetweil you are absolute right. But still:

              yr.js:311 Could not load weather data. SyntaxError: Unexpected non-whitespace character after JSON at position 4 (line 1 column 5)
                  at JSON.parse (<anonymous>)
                  at performWebRequest (utils.js:27:29)
              (anonymous) @ yr.js:311
              Promise.catch (async)
              getStellarDataFromYr @ yr.js:310
              getStellarDataFromYrOrCache @ yr.js:268
              (anonymous) @ yr.js:231
              getStellarData @ yr.js:213
              getCurrentWeather @ yr.js:47
              fetchCurrentWeather @ yr.js:35
              (anonymous) @ weather.js:190
              setTimeout (async)
              scheduleUpdate @ weather.js:187
              start @ weather.js:99
              startModules @ loader.js:25
              loadNextModule @ loader.js:218
              await in loadNextModule (async)
              loadNextModule @ loader.js:211
              await in loadNextModule (async)
              loadNextModule @ loader.js:211
              await in loadNextModule (async)
              loadNextModule @ loader.js:211
              await in loadNextModule (async)
              loadNextModule @ loader.js:211
              await in loadNextModule (async)
              loadNextModule @ loader.js:211
              await in loadNextModule (async)
              loadNextModule @ loader.js:211
              await in loadNextModule (async)
              loadNextModule @ loader.js:211
              await in loadNextModule (async)
              loadNextModule @ loader.js:211
              await in loadNextModule (async)
              loadNextModule @ loader.js:211
              await in loadNextModule (async)
              loadNextModule @ loader.js:211
              await in loadNextModule (async)
              loadNextModule @ loader.js:211
              await in loadNextModule (async)
              loadNextModule @ loader.js:211
              await in loadNextModule (async)
              loadNextModule @ loader.js:211
              await in loadNextModule (async)
              loadNextModule @ loader.js:211
              await in loadNextModule (async)
              loadModules @ loader.js:221
              init @ main.js:471
              await in init (async)
              (anonymous) @ main.js:593
              yr.js:285 Error: SyntaxError: Unexpected non-whitespace character after JSON at position 4 (line 1 column 5)
                  at yr.js:312:11
              (anonymous) @ yr.js:285
              Promise.catch (async)
              getStellarDataFromYrOrCache @ yr.js:284
              (anonymous) @ yr.js:231
              getStellarData @ yr.js:213
              getCurrentWeather @ yr.js:47
              fetchCurrentWeather @ yr.js:35
              (anonymous) @ weather.js:190
              setTimeout (async)
              scheduleUpdate @ weather.js:187
              start @ weather.js:99
              startModules @ loader.js:25
              loadNextModule @ loader.js:218
              await in loadNextModule (async)
              loadNextModule @ loader.js:211
              await in loadNextModule (async)
              loadNextModule @ loader.js:211
              await in loadNextModule (async)
              loadNextModule @ loader.js:211
              await in loadNextModule (async)
              loadNextModule @ loader.js:211
              await in loadNextModule (async)
              loadNextModule @ loader.js:211
              await in loadNextModule (async)
              loadNextModule @ loader.js:211
              await in loadNextModule (async)
              loadNextModule @ loader.js:211
              await in loadNextModule (async)
              loadNextModule @ loader.js:211
              await in loadNextModule (async)
              loadNextModule @ loader.js:211
              await in loadNextModule (async)
              loadNextModule @ loader.js:211
              await in loadNextModule (async)
              loadNextModule @ loader.js:211
              await in loadNextModule (async)
              loadNextModule @ loader.js:211
              await in loadNextModule (async)
              loadNextModule @ loader.js:211
              await in loadNextModule (async)
              loadNextModule @ loader.js:211
              await in loadNextModule (async)
              loadModules @ loader.js:221
              init @ main.js:471
              await in init (async)
              (anonymous) @ main.js:593
              yr.js:41 Unable to get stellar data from Yr.
              (anonymous) @ yr.js:41
              Promise.catch (async)
              fetchCurrentWeather @ yr.js:40
              (anonymous) @ weather.js:190
              setTimeout (async)
              scheduleUpdate @ weather.js:187
              start @ weather.js:99
              startModules @ loader.js:25
              loadNextModule @ loader.js:218
              await in loadNextModule (async)
              loadNextModule @ loader.js:211
              await in loadNextModule (async)
              loadNextModule @ loader.js:211
              await in loadNextModule (async)
              loadNextModule @ loader.js:211
              await in loadNextModule (async)
              loadNextModule @ loader.js:211
              await in loadNextModule (async)
              loadNextModule @ loader.js:211
              await in loadNextModule (async)
              loadNextModule @ loader.js:211
              await in loadNextModule (async)
              loadNextModule @ loader.js:211
              await in loadNextModule (async)
              loadNextModule @ loader.js:211
              await in loadNextModule (async)
              loadNextModule @ loader.js:211
              await in loadNextModule (async)
              loadNextModule @ loader.js:211
              await in loadNextModule (async)
              loadNextModule @ loader.js:211
              await in loadNextModule (async)
              loadNextModule @ loader.js:211
              await in loadNextModule (async)
              loadNextModule @ loader.js:211
              await in loadNextModule (async)
              loadNextModule @ loader.js:211
              await in loadNextModule (async)
              loadModules @ loader.js:221
              init @ main.js:471
              await in init (async)
              (anonymous) @ main.js:593
              yr.js:42 Uncaught (in promise) Error: Unable to get stellar data from Yr.
                  at yr.js:42:11
              

              with config:

              	{
              			module: "weather",
              			position: "top_right",
              			config: {
              				showHeader: true,
              				weatherProvider: "yr",
              				type: "current",
              				lat: 52.5544,
              				lon: 13.4635,
              				//roundTemp: true
              			}
              		},
              

              ![alt text](c76fa3d6-3ee0-4a86-af34-ab263cea8040-image.png image url)

              S 1 Reply Last reply Sep 23, 2023, 3:00 PM Reply Quote 0
              • S Offline
                sdetweil @MajorC
                last edited by sdetweil Sep 23, 2023, 3:01 PM Sep 23, 2023, 3:00 PM

                @MajorC the api returned data the module did not expect and did not handle the error…

                the exact cause of the error is unknown as the code did not report it…

                i have seen quite a lot of sloppy api programming lately…

                the rules are pretty clear

                rc=200 means all good
                other errors 300/400/500 families provide specific info

                but a lot of apis return 200 even for error cases and THEN the code has to decode the TEXT of the ‘good’ data message…

                sloppy, lazy…

                because the error calls out an ‘unexpected non-whitepace’ (a colon maybe) , I suspect this api is one of these

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                M 1 Reply Last reply Sep 23, 2023, 4:47 PM Reply Quote 0
                • M Offline
                  MajorC Project Sponsor @sdetweil
                  last edited by MajorC Sep 23, 2023, 4:47 PM Sep 23, 2023, 4:47 PM

                  @sdetweil so I have to use an other weather provider? I really like Yr. They are very precise for Europe.

                  S 1 Reply Last reply Sep 23, 2023, 4:48 PM Reply Quote 0
                  • S Offline
                    sdetweil @MajorC
                    last edited by Sep 23, 2023, 4:48 PM

                    @MajorC not what I said… its broken as you are using it, but I don’t know why. I am not the provider author… you can post an issue to the MM github page…

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

                    K 1 Reply Last reply Sep 23, 2023, 5:26 PM Reply Quote 0
                    • K Offline
                      karsten13 @sdetweil
                      last edited by Sep 23, 2023, 5:26 PM

                      @sdetweil

                      see https://github.com/MichMich/MagicMirror/issues/3189

                      yr has changed api, the fix comes with next release on Oct.

                      S 1 Reply Last reply Sep 23, 2023, 7:36 PM 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