InsteonPLM in OH2 and some UI in OH2


(eviltechmonkey) #1

What is the state of InsteonPLM binding on OH2? It doesn’t show up in the stock options yet.

Also, possibly to put under UI, but under Paper UI I can remove groups but when I added a group it was automatically called ‘test’ and can’t be renamed. And there is no option within the GUI to add/remove/change items within a group.


Insteon PLM - Error on Startup
(Jeff Tapia) #2

@Bernd_Pfrommer
I’ve got OH2b1 build #106 (2016.01.27) working with ecobee and a few things but…

I get the following error for the insteonplm binding after a couple minutes which worries me that the new, more rigorous requirements of eclipse or whatever means it needs to be patched/fixed.

Exception in thread "Thread-36" java.lang.NoSuchMethodError: org.apache.http.impl.client.DefaultHttpClient.execute(Lorg/apache/http/client/methods/HttpUriRequest;)Lorg/apache/http/client/methods/CloseableHttpResponse;
	at org.openhab.binding.insteonplm.internal.driver.hub.HubIOStream.getURL(HubIOStream.java:213)
	at org.openhab.binding.insteonplm.internal.driver.hub.HubIOStream.bufferStatus(HubIOStream.java:108)
	at org.openhab.binding.insteonplm.internal.driver.hub.HubIOStream.poll(HubIOStream.java:156)
	at org.openhab.binding.insteonplm.internal.driver.hub.HubIOStream.run(HubIOStream.java:226)
	at java.lang.Thread.run(Thread.java:744)
Exception in thread "/hub2/Mirabell:BAxfhx6l@192.168.1.120:25105,poll_time=1000 Writer" java.lang.NoSuchMethodError: org.apache.http.impl.client.DefaultHttpClient.execute(Lorg/apache/http/client/methods/HttpUriRequest;)Lorg/apache/http/client/methods/CloseableHttpResponse;
	at org.openhab.binding.insteonplm.internal.driver.hub.HubIOStream.getURL(HubIOStream.java:213)
	at org.openhab.binding.insteonplm.internal.driver.hub.HubIOStream.bufferStatus(HubIOStream.java:108)
	at org.openhab.binding.insteonplm.internal.driver.hub.HubIOStream.poll(HubIOStream.java:156)
	at org.openhab.binding.insteonplm.internal.driver.hub.HubIOStream.write(HubIOStream.java:139)
	at org.openhab.binding.insteonplm.internal.driver.hub.HubIOStream$HubOutputStream.flushBuffer(HubIOStream.java:308)
	at org.openhab.binding.insteonplm.internal.driver.hub.HubIOStream$HubOutputStream.write(HubIOStream.java:302)
	at java.io.OutputStream.write(OutputStream.java:75)
	at org.openhab.binding.insteonplm.internal.driver.IOStream.write(IOStream.java:68)
	at org.openhab.binding.insteonplm.internal.driver.Port$IOStreamWriter.run(Port.java:421)
	at java.lang.Thread.run(Thread.java:744)

(John Cocula) #3

In the IDE, the call to execute shows this warning:

Discouraged access: The method ‘CloseableHttpClient.execute(HttpUriRequest)’ is not API (restriction on required library ‘[…]/openhab/ws/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/org.apache.httpcomponents.httpclient_4.3.6.v201411290715.jar’)

The package org.apache.http.impl.client is marked “x-internal:=true” in MANIFEST.MF, and the IDE marks the Apache HTTP classes used as deprecated.

I think code changes are needed to the InsteonPLM binding so it uses different HTTP classes that are supported in both OH1 and OH2.


(Jeff Tapia) #4

Thanks for reviewing this.

Code changes are still out of my league (I’m a beginner to Rpi, Linux, openhab, github, cloudbees and java) but it confirms that I need to go back to an earlier version of OH for now.


(John Cocula) #5

It would be wise to stay on OH1 for the time being, until the insteonplm binding can find a solution to resolving the version of the org.apache.http classes it needs. The org.apache.http package is a trainwreck of deprecated classes, and I suspect that the x-interal flag in Equinox is merely advisory, while in Karaf it prevents the imported package actually importing (needs further investigation, obviously).

Could you help by creating a new issue with your findings, with a link back to here?


(Jeff Tapia) #6

The least I can do is try - it will be my first!

Thank you @watou


(Jeff Tapia) #7

Created new issue:
3922


(Rob Nielsen) #8

@Bernd_Pfrommer, @dan_pfrommer, have you seen this thread? Appears InsteonPLM is using a http client library that isn’t supported with OH2. I looked at the Netatmo binding and it has:

org.apache.commons.httpclient
org.apache.commons.httpclient.util

And it works with OH2. If I had a hub, I’d try and fix (USB PLM only).

Rob


(Bernd Pfrommer) #9

I do not support OH2 at this time. Somebody else needs to make the necessary modifications and test under OH2.


(Rob Nielsen) #10

@Bernd_Pfrommer, is it possible to switch http libraries to a OH2 supported library, then others could test it? @maintainer, can you suggest one that should be used instead?


(Bernd Pfrommer) #11

In issue 3922, @Kai linked to a thread where alternatives are discussed. Some participants there claimed the alternatives are not thread safe. Not sure if we even use the HttpClient in a multi-threaded fashion. At any rate, it didn’t sound like a one line fix.


(Rob Nielsen) #12

Thanks @Bernd_Pfrommer


(Kai Kreuzer) #13

See my comment on the issue: It is not that OH2 does not support the Apache HTTP client. It is that the InsteonPLM binding uses an internal class of that library that must not be used. OH1 only by mistake does not notice this illegal access. So the fix should be fairly simply, just have a look at the solution given in the link that I posted on the issue.


InsteonPLM or any working 1.x binding in OH2b1
(Jeff Tapia) #14

FYI… I saw in another thread that InsteonPLM works in OH2 if you use a PLM and not a hub.
I tried it this weekend and can confirm that I have OH2b3 working with InsteonPLM by switching to the USB PLM.

I know Bernd - it’s not supported - but it works (at least so far).


(Mehdi Afiatpour) #15

Can help me? I don’t know how to setup insteon on oh2


(Wdesponts) #16

What do you mean by the USB PLM? Are you using a INSTEON USB MODEM INTERFACE with the standard INSTEON PLM binding?


(Rob Nielsen) #17

A 2413U: http://www.smarthome.com/powerlinc-modem-insteon-2413u-usb-interface-dual-band.html


(Wdesponts) #18

interesting. I’ve got the Hub so this is still not resolved. But I’ll keep trying.


(eviltechmonkey) #19

Definitely recommend the 2413U PLM. I had the Hub for a while. Absolute garbage. I have not tried Insteon with OH2 again yet. I’m sticking with 1.8.* for now until 2.0 is a more mature product. Everything I have is working in 1.8.* and I’m not in the mood to break it nor would that make my wife happy.