Skip to content
This repository has been archived by the owner on May 17, 2021. It is now read-only.

[weather] OpenWeatherMap API key failure due to discontinuation of FORECAST on the free plan #5837

Open
ptrooms opened this issue Mar 20, 2019 · 7 comments

Comments

@ptrooms
Copy link

ptrooms commented Mar 20, 2019

Hello, appologies upfront as I try to get the hang of operations how to do and communicate things......

Expected Behavior

The OpenWeather bundle should not generate an API key error.
This is started since OpenWeather.com decided that FORECAST calls are part of the 16 day packages. See conversation on OpenWeather.org#17136552

Current Behavior

When using the OpenWeather Binding, everytime the sensors are update, I receive

2019-03-17 05:16:33.266 [ERROR] [nal.provider.AbstractWeatherProvider] - OPENWEATHERMAP[home]: Can't retreive weather data: Invalid API key. Please see http://openweathermap.org/faq#error401 for more info.

Possible Solution

Updating the bundle-provider source ../addons1/bundles/binding/org.openhab.binding.weather/src/main/java/org/openhab/binding/weather/internal/provider/OpenWeatherMapProvider.java

by returning null for getForecastUrl() in overriding class OpenWeatherMapProvider ....

    @Override
    protected String getForecastUrl() {
        return null;
    }

in stead of (failing, giving the error message)

    @Override
    protected String getForecastUrl() {
        return FORECAST;
    }

Context

The log is flooded with errors which distracts and simply annoys.

My Environment

OpenHab 2.2.0 on a Qnap-TS-509/Busybox implementation

Kind Regards,
Peter

Note: I already solved it myself by updating the Java code and integrating (as add-on) it into openhab.
I tried to fork/pull my Git-fork as-branch owapi and (of course) I cannot (as I do not yet understand howto) propose my own forked GIT changes into the [https://github.com/openhab/openhab1-addons]

@5iver
Copy link

5iver commented Mar 20, 2019

I'm not a maintainer and do not know if your changes would be accepted, but #5836 was OK... not sure why you closed it.

@9037568
Copy link
Contributor

9037568 commented Mar 20, 2019

#5836 would have been a good start, but changes would be needed.

@9037568 9037568 changed the title [OpenWeather] API key failure due discontinuation of FORECAST freeplan [Weather] OpenWeatherMap API key failure due discontinuation of FORECAST on the free plan Mar 20, 2019
@ptrooms
Copy link
Author

ptrooms commented Mar 20, 2019

I'm not a maintainer and do not know if your changes would be accepted, but #5836 was OK... not sure why you closed it.

Simple answer: I do not (yet) know how/what I (have to) do to propose a code modification. Feeling like a trainee again. Getting involved into openHAB aside from coding itself, is challenging (unstanding the environment, policy learning for doing things etc.etc.).

Checking myself, yes. A proposal to fix will likely be incomplete. I primarily "patched" the code (to eliminate de FORECAST call error) instead of properly "modify" for functionality that implement the FORECAST option as a configuration choice. Perhaps, others may have a paid plan and thus WILL want to use the FORECAST option.

I did a pull-request on "addons1" but for vague reasons it was (redd-cross) rejected such as "forgot to signoff" and others, after I best closed the issue. Also not to stress the nice community with my "ignorances". Thanks for your assistance & understanding. Still learning the "git" proces...

ptrooms added a commit to ptrooms/openhab1-addons that referenced this issue Mar 21, 2019
Why:
* OpenWeather discontinued the FreePlan for FORECAST which now generates an API-key error as forecast is implicitly part of binding.
This Fix will remove the FORECAST call and option by simply returning nulll for the FORECASY url.

This change addresses the need by:
* return null in the FORECAST call

Signed-off-by: PtrO <[email protected]>
@ptrooms
Copy link
Author

ptrooms commented Mar 21, 2019

Made a little GIT progress pushing/pulling "a proposed fix" which I renamed from owapi to #5837 on my fork....... not now sure how to continue. Appo's for my newbie actions and thanks for your patience.

@9037568
Copy link
Contributor

9037568 commented Mar 21, 2019

Since you deleted the original branch, you'll now have to start a new PR.

@ptrooms
Copy link
Author

ptrooms commented Mar 22, 2019

In learning, I've pulled/renamed to #5838 with "my" proposed fix on my-fork which now went successful in checks and now, it is stated as (I'm proudly ;) ) want to merge.
Aside from (possible code/direction comments, would that be enough for kings & dragons ?

@9037568 9037568 changed the title [Weather] OpenWeatherMap API key failure due discontinuation of FORECAST on the free plan [weather] OpenWeatherMap API key failure due to discontinuation of FORECAST on the free plan Mar 22, 2019
@bkadykalo
Copy link

5-days forecast works well with a free account - just need to drop /daily from endpoint

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants