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

MMM-DynamicWeather Failed getting api: 401

Scheduled Pinned Locked Moved Solved Troubleshooting
21 Posts 4 Posters 798 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.
  • W Offline
    wishmaster270 Module Developer @JohnGalt
    last edited by Oct 26, 2024, 7:01 PM

    @JohnGalt
    Hi,

    this module uses the old OpenWeater Map Api in version 2.5 to get the current weather.
    This version of the Api stopped working recently.
    The module needs to be migrated to the new version 3 Api.
    As the data is returned in nearly the same format as before it might be enough to change the version in the hard coded Url of 2.5 to 3.

    You will also need to get a new Api key for the new version. You will need to provide credit card information but 1000 calls a day a free.

    J 1 Reply Last reply Oct 27, 2024, 4:51 AM Reply Quote 1
    • J Offline
      JohnGalt @wishmaster270
      last edited by Oct 27, 2024, 4:51 AM

      @wishmaster270 – Thanks for the quick reply. I do already have the ver 3.0 API key, so I guess we will see if the module gets updated.

      Meanwhile, would you happen to already know where the 2.5 call is hard-coded? I’d be willing to tinker and see if I can get it to work while waiting for an/the update to accommodate ver 3.0 APIs.

      W 1 Reply Last reply Oct 27, 2024, 8:26 PM Reply Quote 0
      • W Offline
        wishmaster270 Module Developer @JohnGalt
        last edited by Oct 27, 2024, 8:26 PM

        @JohnGalt
        Hi,

        you will need to change line 108 in MMM-DynamicWeather.js and line 130 in MMM-DynamicWeather.ts.

        Both show this at the moment:

        this.url = "https://api.openweathermap.org/data/2.5/weather?appid=" + this.config.api_key; 
        

        And you will need to change it to:

        this.url = "https://api.openweathermap.org/data/3.0/onecall?appid=" + this.config.api_key;
        

        But no guarantee this will work.

        K J 2 Replies Last reply Oct 28, 2024, 12:23 AM Reply Quote 0
        • K Offline
          KristjanESPERANTO Module Developer @wishmaster270
          last edited by Oct 28, 2024, 12:23 AM

          I created a PR to switch to the new API :-)

          https://github.com/scottcl88/MMM-DynamicWeather/pull/52

          S 1 Reply Last reply Oct 28, 2024, 3:19 AM Reply Quote 0
          • S Offline
            sdetweil @KristjanESPERANTO
            last edited by Oct 28, 2024, 3:19 AM

            @KristjanESPERANTO so, he could checkout your pr
            in the module folder

            git fetch origin pull/52/head:with_30_apikey
            

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            J 1 Reply Last reply Oct 28, 2024, 11:14 PM Reply Quote 0
            • J Offline
              JohnGalt @wishmaster270
              last edited by Oct 28, 2024, 11:12 PM

              @wishmaster270 --Thanks! I appreciate the effort, but it didn’t work for me. I will wait for your PR to go thru…

              1 Reply Last reply Reply Quote 0
              • J Offline
                JohnGalt @sdetweil
                last edited by Oct 28, 2024, 11:14 PM

                @sdetweil – Thanks, Sam.

                If I want to try this, can I just do it in the module folder now, or do I go back in there first and undo the edits I performed manually? I’m not clear on whether it does or doesn’t make a difference.

                S 1 Reply Last reply Oct 28, 2024, 11:25 PM Reply Quote 0
                • S Offline
                  sdetweil @JohnGalt
                  last edited by sdetweil Oct 28, 2024, 11:27 PM Oct 28, 2024, 11:25 PM

                  @JohnGalt in the module folder

                  if you made file changes, you should revert those first

                  git reset --hard HEAD 
                  

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  J 1 Reply Last reply Oct 29, 2024, 10:20 PM Reply Quote 0
                  • J Offline
                    JohnGalt @sdetweil
                    last edited by Oct 29, 2024, 10:20 PM

                    @sdetweil – I intended to try the above, but the MagicMirror indicated it was due for an update, so I ran your update script first… Now it won’t run.

                    Rather than hijacking this thread, I will put the particulars in a new thread.

                    i just didn’t want if to look like I left this one hanging out there…

                    S 1 Reply Last reply Nov 8, 2024, 12:21 PM Reply Quote 0
                    • S Offline
                      sdetweil @JohnGalt
                      last edited by Nov 8, 2024, 12:21 PM

                      @JohnGalt have you resolved this?

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

                      J 1 Reply Last reply Nov 8, 2024, 5:26 PM Reply Quote 0
                      • 1
                      • 2
                      • 3
                      • 1 / 3
                      • 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