Wednesday 18 June 2014

Switching your HDMI inputs on a Samsung TV

Hi all, let's assume that you have a Samsung TV and a Raspberry Pi connected on an HDMI input.

Using CEC you could send:
 echo "as" | cec-client -s
to switch to the next input,. However this is inconvenient since it does not switch "back" to your previous input. So what can you do?

Get this lovely utility from here. (Disclaimer: I did not write this, I got it on GitHub). It is a lovely python script which you can use to send commands to your samsung TV AFTER you have turned it on. In my case I use the commands KEY_HDMI2 or KEY_HDMI3 but there is a great variety of commands that you can send.

Keep in mind, your device (where the script will run needs to be paired with your TV in order for this to work. This can be a simple procedure, the first time you fire a command the TV asks if you would like to pair with the device, you say yes and that's all.

Python is already installed on the xBian Linux for R-Pi. So, in the same manner that I have described here, you can set up an ssh command that executes this script with python on your raspberry Pi.

Usage:
$ python samsung.py KEY_HDMI.

A more comprehensive list of commands can be found online, search google for samsung and KEY_HDMI or look for example here.

1 comment:

  1. This comment has been removed by a blog administrator.

    ReplyDelete