Turn on/off the TV with Hassio

Hey everyone,

I’m hoping that you have a better idea about how I can accomplish turning on/off my TV using home assistant. I want to be able to execute bash commands with Hassio, such as shutting down the TV via ssh. The problem is that my script I wrote works fine if I call it directly while SSH’d into Hassio, but it doesn’t work if I try to call if from Hassio. My configs are below:

https://hastebin.com/osujimivud.bash

I have Hassio installed on a Pi 3, and a 2nd Pi 3 is connected to my TV. Basically my script just executes a CEC command to the 2nd pi via SSH. I can run this command just fine when I SSH into Hassio, but if I try to use the shell command in an automation or call it directly, it doesn’t work. Any ideas?

Only think I can think of is hass.io doesn’t have the right to run the command / connect via ssh.
or there is a prompt that is never answered by hass.io when connecting (when I do a first ssh connection i’m asked if I want to save they key, can’t remember the details)

after a lot of trial and error I decided to get a harmony hub… problem solved!