Home Assistant Community

Switch using Telnet Commands to 8x8 ATEN HDMI Matrix


I seen in some previous posts that the switch command can be used to send Telnet commands. I have tested my HDMI matrix using Telnet and I can control it as expected, however my issue is that I cant send the commands from Hass.IO as the telnet session requires a username and password.

Is there a way to do this ?

Globalcache iTach IP2SL

anyone know how to pass credentials in telnet session ?


Does this help? https://serverfault.com/questions/92736/send-login-credentials-and-commands-using-shell-script-via-telnet


Did a bit of digging an found some sort of advice, though at this moment it doesn’t seem to be working. It must be stated that when I run the commands below in Putty it works as expected.

In my configuration.yaml I have the following;

  - platform: command_line
       command_on: /config/hdmimatrix/xboxone2office.sh
       friendly_name: "Xbox One to Office TV"

This switch then calls a script file which has the following in it;

{ sleep 1; echo -e “username”; echo -e “password”; echo -e “ss 03,06”; echo -e “exit”; } | telnet

I have also run from the SSH on the HASS.IO the following command

chmod 755 /config/hdmimatrix/xboxone2office.sh

Now as expected the swich now appears in the states but when run it doesn’t make the changes expected, in fact it doesn’t appear to do anything at all.

Im probably missing something but I have been looking at it that long now my head hurts lol


Your script doesn’t look like the one I pointed to on serverfault. For a start you surround your echo commands with curly brackets { }, whereas the example uses plain brackets ( ).


Morning @nickrout, further searching in the community took me to the following topic, this is where the deviation in syntax came from

Still doesn’t work though so will try it with normal brackets and see.


you can check this topic here


@elRadix you any idea how I could install Expect on Hass.IO ?


if you can logon in ssh in hassio (using the ssh addon I guess) you could try these commands…

apk update
apk add busybox-extras
apk add expect

ps. I’m not an hassio user


Thanks @elRadix seems to look positive … just need to find where it was installed now



which telnet
which expect

I guess you’ll have to re-execute these command when there is a new HA update…or create a script to run at hass start with an automation ie. shell_command