Samsung TV integration Question -- Driver info starting post 127

What year TV did you get it working with? I'm trying with a 2019/2020 and it doesn't seem to be discovering it

I have no idea if this will work on any models. This is just me trying to figure out what it would take to get a working driver for Hubitat on the models I have. I'll probably end up mashing up 3 or 4 different drivers to get one working eventually if ever. Samsung broke a bunch of stuff in their firmware so for the time being a Harmony Hub is probably going to provide the best experience across all their models.

Thanks, I'm not a groovy expert by any means but I'll give it a college try and see what happens.

I believe I actually found that information direct from Samsung themselves. They tell you in order to power on your TV via a network it needs to be on WIFI. It's by design that you cannot power up via LAN, unless you use the WOL method.

For anyone that wants to use LAN over wifi (so many reasons you would, streaming over WIFI can be quite strenous in a larger space) you will need to create a separate virtual switch to fire the WOL request. This will turn on your TV (something even the app doesn't consistently do via LAN)

So i tried the code in both hubitat, using the changes lewis mentioned, and also in smartthings. Neitherof the hubs can discover my 2018 Q8FN model. I would suspect this would be for older generation TV's, but i've no way to test that theory.

I've tried w a ~2014 UN65HU TV, no luck. From the logs, the TV is found via SSDP, but the port # is not correct so it fails to determine TV's players (smart apps). Haven't gone any farther

That's as far as I got, too. It starts the discovery, finds a TV, extracts info from it (ip, etc) but then keeps coming up as an unverified device. This just repeats indefinitely. My TV is also a 2014, 'HU' series.

Still poking around, so we'll see if I can get anything to work.

I've been trying every HA SW packages under the sun: Home Assist, HomeBridge, Roku Stick+etc. W Roku can launch NetFlix, Prime, etc. BUT can't get Roku to switch TV HDMI to my FIOS STB. Had limited success w HB., can detect TV is on or off; in combination w NR, it's small step. Just bought a Broadlink Smart IR Remote Control Hub. W NR nodes, hopefully can get control to switch to FIOS STB ie HDMI port ....

I haven't had any luck getting past 'unverified player'. I dug a little more into the code and it seems like it's meant for 2013 or earlier models which is why it's not extracting the correct info to get verified on my 2014.

Hi all, another Hubitat newbie here, and am stumped on SmartThings so looking for assistance. First, let me say we don’t have a ST hub, don’t plan on getting one. What I’m hoping to do is simple, be able to create some simple activities that are basically “when the TV shuts off after 9 pm, turn on the bedroom light.” TV is a Samsung Q70 that’s less than 2 yrs old, light to turn on is a Lutron Caseta. The light is in the hub just fine and I already have an activity for that. Where I’m stuck is on the TV. I’ve added HubConnect Server to Hubitat on the main computer (Mac) and the HubConnect Remote Client to my Raspberry Pi. I’ve tried going to Samsung IDE and adding code there for for HubConnect but getting an error message. I’ve removed the TV from my SmartThings app but when I re-add it, I don’t have an option for adding an AVR Device, just to add a Device, then TV. I can’t get the TV integrated into Hubitat no matter what I try. I tried to add it as a Device, both by discovering it and as a virtual device and can’t figure that out either. I’ve scoured the boards, and tried every solution I’ve seen but nothing is working. I can’t put the TV into a discovery mode. Am I missing something really obvious? Been struggling with this for several days now and just can’t put it together. (I’m also not a coder or an IT person, FYI. I’m smart and catch on quickly but don’t have that background that many of you do.

On the ST side you leave the driver for the TV alone. On the Hubitat side is where the AVR drivers comes into play.

image

image

OK, I'm closer, now I'm stuck on where to find the values to set the Input Source and Set Volume. What's strange is that for volume it says it has to be numeric from 0-100 but when I enter 0, it doesn't seem to want it. For the input source, since we generally are turning the TV on first to watching TV, I tried to set the source as HDMI 2, and it won't take that. (tried without spaces, in quotes, brackets, I'm stuck). Where do I find those? I can't save the device without them.

You can find all the valid inputs on st ide on the device tv page.

On the Hubitat avr device try just a number like 1 or 2 if the st input selections don't work.

Interested in this.

I'm interested in controlling my tv and I also don't have a ST hub. What is the mac and Pi doing and what software do you have on those. That said, I don't have a mac only windows, linux and pi's.

Also, what did you install on the Hubitat?

Can you be a bit more specific, as I'd like to try this if I can!!!!

So far on the Hubitat I have the HubConnect Server for Hubitat and the HubConnect Remote Client. I also installed the Remote Server (if memory serves, I don't have the Pi booted up right now) on a secondary instance of Hubitat on the Pi. I added the TV as a Hubitat virtual device (HubConnect AVR) but that's where I'm stuck. I can't get the TV to respond. I don't know if I need to add something to the Device ID, or what. I'm not sure that it matters having Mac vs Windows since we're adding apps, etc in the cloud. The caution I'll share is that if you go to GitHub or some other location to pick up the app code and device code, when you copy and paste it into Hubitat, it will paste in with a space and you'll get an error or won't be able to save it. Scan through it til you find the space, back space it out and you should be fine.
Let me know if you have success. I tried one other thing this afternoon and I'll let you know if it works.

I have just tried to search for "Remote Server Raspberry pi Hubitat" and can't find anything.
Do you have links that will point me in the right direction for all the installs?

You'll want the Installation Instructions. When you click on them you can view them but you can't copy the code for the files. Download it and then you should be able to copy and paste the code. The info I can see says that while 2.0 is available, 1.6 is the stable release and 2.0 should only be used by developers with experience. Which I am NOT, so I went with 1.6.

POST 2016 Model possible Samsung Remote Driver:

All, I have continued my investigation on SamsungTV remote and tried some code using the ideas and information from "samsungctl/samsungctl at master · Ape/samsungctl · GitHub".

Since my TV is pre-2016, I get the following expected results:

  • Connect is successful
  • The command returns an illegal method with the sent method "ms.remote.control"

But, I think the code will work with 2016 and later TVs. Any testers??

Below is the code and the explicit test keys for testing. You will have to enter the IP in preferences. If it works, I can point you to GitHub key codes (a lot of them in one list) to choose to control the device.

My Hubitat tested code:

/*
Test code for post 2016 Samsung TV Control
test keys:  
KEY_VOLUP
KEY_VOLDOWN
KEY_MUTE
KEY_SOURCE
KEY_TOOLS
KEY_MENU
*/
import groovy.json.JsonOutput  
metadata {
	definition (name: "Samsung Remote WS Test",
				namespace: "davegut",
				author: "David Gutheinz",
				importUrl: ""
			   ){
		command "test", ["string"]
	}
	preferences {
		input ("deviceIp", "text",
			   title: "Device Ip")
	}
}
def installed() {}
def updated() {}

def test(String keyPress) {
	log.trace "test: $keyPress"
	def command = [
		method: "ms.remote.control",
		params: [
			Cmd: "Click",
			DataOfCmd: keyPress,
			Option: "false",
			TypeOfRemote: "SendRemoteKey"
			]
		]
	command = JsonOutput.toJson(command)
	sendCmd(command)
}

private sendCmd(command) {
	log.trace "sendCmd: $command, $deviceIp"
	def url = "ws://${deviceIp}:8001/api/v2/channels/samsung.remote.control"
	webSocketConnect(url)
	pauseExecution(500)
	sendMessage(command)
	runIn(5, close)
}

def webSocketConnect(String url, options = []) { interfaces.webSocket.connect(url) }
def sendMessage(String message) { interfaces.webSocket.sendMessage(message) }
def close() { interfaces.webSocket.close() }
def webSocketStatus(message) { log.debug "webSocketStatus: $message" }
def parse(message) { log.info "parse: $message" }

Thanks for trying to get this to work!

I'm trying this on a 2019 Samsung TV, but it is errors out with the below:
image