Cmd to cause HDMI switch to change to OSMC input?

I have OSMC connected to my TV via an HDMI switch with auto switching capabilities.

Are there any commands that can be sent (via SSH or API) to force the HDMI switch to change to the correct HDMI input for OSMC? I believe something similar could work with CEC, however my TV is a good 5 years old and doesn’t have that feature. Usually restarting the RaspberryPi completely forces the HDMI switch to change to the correct input. But that’s a time consuming method that’s less than ideal.


Long shot here as both my TVs support cec but if a reboot changes the source; just restarting kodi may have the same result. Try:

sudo systemcrl restart mediacenter

Thanks Tom.

sudo systemctl restart mediacenter

That’s a really good idea but unfortunately that doesn’t seem to work. I might have to resort to doing a hard restart each time. There must be some sort of command or loss of signal on the HDMI that happens during a restart. Which then in turn the HDMI switch picks up on and changes to a different input.


You be better of using your tv remote just to change to the input of pi, doing hard restarts will damage the sd card.

Thanks Tom.

The issue is that as my TV only has 2xHDMI inputs I’m having to use a HDMI switch. So in this case I wouldn’t be able to use the TV remote to switch to OSMC.

Out of interest, how does doing a hard-restart cause damage to the SD card?


I’m assuming you mean pull the plug, when you say hard reset; rather than restarting via the command line.

If the pi is powered off, with out being shutdown properly: a process may be reading or or writing to sd card; if stopped by power outage can lead to corruption of data.

Thanks Tom,.

No my mistake in using the wrong turn of phrase. I meant restarting OSMC via shutdown -r now or reboot now.


Ok, you’ll be fine then.

Thanks Tom