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.
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;
switch:
- platform: command_line
switches:
xboxone_2_homeoffice:
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;
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 ( ).
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
I’ve recently purchased one of the same HDMI switches and hooked it up to my Hassio server via usb-to-rs323 cable. however im unable to get the hang of how to control it via command/ssh. Would you be kind enough to shed some light on it for me please and explain how you have controlled it to change hdmi ports.
This created a pyscript folder in the root of my /config
create a script file in the pyscript folder for each of the options, If you use all 8 inputs and all 8 outputs that will be 64 scripts in total … example of one below;
Once you have created all these you can go to Services select pyscript.<> to run it.
I have built on this by building dummy switches to set the status etc but above is the basics to get your Aten HDMI matrix switching inputs and outputs from HA