-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch to OpenWeatherMap API #56
Comments
It seems the Darksky API finally stopped responding some time this week, and the OpenWeatherMap version isn't working properly either. TLS is now required by Node, but even when flagging it to "1" in "get-weather" and entering API keys, the widget seems broken. It saying it's trying to return undefined data. |
@jetblackrx89 Give the PR another try. Improved error handling a bit and fixed a bug with the API keys. |
Thanks for the quick reply. It's now crashing with this. The path is valid.
If I manually install it via NPM like this, I get a new error.
New error:
|
@jetblackrx89 Note that the widget needs to point to folders with index.coffee files. In case you checked out this repository it expects the inner weather.widget folder. |
I'm very sorry but I am having a hard time interpreting what is mean by "point to folders with index.coffee files" and "inner weather.widget folder". I downloaded your repo as a .zip just now and put the entire "top level" directory of that .zip into the Application Support folder for Übersicht and now it's back to stating it cannot find "get-weather", and it's still referring to the old path even though it's now 1 directory deeper. I'm at a loss here. Current file scheme:
Now I again get this error:
I think the way I had it before ("weather.widget" being directly in the "widgets" folder) was closer to a "working" condition but as I said it is throwing an error for a temperature object. Did you see that part of the last message?
|
@jetblackrx89 You should only put the directory The folder configured in the preferences (e.g.
|
Understood. That is how I originally had it. Sorry if I overcomplicated this, but what I am trying to say is the widget is still failing to load with this error:
Thanks |
Are you sure you're using the patched (Pull Request 55) version? Try with the attached version, this is a checkout of my pull request which i zipped up. If that still does not work, my only suggestion would be to try to debug what is going on. You can trigger the debugger from the Ubersicht context menu. In the script tab you can select the weather-widget script and set a breakpoint on the |
I'm very sorry for the confusion. What was actually happening is that I'd moved the old widget was to a subdirectory called "disabled", but the app still looks within there for any valid widgets. This entire time, the old widget overlaying onto of your new one. Unfortunately, now with the new widget, OpenWeather is stating it's returning a 401 error. My API key is "0ddb1cbdeecf2a86f7a6e66cb7045043" (I don't mind if others see it, I can always make a new one later). It says the issue may be that on a free plan, a "401" error may mean that the API doesn't report back all the requested info. Is that a known limitation? I need a paid plan? |
Your API Key seems indeed invalid which can be validated with a simple cURL request. Maybe try to generate a new one?
|
I finally got an email from OpenWeather and they are claiming the below new API key is valid, but it seems to only work selectively. It seems "onecall" API has been replaced with a "weather" API based on the URL scheme they now suggest. Example of how they suggest to make the API call. It returns valid data: https://api.openweathermap.org/data/2.5/weather?q=27517&APPID=667b6819fbd3746b15f54deeb8f1438e Using the same API key the way you suggest, it returns a 401 code: https://api.openweathermap.org/data/2.5/onecall?appid=667b6819fbd3746b15f54deeb8f1438e |
Looks like they changed their plans as well and the /onecall API is not free anymore. Newly generated API keys wont work with the older API version. Unfortunately the free /weather endpoint is not sufficient as it does not have any forecast data. Guess this widget became useless at this point unless someone is okey with a paid subscription. |
Hi @roele and @jetblackrx89. First of all, thank you @roele for compiling the widget to run OpenWeather, you're a lifesaver as most of the Ubersicht weather widgets run on DarkskyAPI and are not of any use any more. Regarding the OpenWeather API, I suggest checking in the members' section, under the tab "billing plans" to which plan you're subscribed. I noticed that if you subscribed BOTH to the "OneCall 3.0" API and the Free Professional Collections API, the API keys that were generated do not work with the widget, whereas if you subscribe only to the free professional plan (unsubscribe from the OneCall API), they would work normally. Weirdly, if you subscribe to OneCall 3.0, you get API keys compatible only with the 3.0 API, whereas if you subscribe only to the professional collections you get backward compatibility. So what I would suggest trying is to unsubscribe from the onecall API, keep the subscription to the free Professional API and generate a new API key, which I believe should work. |
Thank you, but I believe the "free" plan and "professional collections free" are synonymous. It seems that's what my plan defaulted to without subscribing or paying for OneCall API yet. |
weird, I don't get why my key works. I just made another key to check this out, and the new key doesn't work only the old one :/. The widget works fine with my original key. Possibly my account is older than I thought. I was looking around and apparently, after September 2022 they depreciated the 2.5 version but the old keys will still work with the old API structure. Any new keys will work with the new API structure, version 3 and later, so new users are locked out, the same as DarkSky. Any information I could find was from other git repos that discussed the same problem, OpenWeather makes it very difficult to understand what is going on. Sorry I haven't been useful on this. |
@gtrooper The |
Oh I see ! So they stopped offering free service for Weather Data for more than 1 day pretty much, right ? Anyways, your widget was so good I really miss the 3 days forecast and the look of your widget if we dont count the icons which were the same, was so much better.. Thank you for the kind explanation ! |
Hi, sorry for reviving this old thread, just wanted to say thanks for the wonderful widget which I managed to squeeze another 2 years of life out of it as my 2.5 OpenWeather API keys worked up until today. Much longer than expected considering that they stop signed 2.5 API keys almost 2 years ago. Thank you for this. |
Use the OpenWeatherMap API to fetch weather data (see #55)
The text was updated successfully, but these errors were encountered: