It allows to control devices which implement the standard, in particular digital projectors. The binding currently supports PJLink class 1 including authentication.
A lot of well known projector manufacturers are involved in the standard, e.g. Sony, Panasonic, NEC, and many more. Even if it is not officially mentioned, also Acer projectors support the standard (at least some, like mine).
The binding is available in OpenHAB 2.5.x and 3.x.
Feel free to try it with your projector and let me know if you run into issues!
Thanks ,now it works the binding update,
I have test the binding with a EPSON EB-4750W (PJ link Class 1) and EPSON EB-5530U (PJ link Class 2) it works.
I can Power off/on and change the Inputs.
I had a white screen in paper UI when clicking "Inbox > PJLinkDevice Binding " after installing the binding.
I just tried again and now I can add the thing through paper UI (must be some kind of caching issue with paper ui).
I rebooted openhab (I use 2.4.0 release) didn’t work.
Then I used your test program and it found the thing successfully and is online.
I then removed the manual made optoma thing file and tried again by adding it through Paper UI.
This still doesn’t work. It seems some info comes in (disclosedname)
I checked and changed the rights temporarily to 777 but this doesn’t help.
My system is openHAB on a RPI3.
It seems like the optoma is sending some responses in a different format as in it doesn’t startsWith(fullPrefix)
Maybe you can build in some logging so I can check what responses actually come in? I already set the loglevel to debug for this binding.
public void parse(String response) throws ResponseException {
String fullPrefix = "%1" + this.prefix;
if (!response.startsWith(fullPrefix)) {
throw new ResponseException(
MessageFormat.format("Expected prefix '{0}', instead got '{1}'", fullPrefix, response));
}
thanks for testing the binding and analyzing the issue with the Optoma Projector.
I was thinking the same thing concerning the logging message, as you can see from the code it was intended to be more meaningful… I can’t fix that right now, but in the afternoon I will create a new version.
Maybe the Optoma responds with a class 2 response when we send class 1 commands or something like that.
the snapshot JAR has been updated. Caution: the JAR has a new URL as it is now a 2.5.0-SNAPSHOT instead of 2.4.0-SNAPSHOT after OpenHAB 2.4.0 has been released.
When you set the log level of org.openhab.binding.pjlinkdevice to at least INFO, you should now see log messages like these:
Got response '%1POWR=OK' for request '%1POWR 0\r' from /192.168.178.120
Also, the exception now is working with a proper text, e.g.:
Okay, this looks a bit like the binding is not patient enough to wait for the response from the projector.
I’ll have a look at the PJLink specs again to see whether that’s something that can be expected.
Regardless of the outcome of that, I’ll also provide a new version which is hopefully more robust in that regard soon.
further thinking about it, it rather seems that there are sometimes unexpected empty lines coming from the projector. The most recent JAR should now ignore empty lines and try to get another one.
@itseogo@struvusmaximus Could you please both test it with your projectors again? The binding works fine with the PJLink test tool, but unfortunately I can not do a regression test with my real projector at the moment.
can you provide detailed instructions to install the jar file ?
I’ve figured out: I put the jar file inside the “addons” directory and restart openhab
After a while, it became available in the inbox “+” section.
I’ve provided the IP and the port that is displayed in the web UI of the projector (type the IP of the project, port 80, go to setup, default login/password is root/Projector), and go to PJTalk.
With this port I get the following error:
2019-01-04 00:01:43.891 [WARN ] [core.thing.internal.ThingManagerImpl] - Initializing handler for thing 'pjLinkDevice:pjLinkDevice:2f8feae4' takes more than 5000ms.
2019-01-04 00:02:08.970 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.initialize()' on 'org.openhab.binding.pjlinkdevice.internal.PJLinkDeviceHandler@7b3531a4': null
java.lang.NullPointerException: null
at org.openhab.binding.pjlinkdevice.internal.device.PJLinkDevice.connect(PJLinkDevice.java:123) ~[?:?]
at org.openhab.binding.pjlinkdevice.internal.device.PJLinkDevice.connect(PJLinkDevice.java:91) ~[?:?]
at org.openhab.binding.pjlinkdevice.internal.device.PJLinkDevice.checkAvailability(PJLinkDevice.java:205) ~[?:?]
at org.openhab.binding.pjlinkdevice.internal.PJLinkDeviceHandler.initialize(PJLinkDeviceHandler.java:145) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [102:org.eclipse.smarthome.core:0.10.0.oh240]
at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [102:org.eclipse.smarthome.core:0.10.0.oh240]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]
2019-01-04 00:02:08.999 [ERROR] [core.thing.internal.ThingManagerImpl] - Exception occurred while initializing handler of thing 'pjLinkDevice:pjLinkDevice:2f8feae4': null
java.lang.NullPointerException: null
at org.openhab.binding.pjlinkdevice.internal.device.PJLinkDevice.connect(PJLinkDevice.java:123) ~[?:?]
at org.openhab.binding.pjlinkdevice.internal.device.PJLinkDevice.connect(PJLinkDevice.java:91) ~[?:?]
at org.openhab.binding.pjlinkdevice.internal.device.PJLinkDevice.checkAvailability(PJLinkDevice.java:205) ~[?:?]
at org.openhab.binding.pjlinkdevice.internal.PJLinkDeviceHandler.initialize(PJLinkDeviceHandler.java:145) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [102:org.eclipse.smarthome.core:0.10.0.oh240]
at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [102:org.eclipse.smarthome.core:0.10.0.oh240]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]
with the default port, I get a “connection refused”.