Getting Samsung TV current input locally

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?

You can with homebridge:

If your not an Apple user or even if you are… you can use webcore to make http web calls to get the state to facilitate automations in Smartthings.

The homebridge plug-in can return the active app, but it can’t return the active HDMI input. If no app is active, it returns 0.

The homebridge plugin is a front end to the aforementioned local API.