I am trying to run a command that turns on my TV. I’ve searched around and have seen lots of solutions, none of which have worked for me. There were some solutions that involved changing permissions and I’m not sure if I properly tried any of those. Here’s what I have done:
Switch tvSwitch “TV” [ “Switchable” ]
rule "tv on" when Item tvSwitch changed from OFF to ON then var string results = executeCommandLine("echo on 0 | cec-client -s -d 1", 6000) logInfo("execTest", results) end
Log Entry After Switching tvSwitch to ON
2017-06-28 21:54:34.902 [INFO ] [ipse.smarthome.model.script.execTest] - on 0 | cec-client -s -d 1
I also tried putting the command in a .sh file and running the .sh script instead. No luck.
I have also tried putting creating a Thing with the exec binding and attaching that to the tvSwitch item. The log output from that is:
Log Entries Using Exec Binding
2017-06-28 22:04:59.245 [TRACE] [hab.binding.exec.handler.ExecHandler] - The command to be executed will be 'echo on 0 | cec-client -s -d 1’
2017-06-28 22:05:59.393 [DEBUG] [hab.binding.exec.handler.ExecHandler] - Exec [OUTPUT]: 'on 0 | cec-client -s -d 1’
2017-06-28 22:05:59.471 [DEBUG] [hab.binding.exec.handler.ExecHandler] - Transformed response is ‘on 0 | cec-client -s -d 1’
Like I said, I've seen a lot of similar issues on various forums but can't tell if I've really directed my efforts well enough to try all the different solutions. If someone can try walking through some of the trial-and-error process here with me I'd really appreciate it.