[DEPRECATED] Samsung TV support in SmartThings?

Hi, as @bobbles said, i got mine working also by first entering into the “remote management” option, located under “support” section on my TV. Afterwards i finished the setup from the smartapp, then the pin was shown and buttons worked correctly. Also your device will be listed into the “network” section, “all share” options, where you can cancel the permissions.

1 Like

@OscarVM Thanks for the report. Could I ask what year TV you have?

So for the newer 2015 models and firmware this doesn’t seem to be on option however 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). If anyone’s interested I can send them the wireshark packet dump.

I also found this if anyone’s interested. I think the page is incomplete compared to my wireshark dump but still has some stuff there
http://forum.samygo.tv/viewtopic.php?f=74&t=7707

How about for 2014 models? (Sorry for the parochial interest - that’s what I’ve got.)

I think it depends on the firmware, the older ones will work fine with this SmartApp, newer ones … well that’s what I’m trying to figure out and any pointers would be helpful.

So if anyone’s interested in helping me debug this, here is the list of 5 commands that needs to be done to get the TV to pair up. These are HTTP Websocket command extracted from Wireshark and replicated using Postman (Chrome Plugin).
You can load these up in Postman, the Commands are run in the following order:

  1. GET CloudPinPage (Prestep Authentication)
  2. GET Step=0
  3. POST Step=1
  4. POST Step=2
  5. DELETE CloudPinPage (Step3 Authentication)

The issue I’ve run into, Commands 1,2 and 3 work great. Somewhere in the response from Command 3 (POST Step=1) lies a code which is used in Command 4 (POST Step=2) in the ServerAckMsg field (the request id returned from Command 3 is used directly in Command 4) and I can’t seem to find a pattern on how it get that ServerAckMsg value from the response of Command 3 ( which returns GeneratorClientHello).

{
	"id": "9fd930d4-cf5a-b9d0-915f-008b2dbe7068",
	"name": "Samsung TV Remote",
	"description": "",
	"order": [
		"1c456655-9e84-0a9e-8542-9f6f0d9f477a",
		"99fdf42b-c5da-1939-c845-250fd6a74a08",
		"745fbc35-db5d-9dfb-0687-a634f2e8c479",
		"12327b72-1bbc-dc0c-59c5-e9b36c861a12",
		"111aaaec-b69b-aaa0-571d-4e9ca1463250"
	],
	"folders": [],
	"timestamp": 1469137311344,
	"owner": "832297",
	"remoteLink": "",
	"public": false,
	"published": false,
	"requests": [
		{
			"id": "111aaaec-b69b-aaa0-571d-4e9ca1463250",
			"headers": "",
			"url": "http://192.168.1.78:8080/ws/apps/CloudPINPage/run",
			"pathVariables": {},
			"preRequestScript": null,
			"method": "DELETE",
			"collectionId": "9fd930d4-cf5a-b9d0-915f-008b2dbe7068",
			"data": null,
			"dataMode": "params",
			"name": "http://192.168.1.78:8080/ws/apps/CloudPINPage/run",
			"description": "Step 3 Authentication",
			"descriptionFormat": "html",
			"time": 1469138526697,
			"version": 2,
			"responses": [],
			"tests": null,
			"currentHelper": "normal",
			"helperAttributes": {}
		},
		{
			"id": "12327b72-1bbc-dc0c-59c5-e9b36c861a12",
			"headers": "",
			"url": "http://192.168.1.78:8080/ws/pairing?step=2&app_id=12345&device_id=6163F897-F7E2-46E6-8ACD-80E3C339F4ED&type=1",
			"pathVariables": {},
			"preRequestScript": "",
			"method": "POST",
			"collectionId": "9fd930d4-cf5a-b9d0-915f-008b2dbe7068",
			"data": [
				{
					"key": "\"auth_Data\"",
					"value": "{\"auth_type\":\"SPC\",\"request_id\":\"4\",\"ServerAckMsg\":\"0103000000000000000014C798C9999D1BD815FFE4C4F8411C37C005C9A00B0000000000\"}",
					"type": "text",
					"enabled": true
				}
			],
			"dataMode": "params",
			"name": "http://192.168.1.78:8080/ws/pairing?step=2&app_id=12345&device_id=6163F897-F7E2-46E6-8ACD-80E3C339F4ED&type=1",
			"description": "Step 2 Authentication",
			"descriptionFormat": "html",
			"time": 1469138324839,
			"version": 2,
			"responses": [],
			"tests": null,
			"currentHelper": "normal",
			"helperAttributes": {}
		},
		{
			"id": "1c456655-9e84-0a9e-8542-9f6f0d9f477a",
			"headers": "",
			"url": "http://192.168.1.78:8080/ws/apps/CloudPINPage",
			"pathVariables": {},
			"preRequestScript": null,
			"method": "GET",
			"collectionId": "9fd930d4-cf5a-b9d0-915f-008b2dbe7068",
			"data": null,
			"dataMode": "params",
			"name": "http://192.168.1.78:8080/ws/apps/CloudPINPage",
			"description": "PreStep Authentication",
			"descriptionFormat": "html",
			"time": 1469138682343,
			"version": 2,
			"responses": [],
			"tests": null,
			"currentHelper": "normal",
			"helperAttributes": {}
		},
		{
			"id": "745fbc35-db5d-9dfb-0687-a634f2e8c479",
			"headers": "",
			"url": "http://192.168.1.78:8080/ws/pairing?step=1&app_id=12345&device_id=6163F897-F7E2-46E6-8ACD-80E3C339F4ED&type=1",
			"pathVariables": {},
			"preRequestScript": "",
			"method": "POST",
			"collectionId": "9fd930d4-cf5a-b9d0-915f-008b2dbe7068",
			"data": [
				{
					"key": "\"auth_Data\"",
					"value": "{\"auth_type\":\"SPC\",\"GeneratorServerHello\":\"010200000000000000008A000000063635343332319BE28900CFCCE6091F911DE2228DC8FE111077742B8AF460A67E205D662CDA9CDEC866A12D72A140BE12F5C0BB6F742478DEED314D99FE08DFAE2ABF78777C133B732041191272E52B3B8C90FAB1464334ECE1E74BBA948055899CB6D0549A44810953324ACA0B093EA0B7BC814F8B271873876348EA44A239C2566454C99AB50000000000\"}",
					"type": "text",
					"enabled": true
				}
			],
			"dataMode": "params",
			"name": "http://192.168.1.78:8080/ws/pairing?step=1&app_id=12345&device_id=6163F897-F7E2-46E6-8ACD-80E3C339F4ED&type=1",
			"description": "Step 1 Authentication",
			"descriptionFormat": "html",
			"time": 1469138087763,
			"version": 2,
			"responses": [
				{
					"status": "",
					"responseCode": {
						"code": 200,
						"name": "OK",
						"detail": "Standard response for successful HTTP requests. The actual response will depend on the request method used. In a GET request, the response will contain an entity corresponding to the requested resource. In a POST request the response will contain an entity describing or containing the result of the action."
					},
					"time": 169,
					"headers": [
						{
							"name": "Access-Control-Allow-Origin",
							"key": "Access-Control-Allow-Origin",
							"value": "https://www.youtube.com",
							"description": "Specifies a URI that may access the resource. For requests without credentials, the server may specify '*' as a wildcard, thereby allowing any origin to access the resource."
						},
						{
							"name": "Cache-Control",
							"key": "Cache-Control",
							"value": "no-cache",
							"description": "Tells all caching mechanisms from server to client whether they may cache this object. It is measured in seconds"
						},
						{
							"name": "Content-Length",
							"key": "Content-Length",
							"value": "440",
							"description": "The length of the response body in octets (8-bit bytes)"
						},
						{
							"name": "Content-Type",
							"key": "Content-Type",
							"value": "application/x-javascript; charset=utf-8",
							"description": "The mime type of this content"
						},
						{
							"name": "Date",
							"key": "Date",
							"value": "Thu, 01 Jan 1970 03:05:58 GMT",
							"description": "The date and time that the message was sent"
						},
						{
							"name": "Secure-Mode",
							"key": "Secure-Mode",
							"value": "true",
							"description": "Custom header"
						}
					],
					"cookies": [],
					"mime": "",
					"text": "{\"auth_data\":\"{\\\"auth_type\\\":\\\"SPC\\\",\\\"request_id\\\":\\\"5\\\",\\\"GeneratorClientHello\\\":\\\"010100000000000000009E00000006363534333231C152181F236BEDF8F21BBA294E8B26902D28323EC2AE4A4C8E37B134C242191D4BCC8E8604ECCA5C7FC0FA193D38A15F9191467B923FF6952FA8E395FBCB972C4544B315E195F02C2911FE364D18BD38B7D124977890BC05BB22FF0560600AC65C47EDE281FCA44CCF8F24644D09CCDA4E1B8620E86C98202586E0A4A60042BF26D539388E74EEEF26B59C9D34BF6787BACD55940000000000\\\"}\"}\n\n",
					"language": "javascript",
					"rawDataType": "text",
					"previewType": "html",
					"searchResultScrolledTo": -1,
					"forceNoPretty": false,
					"write": true,
					"empty": false,
					"failed": false,
					"state": {
						"size": "normal"
					},
					"id": "830eb671-d77a-cbd6-d84d-b358b132d30e",
					"name": "Step 1 Response",
					"request": {
						"url": "http://192.168.1.78:8080/ws/pairing?step=1&app_id=12345&device_id=6163F897-F7E2-46E6-8ACD-80E3C339F4ED&type=1",
						"headers": [],
						"data": [
							{
								"key": "\"auth_Data\"",
								"value": "{\"auth_type\":\"SPC\",\"GeneratorServerHello\":\"010200000000000000008A000000063635343332319BE28900CFCCE6091F911DE2228DC8FE111077742B8AF460A67E205D662CDA9CDEC866A12D72A140BE12F5C0BB6F742478DEED314D99FE08DFAE2ABF78777C133B732041191272E52B3B8C90FAB1464334ECE1E74BBA948055899CB6D0549A44810953324ACA0B093EA0B7BC814F8B271873876348EA44A239C2566454C99AB50000000000\"}",
								"type": "text",
								"enabled": true
							}
						],
						"method": "POST",
						"dataMode": "params"
					}
				}
			],
			"tests": null,
			"currentHelper": "normal",
			"helperAttributes": {}
		},
		{
			"id": "99fdf42b-c5da-1939-c845-250fd6a74a08",
			"headers": "",
			"url": "http://192.168.1.78:8080/ws/pairing?step=0&app_id=12345&device_id=6163F897-F7E2-46E6-8ACD-80E3C339F4ED&type=1",
			"pathVariables": {},
			"preRequestScript": null,
			"method": "GET",
			"collectionId": "9fd930d4-cf5a-b9d0-915f-008b2dbe7068",
			"data": null,
			"dataMode": "params",
			"name": "http://192.168.1.78:8080/ws/pairing?step=0&app_id=12345&device_id=6163F897-F7E2-46E6-8ACD-80E3C339F4ED&type=1",
			"description": "Step 0 Authenticate",
			"descriptionFormat": "html",
			"time": 1469137829143,
			"version": 2,
			"responses": [
				{
					"status": "",
					"responseCode": {
						"code": 200,
						"name": "OK",
						"detail": "Standard response for successful HTTP requests. The actual response will depend on the request method used. In a GET request, the response will contain an entity corresponding to the requested resource. In a POST request the response will contain an entity describing or containing the result of the action."
					},
					"time": 127,
					"headers": [
						{
							"name": "Access-Control-Allow-Origin",
							"key": "Access-Control-Allow-Origin",
							"value": "https://www.youtube.com",
							"description": "Specifies a URI that may access the resource. For requests without credentials, the server may specify '*' as a wildcard, thereby allowing any origin to access the resource."
						},
						{
							"name": "Cache-Control",
							"key": "Cache-Control",
							"value": "no-cache",
							"description": "Tells all caching mechanisms from server to client whether they may cache this object. It is measured in seconds"
						},
						{
							"name": "Content-Length",
							"key": "Content-Length",
							"value": "18",
							"description": "The length of the response body in octets (8-bit bytes)"
						},
						{
							"name": "Content-Type",
							"key": "Content-Type",
							"value": "application/x-javascript; charset=utf-8",
							"description": "The mime type of this content"
						},
						{
							"name": "Date",
							"key": "Date",
							"value": "Thu, 01 Jan 1970 03:05:47 GMT",
							"description": "The date and time that the message was sent"
						},
						{
							"name": "Secure-Mode",
							"key": "Secure-Mode",
							"value": "true",
							"description": "Custom header"
						}
					],
					"cookies": [],
					"mime": "",
					"text": "{\"auth_data\":\"\"}\n\n",
					"language": "javascript",
					"rawDataType": "text",
					"previewType": "html",
					"searchResultScrolledTo": -1,
					"forceNoPretty": false,
					"write": true,
					"empty": false,
					"failed": false,
					"state": {
						"size": "normal"
					},
					"id": "2c1f1958-d3ff-174d-7fba-cd686f07d2e6",
					"name": "Step 0 Response",
					"request": {
						"url": "http://192.168.1.78:8080/ws/pairing?step=0&app_id=12345&device_id=6163F897-F7E2-46E6-8ACD-80E3C339F4ED&type=1",
						"headers": [],
						"data": null,
						"method": "GET",
						"dataMode": "params"
					}
				}
			],
			"tests": null,
			"currentHelper": "normal",
			"helperAttributes": {}
		}
	]
}
1 Like

Did any one come up with a work around for this I have an Samsung 6 Series @johnconstantelo I also get java.lang.NullPointerException: Cannot get property ‘hub’ on null object @ line 126 what part of this did you change. Any help would be gratefully thanks

I don’t have the code in the IDE anymore, but it’s on my Github but it’s down due to the DNS issue hitting a good part of the East Coast. As soon as it’s back I’ll look. Like my post above said, all I did was make sure the namespace was correct.

Hi @troy_houghton,

Github is back. Here’s the SmartApp that works for me: (it creates the DH and device for you)

https://raw.githubusercontent.com/constjs/jcdevhandlers/master/smartapps/jscgs350/samsung-tv-connect.src/samsung-tv-connect.groovy

1 Like

Looks like you definitely need the DH installed too. I thought it was done for you via the SmartApp, but no. Here it is:

https://raw.githubusercontent.com/constjs/jcdevhandlers/master/devicetypes/jscgs350/samsung-smart-tv.src/samsung-smart-tv.groovy

Install both the app and DH, and then use the app to search for the TV.

…and my final post on this topic… I get the same error:

Quite frankly it’s useless for me anyway. I now remember why I removed the smartapp and DH 8 months ago, and why I’me doing it again right now.

The newer TVs won’t work this way - 2014 onwards which is H onwards. Also why there is 2 different Samsung TV apps.

I’m confused so there is SmartApps called Samsung TV 2016 but it doesn’t work ?

There is a device handler in the IDE IIRC but no smart app to control them and I have no idea how to add the tv as a device to allow us to add the handler

Well I installed it - found my Samsung TVs - added them - tried to control them and it promptly took my Hub offline!

Tried 3 times - every time Hub goes offline :frowning:

1 Like

That didn’t happen to me, but like I said in my post above, I removed it for good until something better comes along.

Same thing happened to me. Suggestions anyone?

Exact same behavior on my side using the ios app. From an android phone however, no offline message but it still does nothing.
Live logging says:

12:26:58 PM: trace TV not found…
12:26:58 PM: trace urn:samsung.com:device:RemoteControlReceiver:1 - null
12:26:58 PM: trace [hub:f6f3c5a3-6420-4717-b084-2ade1e600c90]
12:26:58 PM: debug Executing null

I am having the same issue, do we know how to resolve that?