I’m been struggling for the last 2 hours with the syntax of the setInputSource for a Samsung TV
This are the options setInputSource(mode<enum {AM, CD, FM, HDMI, HDMI1, HDMI2, HDMI3, HDMI4, HDMI5, HDMI6, digitalTv, USB, YouTube, aux, bluetooth, digital, melon, wifi}>)
Tried with setInputSource(HDMI1) … setInputSource(“HDMI1”) etc… but nothing, always returning “the request is malformed” or setInputSource not a valid value…
I’ve tried a lot a loooot of combinations but none works, im really missing how the syntax works… and I can’t find nothing on Google…
Hi, @Niiky. How are you doing?
From where are you sending this command?
I created a virtual device that uses the mediaInputSource capability, and I can send the command through Postman as follows:
But still I had to figure out how to send the command through a google home device, I may try Postman, I will be able to send commands from there to the TV? How it connects?
But how did you know how to send it? I was really lost on this, tried a lot of combinations and none worked, using this setInputSource(1) returned error that string was expected then I tried (HDMI) and (“HDMI”) but didnt work either.
Whats the logic on the slashing the quotes?
Anytime, @Niiky! Well, based on this parsing method from the CLI I saw that the values were separated correctly.
So my guess was (because it has happened to me before) that the terminal wasn’t sending the values as expected (Strings) that’s why I wrapped the command with the quotes. As the argument also needs them, you need to escape (\) the character to include it in the String and it won’t be considered as a closure symbol anymore.
Hi @navelyz,
I tried sending the setInputSource command as you explained in the previous post. But I always get an error response. Has the API been changed and I need to adjust something in the request?
I think you should get the device status and see if it has limited the options you can use.
The capability mediaInputSource has an attribute called supportedInputSources which defines the options accepted by the device and the response of the request seems to point out that’s the reason of the command rejection.
To get the status, you need to make a GET to https://api.smartthings.com/v1/devices/deviceId/status
Thanks for your fast reply. I tried getting the status which returned the values I would expect (e.g. “HDMI1”).
The setInputSource call did work for me until a few weeks ago. Since then I only get responses as described before. I don’t know if it has something to do with the problem but my TV is shown as offline in the SmartThings App. But it is turned on and some commands seem to work. Only the setInputSource fails…
Im using samsung smart tv with android tv stick. Stick doesn’t support input switch. Is there anyway to switch input source using android OS or url?
I can easily switch input using smartthings siri shortcut on my iphone. Any help would be appreciated.