HDMI Matrix Coding Configuration

Hi all,
I have a HDCVT 4x4 HDMI Matrix which I am trying to control through HA. I have all of the hex commands but right now I just want to turn it on/off.

Below is an extract of the Hex commands from my user manual:
Power on/off command package length is 13byte:

[0xa5+0x5b+0x08+0x0B+ Power onoff(0x0f:ON; 0xf0:OFF) +0x00+0x00+0x00+0x00+0x00+0x00+0x00+ checksum ]

Power on/off query package is 13byte:

This is a query command which mean you must send query package and then receive an answer.

For example:

Send package: A5 5B 08 0C 00 00 00 00 00 00 00 00 checksum

Receive package: A5 5B 08 0C F0 00 00 00 00 00 00 00 checksum

The blue F0 mean Power off, if 0F mean Power on.

I have tried to following in my yaml file (which has no errors and put in the real IP address) but when in my overview when I select it - nothing happs to my HDMI matrix. Can someone kindly help?

switch:
  - platform: command_line
    switches:
      hdmi_matrix:
        command_on: ech -e "\A5\5B\08\0C\0F\00\00\00\00\00\00\00\DE" | nc 192.168.1.xxx
        command_off: ech -e "\A5\5B\08\0C\F0\00\00\00\00\00\00\00\FD" | nc 192.168.1.xxx
        friendly_name: HDMI Matrix

You might want to try “echo” instead of “ech” for the command :wink:

Sebastian

Sorry good spot.
But still not working.

I assume the commands work when you run them manually from a shell?
If you increase HA logging, I think it will tell you if there was an error running the command.
You can try running nc in listen mode on another host and have the command try to contact that one to see if it’s even trying to connect and if the payload is what you expect.

Sebastian

To be honest I am not sure what I am doing as a newbie. But I have the document which has the hex commands and they match when I control the matrix through the web browser console. So if my commands are correct in the config file, it should be sending those commands to the matrix.

You should check from a shell if your commands even work.
For example, you probably need to specify a port for your nc command, since by default nc connects to port 31337, which is probably not the port used by your switch.

I’m not familiar with the HDMI switch, so I can’t be of any help there.
Your HA configuration looks ok to me, so there’s probably something off with your command.

Sebastian

ok. is there a way to find out which port the matrix is using?

EDIT: I think its port 80. So added that to the config file but still not working

That should be in the manual where the communication protocol is documented.
Or you can run a port scan against the host to see which ports are open.

Sebastian

I do believe its port 80 since I can access that url with port 80 inserted.

just going back to running this in a shell. if i open windows power shell, what command do i use to test my hex commands ?

Port 80 is probably some kind of web interface the switch provides.
It’s unlikely that it will accept anything other than HTTP requests on that port.

Doesn’t the switch documentation state how you’re supposed to send the hex commands to the switch?

Windows powershell won’t help testing your command.
Can’t you open a linux shell on your HA installation?
Are you even running HA on Linux? If not, neither ‘echo’ nor ‘nc’ will probably be available.

Sebastian

I am running HA through OMV5 Docker/Portainer. I ran a port scanner which says it works on port 22 (dropbear sshd protocol) and port 23 (telnet). I changed my yaml file and tried both of these ports (as well as port 80), but nothing happened.

The switch documentation doesn’t say much for the power on/off, it only says the following. I obtain the checksum figure from Chrome web console when I control the matrix through web browser. :

Power on/off command package length is 13byte:

[0xa5+0x5b+0x08+0x0B+ Power onoff(0x0f:ON; 0xf0:OFF) +0x00+0x00+0x00+0x00+0x00+0x00+0x00+ checksum ]

I’m not familiar with OpenMediaVault, but you probably can access it using SSH, right?
Do that and you’ll have a Linux shell where you can try if those commands do even work, i.e. the whole “echo … | nc …” command string.
I would go with the telnet port (23) on the switch for a start as port 80 is most likely for the web interface and port 22 is used for SSH, which is basically telnet over an encrypted connection.

When you find the correct commands from the OMV command line, you can start setting up the switch in HA.
Unfortunately, I can’t help you figure out how to control the switch, I could only have helped you setting this up in HA - but as I said earlier, the HA configuration part looks ok to me as long as your command works.

Sebastian

Yes I already tried to access matrix using putty via SSH and Telnet but was not successful. I will have a look at OMV but I believe shellinabox was removed from OMV5.

I’ve found the documentation that you’re probably referring to in your original post.
This is for controlling the device using RS232 - are you sure this applies to the networkcontrol as well?

As far as I can see, there’s a Windows application that allows you to control the switch via TCP/IP.
You could use a packet sniffer like Wireshark to capture and analyze the communication between the application and the switch.

Sebastian

Yes I was told by manufacturer it applied for network control but you never know if they understand.

Anyway, will try wireshark.

Hi @tannaroo Did you ever get anywhere with this?