Samsung Smart TV Support

I meant to say the A/V amp but a quick search and that’s looking like it isn’t possible either…

+1 to using the chromecast. Until I upgraded my Comcast HD box from the old style box to the new X1, I was actually feeding my chromecast with power from the USB port on the back of my comcast box. I would leave it on to record shows and I could open YouTube on my phone to awaken my tv. I’ve changed the configuration of my setup so I don’t know if the new X1 box has power on its USB, but now I just have it plugged into a slimline 110v to USB (aka cell phone charger) that then connects to my chromecast. I send it a command and can have it to turn on the TV. The tv does switch to the ChromeCast input but I would assume (I havent honestly played with this app) that you can configure something where you do the following:
Assing your chromecast a static IP address
Figure out the command to wake it up
Send this command to CC
Wait however long for TV to boot (Ping it)
Then send it a change jnput command to change to the desired input

Take all that and set it up as a single virtual switch.

Just ny $0.02 :smile:

1 Like

@imbrian Does your Switchboard support controlling Samsung TV’s via WebSocket? The newer Samsung TV’s use a different communication method, so things like Brads previous remote don’t work.

I thought this is what your Switchboard server got around, however I can’t get it to connect to my TV. Just says its unreachable! It’s the UE32J5500 (2015 model) which runs Tizen

@ghesp - No, SwitchBoard uses Websockets to connect to Samsung TVs. If you have documentation I can refer to, I can see about adding support.



1 Like

@imbrian From what I can tell, the newer models also use Websockets, however from what I can gather, I think a Samsung TV app might be required to receive the connection. If that’s the case, then it’s dead in the water!

Reference is here:

Even the old ones required a Samsung TV app for iOS or Android. The implementations that you see for other systems are simply spoofing. I can look into this - but without an actual device to test on, I’m not sure how far I’ll be able to get. As long as they don’t do any type of encryption, it should be doable.

@imbrian Sorry, I meant an app on the TV itself, not an Android/iOS app to control the TV.

Is there anything I can pull from Switchboard to identify where the issue might be with the existing solution?

My TV is, in the config.js I have:

samsung : {
typeClass : ‘samsung’,
title : ‘Samsung SmartTV’,
deviceIp : ‘’,
disabled : false

However upon starting Switchboard, it errors:
Samsung SmartTV: Device is off or unreachable

The TV is on as I’m watching it, but there is no popup asking for authentication

Oh, I see. That seems…interesting. I wouldn’t have expected a manufacturer to require an app for what seems like a standard feature now’a’days.

I don’t want to detract from the SmartThings discussion for things related to SwitchBoard - but you may put console.log messages throughout the device/samsung/controller.js at the “connect” and “error” methods to try and glean additional info. In all likelihood, it’ll be connection refused.

I created a console application that can be used to send remote control commands to Samsung TVs that are using the new encrypted communication protocol. Model 2014+ Samsung TVs.

Run the executable to setup the pairing connection and follow the instructions. Once the pairing is complete the program can be executed with a command argument to send once of the available commands to the TV. I have tested on two different H Series TVs successfully. Let me know if you have any issues. I hope it proves useful for others.

Download Here:

@Timothy_Elery can you share the protocol used for this program so we can replicate it through ST.
I did some of my own homework on this using Wireshark to track down what’s going and it looks like it’s using HTTP Websockets and as series of POST commands with pairing instructions (actually Step0, Step1 and Step2 followed by a CloudPINPage). Is this what you’re seeing also?

Thank you for the console application. I would also be very interested in the details on how you pair and control the newer TV’s because I’d like to implement it for another platform. Can you give us more details about your implementation (or even some source code)? All I think to know is that to pair the TV you call:

  1. http://<ip>:8080/ws/apps/CloudPINPage and
  2. http://<ip>:8080/ws/pairing?step=0&app_id=<some_app_id>&device_id=<some_device_id> to trigger the pin screen on the tv
  3. http://<ip>:8080/ws/pairing?step=1&app_id=<some_app_id>&device_id=<some_device_id> POST request with {"auth_type": "SPC", "GeneratorServerHello": <some_value>} where <some_value> probably contains the pin and some other values as hash
  4. http://<ip>:8080/ws/pairing?step=2&app_id=<some_app_id>&device_id=<some_device_id> POST request with {"auth_type": "SPC", "request_id": <some_req_id>, "ServerAckMsg": <some_server_ack_msg>}
  5. http://<ip>:8080/ws/apps/CloudPINPage/run DELETE request

After that it seems like a websocket address is fetched from http://<ip>:8000/ to connect to the tv, but I don’t know if the control actions take place in this websocket connection or by using the sendKeyCode upnp method in the multiscreen service.

Thanks in advance.

Hi all, please, can someone to clarify me one question?

I try to make 3rd step.

How to recalculate 4-digit PIN code that I can see on TV screen to “GeneratorServerHello” that looks like 010200000000000000008A00000006363534333231F22CC5147D17FBFD821B6CF8FAAD0B431FAF5AA9E2D7B1E53F88559B34DF07293F6EADBE6FB1F3CEC3CA0D1B8FE9195D2C4DD33822A3DDA1B4AB1BFDAE1877E218ECBCB88E85419859CA91DBF88A4B86200B56B19A8A1045E4565C23D585104BDD0D3E55D52F1039B0898A24566F14B481E3CB14786B8DC84B0CE1276740A38F0000000000

I new, that first part 010200000000000000008A00000006363534333231 and tast(third) part 0000000000 are constant values, but what about middle part? For example, if I see PIN code 5488, how to recalculate it to GeneratorServerHello?

Thank you a lot.

1 Like

I have a Samsung J series (2015) TV.
Can you share how you check your TV state? I would like to install led strip behind the TV and have it turn on and off with the TV. It seems there is no official support for Samsung TVs, so I’m looking for solution (SmartApp?) to somehow check if TV is on or off. Any idea if this is possible with Tizen TV?

I have an older TV. It accepts websocket connections on port 55000. I just make a connection to that port every few seconds in an infinite loop. If the connection times out, I assume the TV is off. If it connects, I assume the TV is on. Word of warning to those reading this: Some older versions don’t clear out their internal error logs and, if the log grows to a certain size can basically brick you online capabilities. This requires (to my knowledge) a motherboard change to fix. Ask me how I know.

Thanks for the reply!
Port 55000 is closed on my TV, so I can’t use this.
I tried to ping the TV from my PC and it replies to pings. I tried searching here and as far as I could understand from the results, ST can’t ping other devices? So this idea won’t work either.
Any other ideas? I only need to find a way to check if TV is on or off. Still can’t believe Samsung has not made a official integration. But considering how open the ST is, they are probably worried about security.

SmartThings hubs are able to send out requests - local ones, even. But, I’m not sure if they report back timeouts, which you’d need to determine state. Even if it did, you’d have to write an app to continually poll and report that state to a device. It may be possible, but seems very impractical with SmartThings.

@Timothy_Elery Could you please share the protocol or the source code for this program?

The application with sourcecode can be found on my Github repository here:

The compiled application can be ran directly after downloading the package from here:

Please provide feedback.


Thank you very much!!!

Did somebody create ST version of this code ?