Hello everyone
I’m trying to make a custom integration for my HDMI matrix switcher. It’s an 8x8 so a lot of input and outputs.
The matrix has switching via TCP hex commands and the following code works.
switch:
- platform: command_line
switches:
hdmi_in1_out6:
command_on: echo -e "\xa5\x5b\x02\x03\x01\x00\x06\x00\x00\x00\x00\x00\xf4" | nc 192.168.0.3 8000
friendly_name: Input 1 to Output 6
hdmi_in2_out6:
command_on: echo -e "\xa5\x5b\x02\x03\x02\x00\x06\x00\x00\x00\x00\x00\xf3" | nc 192.168.0.3 8000
friendly_name: Input 2 to Output 6
My question is, there must be an easier way to write this in the config? It’s going to take me a while to put all the swtiches in manually unless there is a simple way to put them in?
The matrix has the following document.
Input 1 to Output 1 -\xa5\x5b\x02\x03\x01\x00\x01\x00\x00\x00\x00\x00\xf9
Input 1 to Output 2 -\xa5\x5b\x02\x03\x01\x00\x02\x00\x00\x00\x00\x00\xf8
Input 1 to Output 3 -\xa5\x5b\x02\x03\x01\x00\x03\x00\x00\x00\x00\x00\xf7
Input 1 to Output 4 -\xa5\x5b\x02\x03\x01\x00\x04\x00\x00\x00\x00\x00\xf6
Input 1 to Output 5 -\xa5\x5b\x02\x03\x01\x00\x05\x00\x00\x00\x00\x00\xf5
Input 1 to Output 6 -\xa5\x5b\x02\x03\x01\x00\x06\x00\x00\x00\x00\x00\xf4
Input 1 to Output 7 -\xa5\x5b\x02\x03\x01\x00\x07\x00\x00\x00\x00\x00\xf3
Input 1 to Output 8 -\xa5\x5b\x02\x03\x01\x00\x08\x00\x00\x00\x00\x00\xf2
This is just one output so you can see how big the final code would be.
What is the best way to go about this please?
Regards
Mathew