HDMI CEC Matrix

Are you still trying to get this to work? I saw your posts on the Sending TCP packets to a device thread. I’ve started working on a script (stand alone python script currently working) for my J-Tech digital 8x8 matrix - commands are almost identical (# instead of !).

If there’s interest I can spend a bit longer on it.

1 Like

Definitely still interested…I kind of gave up and just control it with IR commands but would much rather control via TCP packets.

Ok, take a look at generic-hdmi-matrix. I have only just put this together today, so let me know how it goes.

It requires user input from command line (built this way to test it before I go any further), and it accounts for the 0-7 input/output offset, so enter 1-8.

Looking at the link to the nohassle commands, yours seem to end with !, try this script as-is, but you may need to modify this line accordingly:

commandstring = '@T' + user_outp + user_inp + '#'

I ran your python script on my windows PC…i enter the output and input. Then it thinks about it for a second and then the python script exits…just before it exits it says something but I can’t read it fast enough. It also doesn’t change any of the outputs.

Are you double-clicking the script to run it? Prompt will close straight away once run I think. If you open cmd prompt and run python matrix-switch.py it should stay open so you can see the error.

I get the following error…

Which output? 1
Which input? 1
Traceback (most recent call last):
  File "C:\Users\Alex\Desktop\matrixswitch.py", line 29, in <module>
    packet.connect((ip, port))
ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it

I can send the commands via packet sender no problem…

When you changed the ip address to 192.168.0.210, did you leave the single quotes or retype them? Just maybe confirm that they are still straight single or double quotes.

Did you change the other line I mentioned above (! instead of #)?

just checked…I left the single quotes and just replaced the ip address. I tried both ! and #. any other suggestions?

Odd that these devices are obviously clones of each other, but command structures seem to be different (according to the spec, at least).

Maybe try:

commandstring = '@T ' + user_outp + ' ' + user_inp + ' !'

When I use packet sender it converts the commands to HEX…does the script you wrote convert the inputs to HEX before sending to the matrix?

Yeah, commandstring = commandstring.encode() does that.

Try changing commandstring line to my previous post, and if that doesn’t work, remove these two lines:

commandstring = '@T' + user_outp + user_inp + '#'
commandstring = commandstring.encode()

and replace with (may need to experiment with this - trying to remember the structure off the top of my head):

commandstring = b'\x40\x54\x20\x30\x30\x20\x30\x30\x20\x21'

If that works, it shows that the script is sending the command, but not building the command in the right way.

Hello, I just installed hassIO in a windows PC in a python venv, I have the Jtech 8x8 switch also. Did you get it to work in HA? If you have a sample setup I would greatly appreciate seeing it to see how I begin to install it in my config.

It seems the reason that does not work is because the Jtech expects authentication.

Default username : admin
default password : 123456

I’m interested too if someone has had any luck with this working.