Binding Request: JVC Projector

My system would be improved hugely if I could interface (even just read on/off and command on/off) from my JVC projector. Has anyone successfully done this? Via TCP/IP binding or a new binding?

A quick google search took me to this document.
The commands are all there. In think it should be easily doable, although i do not think it will be possible using only the TCP-Binding, as it requires a correct sequence of commands and is (to some degree) timing sensitive.
Maybe a days worth of work if you have a device to try this on.

I have the device, a JVC DLA-RS4910U. This is well beyond the scope of my knowledge. Do you suppose you could help me out with getting this going? It seems like a lot to ask, but anything you can do would be great!

Thank you!

Itā€™s been a while since I last made a binding for openhab, but if you give me a few days to find the time, I might provide you with some sort of boilerplate project, which you would have to try out, probably debug, and fill in with the functionality you need.

I did hack up a way to get this to run a while ago but I used eventghost. They have a JVC plugin which I then accessed from openhab (or it might have been incontrolHA) through http get.

It should be able to be run through the serial binding which I might try later when I have time.

Writing a binding is probably beyond me but if I have time might try to copy another binding. I donā€™t know what programs to use or much about it at all.

Josh

Thatā€™s great! Thank you both.

Hi guys, I just wanted to touch base before the weekend and ask if youā€™ve had a chance to look at this. No rush, of course.

Thank you again!

Were you controlling via Serial or the network. (Sounds like network) I have one of the lower range ones with serial only control. I donā€™t have the ability to write a binding but might be able to get mine going through the serial binding.

I just canā€™t test as Iā€™ve moved house and realistically no HT setup for a while until I can get some renovations done.

Josh

Iā€™m only wired into the network as it is, so I think in my case it would have to be TCP/IP.

Have you tried using the TCP binding.

http://support.jvc.com/consumer/support/documents/DILAremoteControlGuide.pdf

Should give you the codes needed. Try the test command
21 89 01 00 00 0A
and see if you get a response.

Josh

HEY!! No I had not, the three way handshake scared me offā€¦

I just tried thisā€¦

String JVC_Projector {tcp=ā€œ>["21 89 01 00 00 0A":192.168.1.100:20554:ā€˜REGEX((.*))ā€™]ā€, autoupdate=ā€œfalseā€}

and this popped up in event log:

2015-09-29 15:38:18 - JVC_Projector state updated to PJ_OK

Very promising!

Well perhaps I spoke too soon. Iā€™m not exactly sure where to go from here. Iā€™m not very clear on how to use this binding. Iā€™ve tried a number of things like sendCommand to the TCP item, but I canā€™t seem to get it to respond anymore.

Iā€™m using:

String JVC_Projector {tcp=ā€œ>[:192.168.1.100:20554:ā€˜REGEX((.*))ā€™]ā€, autoupdate=ā€œfalseā€}

And a rule that executes:

JVC_Projector.sendCommand(ā€œ21 89 01 00 00 0Aā€)

I get this message:

2015-09-29 17:05:26.060 [ERROR] [t.protocol.internal.TCPBinding] - transformation throws exception [transformation=null, response=PJNAK]
java.lang.NullPointerException: null
at java.util.regex.Matcher.getTextLength(Matcher.java:1283) ~[na:1.8.0]
at java.util.regex.Matcher.reset(Matcher.java:309) ~[na:1.8.0]
at java.util.regex.Matcher.(Matcher.java:229) ~[na:1.8.0]
at java.util.regex.Pattern.matcher(Pattern.java:1093) ~[na:1.8.0]
at org.openhab.binding.tcp.protocol.internal.TCPBinding.splitTransformationConfig(TCPBinding.java:235) [bundlefile:na]
at org.openhab.binding.tcp.protocol.internal.TCPBinding.transformResponse(TCPBinding.java:253) [bundlefile:na]
at org.openhab.binding.tcp.protocol.internal.TCPBinding.parseBuffer(TCPBinding.java:149) [bundlefile:na]
at org.openhab.binding.tcp.AbstractSocketChannelBinding.parseChanneledBuffer(AbstractSocketChannelBinding.java:999) [bundlefile:na]
at org.openhab.binding.tcp.AbstractSocketChannelBinding.execute(AbstractSocketChannelBinding.java:1680) [bundlefile:na]
at org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute(AbstractActiveBinding.java:156) [org.openhab.core_1.8.0.201507290114.jar:na]
at org.openhab.core.service.AbstractActiveService$RefreshThread.run(AbstractActiveService.java:173) [org.openhab.core_1.8.0.201507290114.jar:na]

Look Iā€™m definitely not an expert here, more of a hack but I would try

  1. going back to the original one

    String JVC_Projector {tcp=">[ā€œ21 89 01 00 00 0Aā€:192.168.1.100:20554:ā€˜REGEX((.*))ā€™]", autoupdate=ā€œfalseā€}

  2. trywithout the Regex. You donā€™t really need to transform anything would be a guess, you donā€™t really need a response.

Try with a different command and then see if the PJ will change, something like source or something.

Josh

Also forgot, you running on win or linux?

You should still have serial control, Iā€™ve had better luck using serial with other items and thatā€™s what I would use for my JVC.

Josh

It wonā€™t run without some sort of ā€œtransformā€ there. Regex is simple, just keeps it as a string. I can remove the first command, but I get the same result.

Iā€™m running Linux.

If thatā€™s true, Iā€™d be happy to try something. Iā€™m not sure how serial works.

Iā€™ve setup a matrix with serial and managed to get that going with the serial binding.

My rack should get delivered today so I might be able to setup a test environment for JVC control with the serial binding.

I was using a Moxa IP to Serial, and then a serial cable. I got it to work with eventghost on windows but would prefer to go linux/openhab.
If your PC has a serial connection then that would be easier that an IP to serial solution. I have heard some people on here getting some cheap ones off ebay for $10-$20 I think.

Only other thing I can think of is if the hex codes need some sort of separation like / between the commands.

Josh

Iā€™ll keep that in mind. Thanks again for your help with this.

I think Iā€™m close to getting the TCP binding to workā€¦ I seem to be stuck though.

Here is my item:

String JVC_Projector {tcp=ā€œ>[192.168.1.100:20554:ā€˜REGEX((.*))ā€™]ā€}

Openhab automatically connects and keeps the connection open

[INFO ] [t.AbstractSocketChannelBinding] - The channel for /192.168.1.100:20554 is now connected
[INFO ] [org.openhab.model.script.JVC: ] - PJ_OK

PJ_OK is the first component in the triple handshake.

Here is my rule for execution:

rule "JVC Test"
when
Item JVC_Update changed
then
	test_jvc = test_jvc + JVC_Projector.state.toString() + " "
	
	JVC_Projector.sendCommand('PJREQ')
	waitJVC = createTimer(now.plusMillis(1000))[|
		test_jvc = test_jvc + JVC_Projector.state.toString() + " "
		JVC_Projector.sendCommand('\u0021\u0089\u0001\u0050\u0057\u0030\u000A')	

	waitJVC2 = createTimer(now.plusMillis(1000))[|
		test_jvc = test_jvc + JVC_Projector.state.toString() + " "
		logInfo("JVC: ", test_jvc)	
	]]
end

This sends the HEX code corresponding to Power Off. And the projector replies according to the documentation with PJACK after I send PJREQ. But it doesnā€™t do anything. Arg.

[INFO ] [org.openhab.model.script.JVC: ] - PJ_OK PJACK !?PW0

So close. Any thoughts?

Iā€™ve tried changing the enviromental variable to en_US ISO-8859-1 (suggested Serial binding is not sending values above 63 in Decimal or 0x3F in HEX)

Iā€™ve also tried specifying no postamble in openhab.cnf:

tcp.postamble=

Perhaps something with the transform?

Also, my iOS Roomie Remote App is able to control the projector. So it is possible. I tried running wireshark to sniff what is happening, but I couldnā€™t locate anything useful.

Mate thatā€™s further than I would have gotten with it.

I donā€™t really have any other ideas except

[INFO ] [org.openhab.model.script.JVC: ] - PJ_OK PJACK !?PW0

What is the !?PW0 section at the end, I assume the response from the PJ after the off command. If so reading the pdf the response is usually a hex code back so that might be a clue.

The only other thing is maybe try the ASCII key for remote control emulation instead of direct control. Maybe eliminate the possible hex issues.

Josh

Iā€™m not sure what you mean with the ascii key? Doesnā€™t it have to be the machine code?

the !?PW0 is openhab reading back the ascii translation from the hex code Iā€™m sending in sendCommand.
21 89 01 50 57 30 0A
50 57 = PW
30 = 0
some of these donā€™t translate, so there is a ?.