Is it possible to get more control over a Samsung tv using Smartthings? The app just lets me change channel and volume and turn the tv on or off. How am i supposed to switch source or use a tv app like Netflix? i still need the remote. This also makes automation very hard, i cannot even switch activity.
I did notice the option ‘setinputsource’ in webcore , but i cannot get it to work, nor can i find any info about it. For Netflix i use the built in tv app, So the setsource wont even work for netflix probably since its an app, not a source.
I have 4 different activities. Watch tv, watch Netflix, use pc and play internet Radio/ Spotify.
My goal is to have 4 different buttons on actiontiles/smartthings to activate the activities using webcore. Im also using a Denon receiver which i can control with smartthings and change source etc. Why with Denon it works easily with a custom DTH found on this community and i struggle with the Samsung tv which is officially supported.
Hopefully any of you already have this issue fixed. I would very much appreciate any help or tips!
I hear ya. I ended up going with harmony smart remote for smartthings integration hopefully somebody else has a better solution. The harmony controls my tv, gaming consoles, dennon, led back lighting, and works with the google assistant natively as well as ST. Not bad for $60. Also sidenote, I recently discovered the DENNON GUI by going to it’s local IP address, how did I not know about that for so long!
Does Harmony and WebCore work well for you? I have had nothing but issues where WebCore doesn’t know which activity is on to preform actions. It’s frustrating and I ended up using room manager to run my pistons.
i haven’t used Harmony much with webcore, I’m assuming only the Harmony routines are exposed to webcore like ST but not the Harmony devices.
i have a similar issue where people turn on the TV with the Samsung remote and the tv randomly doesn’t report as switched on to ST, so Harmony doesn’t auto start the Watch tv activity. then voice commands like volume up don’t work since Harmony tells Google no activities are running . It’s pretty rare though. Usually the tv reports as on in ST.
Yes. Well you can expose devices with kukuharmony but I think the API isn’t working anymore. Haven’t looked in a while. But yeah ST/WebCore was never able to know if a activity is on, has been on or off. This was something I needed but never worked correctly.
Harmony is an option yes. It’s also how i currently control the tv. But for me it is just too slow and unreliable. Sometimes it reacts in 1 second. Most off the times it takes a minute. Tried many different things, but havent been able to fix it.
KuKuHarmony is cool but needs a server which i do not have. Plus it still needs the Harmony.
What i want is just a few commands in ST itself so i can stop using the Harmony at all.
How is it possible i can completely control my Denon receiver and other stuff with ST. But i cannot do the same with my tv? Its from the same company as ST… and just for this 1 thing im forced to use Harmony.
I feel like there should be a way to do this. I dont know how, but i cant be the only one who wants this. Theres many Samsung tvs around!
@John010 I figured out how to control the apps and source inputs on my TV with SmartThings and WebCore. This also allows the use of Alexa to “turn on Netflix” and the TV will turn on and open the Netflix app. I have this working for: Netflix, Amazon Prime, Disney+. I can also control input sources by name. So my Apple TV is on an input and the PS3 is on another. Again, using Alexa (or the SmartThings app) I can turn on the TV and it’ll switch to those.
Are you still interested in knowing? It’ll take me time to write it up so I want to make sure there is still a need.
In the end, I couldn’t find all the app IDs I wanted (see: Disney+) and wrote a quick application I installed on the TV to have it dump the application IDs. If you need the application, I can post it. You’d need to be comfortable turning on developer mode on your TV and running a web app on it built from the Tizen IDE (you’ve always wanted to be a Tizen developer, right? ).
Some additional quick thoughts before the Meat and Potatoes How-To:
In the examples above, DisneyPlus didn’t work in pattern 2 but it worked with pattern 1. You’ll just need to experiment.
Some apps work as just the app name (it’s case sensitive), like Netflix, others require the app ID, MCmYXNxgcu.DisneyPlus.
A quick way to test (outside of SmartThings and WebCore),
Turn on the TV
Send this command (replace TV_IP and whichever URL pattern you’re testing) from a terminal on a computer on the same Wi-Fi network as your TV:
curl -X POST http://TV_IP:8001/ws/apps/Netflix
curl -X POST http://TV_IP:8001/api/v2/applications/Netflix
Netflix should open. If it does, now you know which url will work for Netflix and can be used inside WebCore. If either URL doesn’t trigger the app to open then your TV may not support these two patterns.
How-To Part 1!
Create virtual switch device
You need virtual switches to toggle your apps ON. Go download the Samsung SmartApp named “Virtual Device Creator”. It’s in the More tab of the SmartApps download area in the SmartThings Classic app. If you can find it in the new app, it may also work in there. I used the classic app to set these up.
Open Virtual Device Creator and create a new switch. My account has issues so I couldn’t use a momentary switch. If you can use that, then your setup can omit later steps where we switch off our switch once we execute a command.
Name the switch “Netflix” and save.
Go to the WebCore SmartApp and add the new virtual switch as a device that can be used by WebCore.
Create WebCore piston
Create a new piston from the web dashboard on a desktop browser (so much easier to read than mobile).
Name it “Netflix”
In the settings (gear icon) for the piston, turn on “disable command optimizations” .
In the If condition, choose your new switch named Netflix.
Note on the setInputSource value, it’s the name of the input that you gave it in the TV.
Note that if you created a momentary switch instead of a toggle switch (back in step 2 of virtual device creation), then you can omit the last five lines in the piston to turn off the switch again.
Now test it same as above. If it doesn’t turn on and switch to the correct input, try increasing the WAIT timer by 1 second until it does. I found anything less than 5 seconds wasn’t picked up consistently by the TV. I got mixed results at 3 seconds.
With the SmartThings skill enabled in Alexa…
Tell Alexa to discover new devices. Wait until it finishes.
Say “Alexa, turn on Netflix”.
Amaze your family with your wizardry!
Hope this was helpful. Let me know if you run into issues or if I need to clarify anything.
Thats a very nice trick. I managed to got it working for the Netflix app. Press a button on action tiles and netflix opens on the tv. Perfect! The part 2 part i already had running pretty much the same way as you did it.
Just 1 problem with part 1 which i cant seem to find a solution for. When i start Netflix using ST obviousely ST knows about it. But when i start netflix using just the tv remote i cannot figure out how to let ST know that netflix is running. Did you manage to get this working? The trouble is that it does not use a source input like tv or pc. So im not sure how to do this.
Hey! Just saw your response. I thought i’d be notified when someone wrote back to the thread, sorry for the delay. I’m heading out of the house at the moment but i’ve set aside sometime when I get back to respond properly. WebCore shouldn’t need any extra authentication since it operates like the curl call - when a web request is made to the TV from a device that it hasn’t seen before, the TV should prompt you to allow or deny it. I’ll have to test on mine to see if webcore causes that popup to show.
Glad to hear its working! I’m just heading out of the house now. Let me put some thought to your question and i’ll get back to you.
Back now. As far as I can tell, communication with the TV is a one way path. We can send commands to it, but receiving events when things happen on that TV doesn’t seem possible. I believe the reason is because the TVs were moved from local control in 2016 to cloud control after that. I’m looking into ways we can receive events from the TV’s cloud device handler. Maybe registering for web socket events or something?
In the meantime, you could setup a WebCore piston that polls the TV at the /ws/apps/Netflix URL and parse the XML response, looking for the value in the <state> tag. Mine says “running” when the app is open.
I really have no idea how to implement what you are suggesting with the xml doc. I will have to look into that. But good to hear there might be a possibility to get the status of the netflix app and act on it. It is pretty much the last thing i have not figured out yet about the tv. If i understand correct the idea is this:
Get an xml response from location and add a webcore rule like below:
IF state of (Netflix tv app url) = ‘Running’, THEN (insert task)