Plex binding for OH3 | Will it be ported?

Ah… i understand what you mean. I can definitely implement the same behavior through what you describe. I’ll rethink this :slight_smile:

Sorry for the delayed response, my ultimate goal is to make sure that my kids (who often use the living room TV), are using they’re profile, which has a limited library, instead of my profile which has the keys to the kingdom as it were… making sure that my 12-year old didn’t put on something R rated on for him and my 5 year old to watch… in other words, I want to make sure that my 5 year old doesn’t end up watching Aliens, or Chucky, or Friday the 13th…

1 Like

Hi guys,

Anyone got the last version of this addon to work with OH 3.4.1 ?
If I use the 3.4 version of the addon I do not see plex binding in the basic UI.
If I use the 3.3 version I can see Plex binding in the UI and add a Server.
But when I add a Player the stat remains as Unknown for the player…

Any help would be appreciated.

Thanks

Hello Rougy,

I can confirm this addon (https://github.com/aronbeurskens/openhab-addons/releases/download/v0.13/org.openhab.binding.plex-3.4.0-SNAPSHOT.jar) works with OH 3.4.1. I’ve tested it.

Just place the .jar file in your addons folder (/usr/share/openhab/addons/) and go to: http://{OPENHAB_URL}:{OPENHAB_PORT}/settings/things/add/plex

There you can add the server as a thing.

Next you can play something on your player and it should show up when you press the scan button.

1 Like

Well,

this is not working, as @rouggy stated.
The new v13 is not being recognised as binding by openhab anymore, so theres nothing to add:


This is my existing server thing:

This is the same for OH 3.4.0 and 3.4.1
Is there anything we need to do to make OH recognise the .jar?

This is what the log states about the .jar file:

2023-02-07 13:21:49.192 [ERROR] [Events.Framework                    ] - FrameworkEvent ERROR
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.plex [287]
  Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=17))"

	at org.eclipse.osgi.container.Module.start(Module.java:463) ~[org.eclipse.osgi-3.17.200.jar:?]
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:1847) ~[org.eclipse.osgi-3.17.200.jar:?]
	at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:136) ~[org.eclipse.osgi-3.17.200.jar:?]
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1840) ~[org.eclipse.osgi-3.17.200.jar:?]
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1783) ~[org.eclipse.osgi-3.17.200.jar:?]
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1745) ~[org.eclipse.osgi-3.17.200.jar:?]
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1667) ~[org.eclipse.osgi-3.17.200.jar:?]
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) ~[org.eclipse.osgi-3.17.200.jar:?]
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234) [org.eclipse.osgi-3.17.200.jar:?]
	at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345) [org.eclipse.osgi-3.17.200.jar:?]
2023-02-07 13:21:56.270 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/openhab/addons/org.openhab.binding.plex-3.4.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.plex [287]
  Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=17))"

	at org.eclipse.osgi.container.Module.start(Module.java:463) ~[org.eclipse.osgi-3.17.200.jar:?]
	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:445) ~[org.eclipse.osgi-3.17.200.jar:?]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [bundleFile:3.7.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [bundleFile:3.7.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1221) [bundleFile:3.7.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:515) [bundleFile:3.7.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [bundleFile:3.7.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [bundleFile:3.7.4]

Regards

It appears that the binding requires Java 17. @aronbeurskens, is that what you’re running? OpenHAB has switched to Java 17 for 4.0 and may explain why it works for him and not us. I have the same issue but can’t switch over to 17 to test at present. @Hendrik_Nielsen, you could try that.

Hi, thanks for explaining :slight_smile:
Since I am use Openhab on Docker is there any chance I can switch to that java version?

If you are running openHAB 3.x, a switch to Java17 will not help but might give you more trouble.
There had been a lot of adjustments been made to make openHAB 4 fully Java17 compatible.

Alright.
Basically there should be a OH 3.4 and a OH 4 Version of the binding then?

If it shall run on both versions, yes!

I just found this in another thread:

I’ll try this out.
Hope that @aronbeurskens could maybe include this in future versions of the binding?

Thanks for your support!

Yes I am running Java 17, which explains the difference. People can use @morph166955 version for now and I will try to get a java 13 setup for next / future releases.

1 Like

To compile a 3.2.0/4.0.0 binding:

  1. Re-add the binding folder that you had before (don’t delete addon.xml). Having it won’t really hurt anything on 4.0.0 for the moment, but it’s required for 3.2.0
  2. mvn clean install -pl :org.openhab.binding. -Dohc.version=3.2.0 -Dmaven.compiler.source=11 -Dmaven.compiler.target=11

That should generate a jar compatible for all versions. I’ve been using it for a while on the androidtv binding and it seems to be ok. Just be aware, if you have any newer java features (above v11) you will have issues.

2 Likes

Thank you for the information, will use it!

No, openHAB 3.x requires Java 11, versions above are not supported !

Did not directly see that you already wrote about issues with versions other than Java11…

Plex Bining is showing up again, can add a server thing, but when adding a player via scan, it finds the players, but then they show:

Status:

UNINITIALIZED

**BRIDGE_UNINITIALIZED**

Also the log is spammed with

[WARN ] [ex.internal.handler.PlexApiConnector] - Getting session data

Same problem here with players staying UNINITIALIZED. I’m on 3.4.1 with Java 11 using @morph166955 binding…

Same problem here, log WARN and players staying UNINITIALIZED. Equally on 3.4.1 with Java 11 using @morph166955 binding…

Since not everyone is having this issue I’m just wondering if the common link is using Plex via Docker (I’m using PlexInc image) ?

I’m not using docker. It’s openhab on Debian in a proxmox container…