Total TV Control Samsung and Motorola

To check if the tv’s are on, you could power them via a smart socket. If power consumption iis above 5 Watt, the TV is on.

Power sockets have a trigger card in Homey ‘power has changed’. So, that change could set a boolean variable to TV is on. With these two TV boolean variables, you could set an action to switch the Samsung input correctly. In my case I also use the Harmony hub, but perhaps the Samsung TV can be controlled via IR or an App.