Plex binding for OH3 | Will it be ported?

Hi @bhomeyer thanks for your work on the migration of this binding.
I wanted to try it on a recent snapshot, however some dependencies seem to be broken currently.
I was wondering what your plans are with this binding.


300 │ Installed │  80 │ 3.1.0.202102201422    │ openHAB Add-ons :: Bundles :: Plex Binding
openhab> bundle:start 300
Error executing command: Error executing command on bundles:
        Error starting bundle 300: Could not resolve module: org.openhab.binding.plex [300]
  Unresolved requirement: Import-Package: org.apache.commons.lang; version="[2.6.0,3.0.0)"

@bhomeyer , me too! This binding is great but doesn’t work on OH3.1. Luckily, I managed to downgrade to 3.0.2-1 where it works. :slight_smile:

OK, I’ve found out why this is: org.apache.commons has been removed from the core API (as per Removal of dependency on 'org.apache.commons.*' · Issue #7722 · openhab/openhab-addons · GitHub) so the binding needs to be re-created using Java methods… If @bhomeyer is no longer updating the binding :cry:, can anyone else help?

1 Like

I can confirm this is the issue with v0.8 of the binding and newest version of OH3.

I can confirm the same (3.1). I’m forced to use another 2.5-10 OH with the old 1.x binding. There is a similar problem/error with the Chamberlain binding, so hopefully it’s not a huge problem to fix long term.

This should work in 3.2 without issue : Release OH3 PLEX binding · bigbasec/openhab-addons · GitHub

Not 100% yet, though should function fine.

1 Like

Thank you, thank you @bhomeyer ! This works fine and I’ve just successfully upgraded to 3.1.0. :grinning:

1 Like

How do I get this addon installed? I placed it in the addons folder but it doesn’t show up.

Should just be able to drop the jar in addons and then go from there.

got it working! thanks!

1 Like

Thank you so much for this pre-release.

I will note one thing, play music on plex and this takes a nose dive…
Change back to tv/movie and it’s golden.

Hi bhomeyer

Would you be able to look at creating a parameter to extend the timeout on the API Connector, my Plex server is remote from my OH install and often times out:

[DEBUG] [lex.internal.handler.PlexApiConnector] - 2java.util.concurrent.TimeoutException: Total timeout 2000 ms elapsed
java.io.IOException: java.util.concurrent.TimeoutException: Total timeout 2000 ms elapsed
        at org.openhab.core.io.net.http.HttpUtil.executeUrlAndGetReponse(HttpUtil.java:260) ~[bundleFile:?]
        at org.openhab.core.io.net.http.HttpUtil.executeUrl(HttpUtil.java:155) ~[bundleFile:?]
        at org.openhab.core.io.net.http.HttpUtil.executeUrl(HttpUtil.java:130) ~[bundleFile:?]
        at org.openhab.binding.plex.internal.handler.PlexApiConnector.doHttpRequest(PlexApiConnector.java:226) [bundleFile:?]
        at org.openhab.binding.plex.internal.handler.PlexApiConnector.getApi(PlexApiConnector.java:193) [bundleFile:?]
        at org.openhab.binding.plex.internal.handler.PlexServerHandler.initialize(PlexServerHandler.java:106) [bundleFile:?]
        at org.openhab.core.thing.binding.BaseThingHandler.thingUpdated(BaseThingHandler.java:152) [bundleFile:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
        at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
        at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
        at java.lang.Thread.run(Thread.java:829) [?:?]
Caused by: java.util.concurrent.TimeoutException: Total timeout 2000 ms elapsed
        at org.eclipse.jetty.client.HttpDestination$TimeoutTask.onTimeoutExpired(HttpDestination.java:582) ~[?:?]
        at org.eclipse.jetty.io.CyclicTimeout$Wakeup.run(CyclicTimeout.java:282) ~[?:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]
        ... 3 more

Certainly can, can’t think of a good way to test that but I’ll drop it in and put it in the advanced binding config for the server thing. Will update when complete.

Time to get some music on my server. Thanks for the update and testing.

Thanks!

Hello,

I downloaded the latest snapshot release from @bhomeyer in this thread and placed it in the addons folder on my raspberry pi. I am running OH 3.0.1

After rebooting, I see this error in the Logviewer:

2021-08-19 18:07:42.003 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab/addons/org.openhab.binding.plex-3.1.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.plex [261]
  Unresolved requirement: Import-Package: org.osgi.framework; version="[1.9.0,2.0.0)"
	at org.eclipse.osgi.container.Module.start(Module.java:444) ~[org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383) ~[org.eclipse.osgi-3.12.100.jar:?]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [bundleFile:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [bundleFile:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1221) [bundleFile:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:515) [bundleFile:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [bundleFile:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [bundleFile:3.6.4]

Is there a way to resolve this? I am a newbie when it comes to these manual addons to OH.
Also, after successful installation, should I be able to see the binding in the UI? Or do I have to add all Plex Things manually in the files?

I believe due to a change in OH, it only works on 3.1.0 upwards

1 Like

I updated OH and I see the binding in the UI now, thanks for the tipp. Setting up the server is a bit of a hassle but sometimes it’s recognized

OH3 3.2 Snapshot

Is there anyway to get around this as OH3 have removed org.apache.commons from OH3.0?

Error executing command: Error executing command on bundles:
Error starting bundle 235: Could not resolve module: org.openhab.binding.plex [235]
Unresolved requirement: Import-Package: org.apache.commons.lang; version="[2.6.0,3.0.0)"

Hi @Jason_Howard, the author has provided an updated binding as referenced in this post above.