I have a crestron HDMI matrix I have been using with hassio that I have wire sharked, and figured out how to control over telnet. Previously I ran my installation on an ubuntu machine via docker, and the only way I was able to get telnet to work was to ssh outside of hassio back to the box, and execute a shell script there.
Currently I have moved my installation over to a PI, set up the built in telnet switch, but as before, nothing happens. No log, switch doesn’t do anything, nada. I went to the hassio shell, and netcat does not work either as it is listening on 0.0.0.0.
- platform: telnet switches: matrix_test: resource: 192.168.1.201 command_on: "sleep 1; SETAVROUTE 4; sleep 1" command_off: "sleep 1; SETAVROUTE 4; sleep 1" timeout: 2
I did have success trying curl telnet://192.168.1.201, and got the greeting message from my matrix, but was not able to access the console or send a command. Even with the command below with necessary sleeps, it never seems to get the ack back.
("sleep 1; SETAVROUTE 4; sleep 1") | curl --raw --connect-timeout 3 telnet://192.168.1.201
I get the greeting, but nothing else.
Finally I implemented the python script integration, wrote a script using pexpect, but I see it still does not let you use the import command despite others saying pexpect is pre-installed, so that is useless to me too.
import pexpect import sys child = pexpect.spawn('/usr/bin/telnet 192.168.1.201') child.expect('HD-MD8X1-4k>') child.sendline('SETAVROUTE 4') exit(1)
What am I doing wrong here? Telnet switch seems the easiest, but with no logger info, I can’t get anywhere.