Hi all,
I’ve installed the Plex binding from the list of bindings for OH2 in PaperUI.
I installed it according to the wiki, but to no avail in that the commands do not control the player.
I’m on a RPi 3 B, the Plex server is running well and works with the clients on my Windows PC as well as on 2 androids (running the official Plex clients).
For example I pressed two commands from BasicUI, here’s the tail:
tail: /var/log/openhab2/openhab.log: file truncated
==> /var/log/openhab2/events.log <==
2017-01-31 21:52:16.744 [ItemCommandEvent ] - Item 'PlexTVPlay' received command ON
==> /var/log/openhab2/openhab.log <==
2017-01-31 21:52:16.751 [WARN ] [org.apache.karaf.services.eventadmin] - EventAdmin: Exception during event dispatch [org.osgi.service.event.Event [topic=openhab/command/PlexTVPlay] {bridgemarker=true, item=PlexTVPlay, command=ON} | {org.osgi.service.event.EventHandler}={component.name=org.openhab.binding.plex.binding, port=32400, token=xxxxxxxxxxxxxxxxxxxx, username=UglyKidJoe888, refresh=5000, service.pid=org.openhab.plex, component.id=178, password=xxxxxxxx, event.topics=openhab/command/*, host=http://192.168.178.153, service.id=309, service.bundleid=195, service.scope=bundle} | Bundle(org.openhab.binding.plex_1.10.0.201701300211 [195])]
java.lang.NullPointerException
at org.openhab.binding.plex.internal.PlexBinding.internalReceiveCommand(PlexBinding.java:147)[195:org.openhab.binding.plex:1.10.0.201701300211]
at org.openhab.core.binding.AbstractBinding.receiveCommand(AbstractBinding.java:97)[183:org.openhab.core.compat1x:2.1.0.201701231811]
at org.openhab.core.events.AbstractEventSubscriber.handleEvent(AbstractEventSubscriber.java:42)[183:org.openhab.core.compat1x:2.1.0.201701231811]
at org.apache.felix.eventadmin.impl.handler.EventHandlerProxy.sendEvent(EventHandlerProxy.java:415)[6:org.apache.karaf.services.eventadmin:4.0.8]
at org.apache.felix.eventadmin.impl.tasks.HandlerTask.run(HandlerTask.java:90)[6:org.apache.karaf.services.eventadmin:4.0.8]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_121]
at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_121]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_121]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_121]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_121]
==> /var/log/openhab2/events.log <==
2017-01-31 21:52:16.755 [ItemStateChangedEvent ] - PlexTVPlay changed from OFF to ON
2017-01-31 21:52:18.610 [ItemCommandEvent ] - Item 'PlexTVStop' received command ON
==> /var/log/openhab2/openhab.log <==
2017-01-31 21:52:18.617 [WARN ] [org.apache.karaf.services.eventadmin] - EventAdmin: Exception during event dispatch [org.osgi.service.event.Event [topic=openhab/command/PlexTVStop] {bridgemarker=true, item=PlexTVStop, command=ON} | {org.osgi.service.event.EventHandler}={component.name=org.openhab.binding.plex.binding, port=32400, token=xxxxxxxxxxxxxxxxxxxx, username=UglyKidJoe888, refresh=5000, service.pid=org.openhab.plex, component.id=178, password=xxxxxxxxx, event.topics=openhab/command/*, host=http://192.168.178.153, service.id=309, service.bundleid=195, service.scope=bundle} | Bundle(org.openhab.binding.plex_1.10.0.201701300211 [195])]
java.lang.NullPointerException
at org.openhab.binding.plex.internal.PlexBinding.internalReceiveCommand(PlexBinding.java:147)[195:org.openhab.binding.plex:1.10.0.201701300211]
at org.openhab.core.binding.AbstractBinding.receiveCommand(AbstractBinding.java:97)[183:org.openhab.core.compat1x:2.1.0.201701231811]
at org.openhab.core.events.AbstractEventSubscriber.handleEvent(AbstractEventSubscriber.java:42)[183:org.openhab.core.compat1x:2.1.0.201701231811]
at org.apache.felix.eventadmin.impl.handler.EventHandlerProxy.sendEvent(EventHandlerProxy.java:415)[6:org.apache.karaf.services.eventadmin:4.0.8]
at org.apache.felix.eventadmin.impl.tasks.HandlerTask.run(HandlerTask.java:90)[6:org.apache.karaf.services.eventadmin:4.0.8]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_121]
at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_121]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_121]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_121]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_121]
My playerid is “Plex Web (Chrome)” which I got from the xml details from the Plex Web Player.
I’m only working on my LAN as I’m in a guesthouse and can’t forward any ports. If I put the details to list the clients in the URL in chrome I get a “401 Unauthorised” error. Maybe this is the root cause?
<Device name="Plex Web (Chrome)"
I’ve tried it with another device with a cleaner name, I.e. B1-760HD, but no difference. I’ve also tried it with the clientIdentifier=“wpbyyjxxxx5x6cfqevxxxxxx”, still no luck.
Sample .items (copy and pasted from the wiki but changed the identifier):
/* -----------------Plex----------------- */
Switch PlexTVPower "Power" <video> (gMedia) {plex="Plex Web (Chrome)#power"}
String PlexTVStatus "Status [%s]" <video> (gMedia) {plex="Plex Web (Chrome)#state"}
String PlexTVTitle "Title [%s]" <video> (gMedia) {plex="Plex Web (Chrome)#title"}
String PlexTVType "Type [%s]" <video> (gMedia) {plex="Plex Web (Chrome)#type"}
String PlexTVCover "Cover" <video> (gMedia) {plex="Plex Web (Chrome)#playback/cover"}
Are there maybe dependent bindinds maybe that I missed? I have a very basic installation, no MQTT or HTTP bindings.
Any clues?
Edit:
Also tried this from looking at other posts…
Still not working. Any ideas would be much appreciated.