Announcement

Collapse
No announcement yet.

Openweather: Error retrieving update (401) Unauthorized.)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Openweather: Error retrieving update (401) Unauthorized.)

    just set up but can't get it working. Copied my api key in to the rnbweather setup but log show it will not connect. What am I missing where do I start to verify the connection settings.

    Windows HS4 upgraded from HS3...

    Thanks in advance

    Andy

    Just enabled the log file and it showed this...
    9/10/2022 3:20:29 PM|Debug|Running Openweather poll now...
    9/10/2022 3:20:29 PM|Trace|Base Address:
    9/10/2022 3:20:29 PM|Trace|Encoding Type: Western European (Windows)
    9/10/2022 3:20:29 PM|Trace|User-Agent: HS/4, rnbWeather
    9/10/2022 3:20:29 PM|Trace|Upgrade-Insecure-Requests: 1
    9/10/2022 3:20:29 PM|Trace|Accept-Encoding: gzip, deflate, *
    9/10/2022 3:20:29 PM|Trace|Accept: */*
    9/10/2022 3:20:29 PM|Trace|Cache-Control: max-age=0,no-cache, no-store
    9/10/2022 3:20:30 PM|Trace|401 - Unauthorized
    9/10/2022 3:20:30 PM|Trace|Header > Server : openresty
    9/10/2022 3:20:30 PM|Trace|Header > Date : Sat, 10 Sep 2022 22:20:31 GMT
    9/10/2022 3:20:30 PM|Trace|Header > Content-Type : application/json; charset=utf-8
    9/10/2022 3:20:30 PM|Trace|Header > Content-Length : 107
    9/10/2022 3:20:30 PM|Trace|Header > Connection : keep-alive
    9/10/2022 3:20:30 PM|Trace|Header > X-Cache-Key : /data/2.5/onecall?exclude=minutely&lang=en&lat=33.16&lon=-117.09&units=metric
    9/10/2022 3:20:30 PM|Trace|Header > Access-Control-Allow-Origin : *
    9/10/2022 3:20:30 PM|Trace|Header > Access-Control-Allow-Credentials : true
    9/10/2022 3:20:30 PM|Trace|Header > Access-Control-Allow-Methods : GET, POST
    9/10/2022 3:20:30 PM|Debug|Openweather: retrying in 1 seconds due to a response 7 error: The remote server returned an error: (401) Unauthorized.

    Should there be a base adddress?

    #2
    Don't worry about teh base address being empty for this. i'll reach out to private message as I'll need some of your info to test for you.

    Comment


      #3
      Did you manage to find a solution? I am getting exactly the same issue.

      Thanks

      Comment


        #4
        Originally posted by SGE View Post
        Did you manage to find a solution? I am getting exactly the same issue.

        Thanks
        Hi SGE, I believe I've found the issue. Openweather has made some changes to their service - what they offer and cost vs free and it seems to affect new api keys and accounts.
        I'm just working through a few details with Aundee after which I'll release a new version which should fix the issue for you.

        Comment


          #5
          I also just signed up for OpenWeather, not the "Call by Call", but apparently the Legacy free API? And I'm getting this 401 error. Did you get the fix into a new version?

          Comment


            #6
            Originally posted by KurtLutterman View Post
            I also just signed up for OpenWeather, not the "Call by Call", but apparently the Legacy free API? And I'm getting this 401 error. Did you get the fix into a new version?
            Me Too.

            russr999, any update???

            Thanks

            Comment


              #7
              Hi all, let me start my apologiseing for my silence as late. Some background...since the middle of the year the company where I work has undergone some changes, big chnages. There has been a very uncertain period for the last 6 months with increased workload as we implemented the changes and waiting to see if we still had a role with the company. This has led me to working mostly 12-14 hour days 6-7 days per week and has then left me with no time to get this bug sorted.Today, while there is still some uncertainity, I have managed this week to start getting my hours back down.

              Is this important as to why the bug isn't fixed yet? No but hopefully gives some context.

              This bug that you're seeing on Openweather I have fixed in the next BETA but haven't tested it yet. I will test it this weekend and release a new BETA by latest Sunday while will resolve this issue. After this, I'll be moving back onto to development of the plugin as there is so much still to do and add.

              Thanks

              Comment


                #8
                I encountered the same problem, error 401, I did a small test to see if my Openweather API key is working, it is shown on the Openweather FAQ:

                Example on how to make an API call using your API key

                API call
                http://api.openweathermap.org/data/2.5/forecast?id=524901&appid={API key}​

                If I do this in Webbrowser I get all the data in, so API is ok, Network and Router are ok (same as the server), maybe something else?

                I understood from the post above that there are good reasons that things take a bit longer, I fully understand. I love the plugin and the way it is programmed. Excellent work!




                Comment


                  #9
                  Originally posted by NL-Frank View Post
                  I encountered the same problem, error 401, I did a small test to see if my Openweather API key is working, it is shown on the Openweather FAQ:

                  Example on how to make an API call using your API key

                  API call
                  http://api.openweathermap.org/data/2.5/forecast?id=524901&appid={API key}​

                  If I do this in Webbrowser I get all the data in, so API is ok, Network and Router are ok (same as the server), maybe something else?

                  I understood from the post above that there are good reasons that things take a bit longer, I fully understand. I love the plugin and the way it is programmed. Excellent work!



                  Hi [mention]NL-Frank [/mention], how long do you have your openweather key?
                  Reason for asking is I tested it in a browser with my key which works successfully for the 2.5 OneAPI call and it worked but when I generated a new/another key, that wouldn't work on the 2.5 OneAPI call. I also test through a http debug proxy to trace the call, handshake etc to see where it was failing.

                  I have the work done within rnbWesther to try the 3.0 first and if that fails, test the 2.5 call. If the 3.0 call works, it will set that as your default call, if it doesn't but the 2.5 works, then it sets that as your default call. Logic being new keys seem to be disabled with the 2.5 call so any new users/keys would need the 3.0 call.

                  Although saying I have the work done, I haven't released the updated version yet as I found a bug which I've also fixed but need to test. Was on my list last weekend to finish the test and release but didn't happen. Will happen over the next couple of days and that will fix the openweather issues for new keys.


                  Sent from my iPhone using Tapatalk

                  Comment


                    #10
                    Russ,

                    Thanks for your work. FYI, I am new homeseer user beginning in December. I had some problems with NOAA and another user recommended switching to OpenWeather. I have a recent version of your plugin and a new account from last week with OpenWeather. Here's what I'm seeing:
                    1/4/2023 7:48:47 AM rnbWeather Error Openweather: Error retrieving update (The remote server returned an error: (401) Unauthorized.)1/4/2023 7:45:58 AM rnbWeather Error Openweather: Error retrieving update (The remote server returned an error: (401) Unauthorized.)
                    1/4/2023 7:44:28 AM HomeSeer Device Control Device: rnbWeather rnbWeather rnbWeather Accounts Openweather Connection to Poll Openweather Now (99) by/from: CAPI Control Handler
                    1/4/2023 7:37:16 AM rnbWeather Error Openweather: Error retrieving update (The remote server returned an error: (401) Unauthorized.)
                    1/4/2023 7:25:45 AM rnbWeather Error Openweather: Error retrieving update (The remote server returned an error: (401) Unauthorized.)
                    1/4/2023 7:14:15 AM rnbWeather Error Openweather: Error retrieving update (The remote server returned an error: (401) Unauthorized.)
                    1/4/2023 7:02:44 AM rnbWeather Error Openweather: Error retrieving update (The remote server returned an error: (401) Unauthorized.)
                    1/4/2023 6:51:12 AM rnbWeather Error Openweather: Error retrieving update (The remote server returned an error: (401) Unauthorized.)
                    1/4/2023 6:39:40 AM rnbWeather Error Openweather: Error retrieving update (The remote server returned an error: (401) Unauthorized.)
                    1/4/2023 6:28:09 AM rnbWeather Error Openweather: Error retrieving update (The remote server returned an error: (401) Unauthorized.)
                    1/4/2023 6:16:37 AM rnbWeather Error Openweather: Error retrieving update (The remote server returned an error: (401) Unauthorized.)
                    1/4/2023 6:05:03 AM rnbWeather Error Openweather: Error retrieving update (The remote server returned an error: (401) Unauthorized.)
                    1/4/2023 5:53:32 AM rnbWeather Error Openweather: Error retrieving update (The remote server returned an error: (401) Unauthorized.)
                    1/4/2023 5:42:01 AM rnbWeather Error Openweather: Error retrieving update (The remote server returned an error: (401) Unauthorized.)

                    I'd be glad to help in anyway, if needed.

                    H


                    Comment


                      #11
                      Originally posted by russr999 View Post

                      Hi [mention]NL-Frank [/mention], how long do you have your openweather key?
                      Reason for asking is I tested it in a browser with my key which works successfully for the 2.5 OneAPI call and it worked but when I generated a new/another key, that wouldn't work on the 2.5 OneAPI call. I also test through a http debug proxy to trace the call, handshake etc to see where it was failing.

                      I have the work done within rnbWesther to try the 3.0 first and if that fails, test the 2.5 call. If the 3.0 call works, it will set that as your default call, if it doesn't but the 2.5 works, then it sets that as your default call. Logic being new keys seem to be disabled with the 2.5 call so any new users/keys would need the 3.0 call.

                      Although saying I have the work done, I haven't released the updated version yet as I found a bug which I've also fixed but need to test. Was on my list last weekend to finish the test and release but didn't happen. Will happen over the next couple of days and that will fix the openweather issues for new keys.


                      Sent from my iPhone using Tapatalk
                      Hi Russr999,

                      Yesterday I signed up for Openweather for the first time and generated my own key (and name), after a few (2?) hours you receive an email confirming the free account and sending the default API key. That was not the one I made myself. So I deleted the default one and now only have *one* API key active I created on the website. It probably takes a little while before it is active. But yesterday I also tested the API on my PC in Firefox browser and it worked (that's when I made the post here). Just now I tested it with Firefox on the Windows PC that is actually running HS4, that also works. Maybe this helps.

                      Please let me know if you want me to test or know anything more, glad to be of help.

                      Take care, Frank.

                      Comment


                        #12
                        I got the same error: Openweather: Error retrieving update (The remote server returned an error: (401) Unauthorized.)
                        Test the API 2.5 URL in my browser and works fine.
                        Test on the API 3 fails because: "Please note, that One Call API 3.0 is included in the "One Call by Call" subscription only. This separate subscription includes 1,000 calls/day for free and allows you to pay only for the number of API calls made to this product. Please find more details on the pricing page and FAQ​"
                        I think most of us only have the free plan and can't use the new 3.0 API.

                        Comment

                        Working...
                        X