TV Integrations (LG, Samsung, Vizio)

Has anyone had any success on porting the Samsung driver and a Vizio driver to Hubitat?

I am trying again on the Samsung TV. Will take a week or so. I think I know the new port and I will try various methods to get around the sleep for an off device w/o WOL. If successful (50/50) it will have an app install and a manual install (for those who wish to use Static IP addresses and no app).

Shout at me if someone has actually finished a unit.

Dave

1 Like

More details on this would be nice.

So my mish mash solution is as follows

First part was to connect my TV to SmartThings. This allowed SmartThings to turn off the TV, control volume, channel, as well as input control.

I then installed Hubconnect in Hubitat and linked the TV in SmartThings with Hubitat. This will create a Samsung TV device in Hubitat thus giving Hubitat control of the TV via SmartThings.... Except power on as discussed.

Finally I installed the boot me up Scotty app, found here... Hubitat/apps/Boot Me Up Scottie at master · stephack/Hubitat · GitHub
I then created a separate virtual switch for power functions. Pointing the app to the TVs IP and Mac address and then associating it to the virtual switch will give Hubitat the ability to turn the TV on. I then bound that virtual switch to the Samsung TV device power attribute created through Hubconnect, so that turning the TV off will automatically turn this switch off as well.

Obviously a dedicated app in Hubitat would be preferable. This isn't 100% reliable, but it does work about 90% of the time. It has allowed Hubitat to automatically dim the lights, and turn on my TV light strip when the TV is turned on using any method, or increase the brightness back to full and turn off the light strip when the TV is turned off using any method

2 Likes

I was hoping for the same solution, SmartThing w TV to HE via Hub Connect or my new amour Node-Red. Trouble is my TV is ~2015 model and can't add to ST hub. :face_with_raised_eyebrow:

Status of my effort (If anyone cares) on Samsung TV Remote
04.17.20.

  • There are three different integrations depending the TV model. These are NOT compatible:
  • I developed test code for the Samsung driver (just in-case) based on info on GitHub
    • I was able to connect using webSocket interface.
    • The command derived an error "unrecognized method value", meaning that my device doesn't support this (as expected).
    • Code for the experiment may work on post 2016 models. I would appreciate feedback if it does. The code is just to light the fire for a single-driver integration.

Dave

import groovy.json.*
metadata {
	definition (name: "AA TV via WS", namespace: "davegut", author: "Dave Gutheinz")
	{ command "test" }
}
def ip() { return "192.168.50.143:8001" }	//	Change ip portion to your IP.
def getTestKey() {	//	Pick key you want to test.
//	return "KEY_PLAY"
//	return "KEY_PAUSE"
//	return "KEY_VOLUP"
//	return "KEY_VOLDOWN"
	return "KEY_MUTE"
//	return "KEY_POWER"
}
def test() {
	log.trace "<b>Test Started Test Started Test Started</b>"
	runIn(5, close)
	interfaces.webSocket.connect("ws://${ip()}/api/v2/channels/samsung.remote.control")
	pauseExecution(500)
	interfaces.webSocket.sendMessage(getCommand(getTestKey()))
}
def close() {
	interfaces.webSocket.close()
}
def getCommand(key) {
	def command = [method: "ms.remote.control",
				   params: [Cmd: "Click", DataOfCmd: key,
							Option: "false",TypeOfRemote: "SendRemoteKey"]]
	log.trace new JsonBuilder(command).toPrettyString()
	return new JsonBuilder(command).toPrettyString()
}
def parse(response) { log.trace "parse: " + response }
def webSocketStatus(response) {
	log.trace "status: " + response
}
1 Like

Link to git please
Tia

Duh, figure it out; results below

TV model: UN65HU8550
Thx

Thanks for testing. Your model number indicates you have a 2014 model. I have the 2015. I have found more out:

  1. The code provided will work on 2016 and later (not tested). If it does, I am willing to continue developing with collaboration of a user who can do some testing so I can make the driver work properly.
  2. For 2014 and 2015 models, I will work independently to develop a driver. These models use AES encryption (ouch).
  3. The legacy (very old) sets are going to be orphaned unless I hear a large begging for better results.
1 Like

Thank you very much for your efforts.....

Don't know if this helps or not, but here is the results from my Samsung UN60JS7000:

Here are the results from my Samsung UN50NU6900:

Don't know what any of this means or if it is even helpful!

Thank you for trying to get this to work!

Here is a test on a 2019 QN43LS03RAFXZA TV

I don't know if this is any help, but I ran across this on GitHub where a lot of the different year TVs seem to be working:

My TV responds to http://192.168.x.x:8001/api/v2/ in a web browser. Here is the log from Hubitat on this same TV. It is a couple year old UN65MU7000.

[dev:2726](http://192.168.0.115/logs#dev2726)2020-04-19 06:24:57.592 pm [trace](http://192.168.0.115/device/edit/2726){ "method": "ms.remote.control", "params": { "Cmd": "Click", "DataOfCmd": "KEY_POWER", "Option": "false", "TypeOfRemote": "SendRemoteKey" } }

[dev:2726](http://192.168.0.115/logs#dev2726)2020-04-19 06:24:57.185 pm [trace](http://192.168.0.115/device/edit/2726)status: failure: Code 1005 is reserved and may not be used.

[dev:2726](http://192.168.0.115/logs#dev2726)2020-04-19 06:24:57.116 pm [trace](http://192.168.0.115/device/edit/2726)status: status: open

[dev:2726](http://192.168.0.115/logs#dev2726)2020-04-19 06:24:56.960 pm [trace](http://192.168.0.115/device/edit/2726) **Test Started Test Started Test Started**

Going to standby for a while and determine direction. There are three Samsung remote api's

  • Legacy (pre-2014) uses hex-coded to a port 55000. Because of age of devices, I will not work this.
  • Encrypted (2014, 2015 (mine). Will probably be second up. Requires implementing a complex handshake for a pin and AES encoding.
  • Current (assumed 2016+): Resides on port 8001. Will work this first, I will be putting some test code together for this and ask for help. First I want to fully understand flow.

Dave

2 Likes

I just tried it on my 2016 UN65KS9000 TV and got the following error on both power and mute:

Tried it on my 2019 model and got this:

1 Like

Thanks. I have work to do on the initial comms.

1 Like

Any progress on this?

Ran into a roadblock getting the encryption on the device to work properly. The algorithm was very long and not suitable for Hubitat. Isigh)
Dave

Using Hubitat HTTP Momentary Switch Driver :

I am able to start Netflix.

I got the idea from :

Also I can start the TV using WOL :

It seems that the issue with websocket is related to a token :

My TV is 2018 : UN65NU8000

I installed the Chromecast Integration and it found my NVidia SHIELD but nothing else. Not sure how I can use that ability though.