Tizen TVs have a local web server on port 8001 that you can use to get info about the device as well as send key press commands over HTTP. One thing it can’t do is tell you the current input.
If the TV is connected to SmartThings, you can get the active input from the ST API at https://api.smartthings.com/v1/devices/deviceid/components/main/capabilities/mediaInputSource/status.
Is there any way to get the current input source locally from the TV, without having to go up to the Samsung cloud?