Openweathermap binding doesn't connect

Tags: #<Tag:0x00007f616758e808> #<Tag:0x00007f616758e678>

Hi all

I’m running Openhab1 for some years now and think about migrating to Openhab2.
But now I’ve a problem which I cannot solve on my own:

The OpenWeatherMap Binding remains offline and I’m not able to connect it. I know that I’m not the first person having this problem, but all I’ve found on the Internet doesn’t work. Also deinstallation and new installation made no change.

“Funny” thing is: My Openhab1 server runs on the same computer (of course not at the same time) with the same data for the binding and works without any problems. I also have a local installation on my pc with Openhab2 and this Binding (also using the same data and same Internet access) and it also works. But I don’t want to have Openhab running on my PC, that’s what the server is for…

Both computer run with Ubuntu, the PC, since a couple of days, 20.04 (but also worked on 18.04) the Server still 18.04 on OpenJDK8.

Am I missing something? I really have no idea?

Thank you
Dieter

Wow!
Do you realize OpenHAB 3 is in active development and will be the next stable release? In the interim there are monthly 2.5.x releases that just update bindings.

I have only been here for about a year. @rlkoshak or some of the other veteran users may be able to help.

I’ve heard rumors about Openhab3 :wink:
Until now, my Openhab1 still works most of the times, only some bindings doesn’t but none that I “really” needed (I can feel that it’s currently warm inside, without Netatmo telling me).

I’m just searching for a holiday project as a lot of other things couldn’t take place this year, so the migration seems a good idea for me.

Or do you suggest to wait for Openhab3?

Moving from 1 to 2 us a HUGE jump. What other bindings do you use? I tmight be easier to re-create your system from scratch.

I think the openweathermap API changed recently and there is an issue & PR for improvements to the v2 binding.

You copied things and items definition from the computer that the stuff is working on to the other OH2 installation ?
Any error message in openhab.log or events.log file ?

Yes, that’s acually what I plan. And why I’ve waited so long. I hope I could keep most of my rules without changing them a lot, as I used Jython rules (not for all, but mostly). According to the documentation it should work without too much effort.
But for now I need to bring the bindings to work. Sonos, Hue and Homematic seems to work, also Astro (for sunset and sunrise) binding and Harmony (one of them that doesn’t work in Openhab1). REST seems to work quite nice in Openhab2 (works also in Openhab1, but you have to configure items manually) and MQTT I haven’t tried yet. I guess, that are the most relevant for me.

Before I don’t get them all to work, I won’t do the next step.

Regards
Dieter

Personally, I’d wait for OH3 for your production environment. I don’t know when that will be, but there’s going to be enough new stuff that you can treat it as “brand new”.

In the meantime, I think the most valuable thing would be to use your OH2 setup to learn about next-gen rules using Jython. Those will definitely carry over to OH3, and by all accounts are vastly superior to the old rules.

I had hoped to start learning Jython this summer, but my job has kept me far too busy to play around with it. However, Rich and others have started posting Jython rules to stock the community with examples.

1 Like

Ah, you’re already ahead of the game on this. If so, I think we’re getting distracted by your initial talk about OH1.

From what you’ve said, it sounds like it’s worth messing around with OH2 to get all of your stuff working, and that your transition to OH3 should be relatively smooth.

1 Like

I believe there were many changes to how Jython interacts with openHAB between 1.x and 2.5. I suspect you will need to make some significant changes. I vaguely remember it taking quite some months after the release of OH 2.0 before Jython was working again and users were required to make changes to their scripts to make it work.

Anyway, back to your original question, assuming that you read and followed Wolfgang_S’s post my only thought is that you’ve exceeded the number of polls per hour/day that is allowed by OpenWeatherMap’s API. Try slowing down the working instances and wait a bit to see if that helps. Of course this is assuming that there are no errors in the logs.

1 Like

Hi Wolfgang

I used the same configuration data with paper-ui and hoping that this will create the same data. I would really love to copy the same configuration (just because not to enter the same things twice), but wasn’t able to find the files. Both config dirs I know (/etc/openhab2/XXX and /var/lib/openhab2/config/org/openhab) didn’t contain data. Where is the configuration stored?

There are actually two exceptions in events.log:

2020-08-07 19:14:26.449 [hingStatusInfoChangedEvent] - 'openweathermap:uvindex:api:local' changed from OFFLINE (BRIDGE_OFFLINE) to OFFLINE (COMMUNICATION_ERROR): javax.net.ssl.SSLHandshakeException: General SSLEngine problem

and

 2020-08-07 19:14:26.521 [hingStatusInfoChangedEvent] - 'openweathermap:uvindex:api:local' changed from OFFLINE (COMMUNICATION_ERROR): javax.net.ssl.SSLHandshakeException: General SSLEngine problem to OFFLINE (COMMUNICATION_ERROR): java.io.EOFException: HttpConnectionOverHTTP@23da67ed::DecryptedEndPoint@478e30c3{api.openweathermap.org/37.139.1.159:443<->/192.168.178.23:57028,CLOSED,fill=-,flush=C,to=0/0}

but I’m not able to find out what it really means :frowning:

Kind regards
Dieter

There is something wrong with the SSL handshake between your RPi and the OpenWeatherMap web servers. SSL is the protocol underneath HTTPS. Can you ping the OpenWeatherMap servers from the machine? Have you updated it? Install ca-certificates?

There is something wrong networking wise or trusted certificate wise going on the machine. Unfortunately the root of the problem is completely outside of openHAB in this case. Maybe try to use wget or curl on an OpenWeatherMap URL and see if you get a more detailed error.

Hi Rich

It was possible to use curl on both maschines.
But it seems that a forced re-installation of ca-certifcates (as described at https://askubuntu.com/questions/1004745/java-cant-find-cacerts) solved the problem.

Now the bindings are online and I can go on. Thanks a lot for your help.

Kind regards
Dieter

3 Likes

There have been many changes to the automation API. The last significant one was in OH 2.4 S1319, and things have been pretty stable since then, except for a glitch when migrating the build system to bnd. The execute methods in your rules should still work, but the triggers will not. Were you using the raw API to write your rules or using the libraries from Steve? Those helper libraries are very much evolved from what they had been.

https://openhab-scripters.github.io/openhab-helper-libraries/index.html

I am the maintainer or them, so please let me know if you have any issues setting up Jython, the helper libraries, or if you need any assistance getting your rules working again.

2 Likes