Samsung TV integration Question -- Driver info starting post 127

Will be added in next version (tomorrow?). I will also be adding appInstall, appOpen, appGetData, and appClose command to access some of the apps on the TV. I have found the codes that work on my 2020 TV (14 total) plus other codes that do not work (16 in list).

Nice! Thanks for this. Any idea if it's possible to get the current input source on the TV e.g. HDMI1, HDMI2, Netflix etc?

Also, on my 2018 KS8000 TV, the source navigation is off because all the way to the left are:

  1. Connection Guide
  2. Universal Remote
  3. TV
  4. Source 1 ...

Easy to edit mine though.

I get this error message when I turn the TV on (although the TV does turn on):
[dev:2308](http://192.168.1.222/logs#dev2308)2020-11-08 01:27:33.806 am [error](http://192.168.1.222/device/edit/2308)java.lang.NullPointerException: Cannot invoke method toUpperCase() on null object on line 152 (on)

Also, as a heads up, whenever I send a command to the TV, it appears the driver logs a loss of the the websocket connection for just few milliseconds. Not sure if that's expected but figured I'd point it out. Also, I don't think the "switch" state is affected by that so not a big deal.

[dev:2308](http://192.168.1.222/logs#dev2308)2020-11-08 01:50:29.030 am [debug](http://192.168.1.222/device/edit/2308)Beta 1.1 || parse: event = ms.channel.connect, webSocket Open

[dev:2308](http://192.168.1.222/logs#dev2308)2020-11-08 01:50:29.027 am [debug](http://192.168.1.222/device/edit/2308)Beta 1.1 || parse: {"event":"ms.channel.connect","data":{"id":"af43c960-218e-11eb-8bad-b17aeab8f61f","clients":[{"id":"af43c960-218e-11eb-8bad-b17aeab8f61f","connectTime":1604818227446,"attributes":{"name":"xxx"},"deviceName":"xxx","isHost":false}]}}

[dev:2308](http://192.168.1.222/logs#dev2308)2020-11-08 01:50:28.945 am [debug](http://192.168.1.222/device/edit/2308)Beta 1.1 || parse: event = ms.channel.clientDisconnect, message = **[data:[isHost:false, connectTime:1604818058533, attributes:[name:xxx], id:4a95b550-218e-11eb-8bad-b17aeab8f61f, deviceName:xxx], event:ms.channel.clientDisconnect]**

[dev:2308](http://192.168.1.222/logs#dev2308)2020-11-08 01:50:28.942 am [debug](http://192.168.1.222/device/edit/2308)Beta 1.1 || parse: {"event":"ms.channel.clientDisconnect","data":{"id":"4a95b550-218e-11eb-8bad-b17aeab8f61f","connectTime":1604818058533,"attributes":{"name":"xxx"},"deviceName":"xxx","isHost":false}}

[dev:2308](http://192.168.1.222/logs#dev2308)2020-11-08 01:50:28.919 am [info](http://192.168.1.222/device/edit/2308)Beta 1.1 || wsHubParse: wsDeviceStatus = open

[dev:2308](http://192.168.1.222/logs#dev2308)2020-11-08 01:50:28.916 am [debug](http://192.168.1.222/device/edit/2308)Beta 1.1 || webSocketStatus: status: open

[dev:2308](http://192.168.1.222/logs#dev2308)2020-11-08 01:50:28.898 am [info](http://192.168.1.222/device/edit/2308)Beta 1.1 || wsHubParse: wsDeviceStatus = closed

[dev:2308](http://192.168.1.222/logs#dev2308)2020-11-08 01:50:28.891 am [debug](http://192.168.1.222/device/edit/2308)Beta 1.1 || webSocketStatus: status: closing

[dev:2308](http://192.168.1.222/logs#dev2308)2020-11-08 01:50:28.712 am [debug](http://192.168.1.222/device/edit/2308)Beta 1.1 || sendWsCmd: function = remote | command = sendMessage | data = {"method":"ms.remote.control","params":{"Cmd":"Click","DataOfCmd":"KEY_MENU","TypeOfRemote":"SendRemoteKey"}}

Sadly not consistently across all models. Samsung removed the UPnP port and capability that allowed this. I can not even keep track since the source list is different based on what HDMI connections you have active.

Beta version 1.2 of the 2016 and later Samsung Remote Driver.

Please go to the new Thread: Starting new thread dedicated to the driver (it now has a life of it's own).

Link: Samsung Hubitat TV Integration

Thanks... Any chance you can direct me on how to try to integrate this for my 2018 KS8000 model? I only really care about integrating my TV into HE so I can sync my harmony remote (when TV is controlled via another remote). For that, I need to be able to see the current source. I have a similar integration for my LG TV that works great and have been hoping to replicate it for my Samsung TV.

Also, forgot to mention, on line 98, you have a typo that prevents debug logging. It says "debugLpg" instead of "debugLog"

1.2 is working great on my Living Room TV now. So much faster than through ST. I wanna go try out all the other TV's now but everyone is sleeping grrr....

1 Like

Let us see if your TV supports MainTVService (the UPnP capability that will allow you to get this information).

If you have this, tell us. It is a good function, just not available for the 2020 series (Samsung has deleted the port).

@Cal: Could you test this also? This will allow at least some users to be able to directly access HDMI ports.

Dave

Corrected in on-line driver.

Doesn't work on mine. Was looking at the HomeAssistant code for Samsung TV and he uses the SmartThings API to get the current source:

I wonder if that's something you might be able to add... It involves getting a token from the developer site in but opens a world of options. As an example, you can use a single button to change the HDMI source (instead of left, left, left, ..., right). Seems to work great from the HA thread (haven't tried this version yet but had the default Samsung integration on my HA).

@djgutheinz
Thanks for the latest update!
Port 7677 doesn't work, but port 7678 does respond with a UPNP webpage.
http://YOURIPADDRESS:7678/MainTVServer2/

Could you start this driver its own thread? Would make it easier to find since you could update the top post with changes.

1 Like

try this command: http://YOURIPADDRESS:7678/MainTVServer2/

Found out that on 2019 TVs, the port ID changed.
Dave

My TV gives a UPnP error:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">

<s:Body>

<s:Fault>

<faultcode>s:Client</faultcode>

<faultstring>UPnPError</faultstring>

<detail>

<UPnPError xmlns="urn:schemas-upnp-org:control-1-0">

<errorCode>402</errorCode>

<errorDescription>Invalid Args</errorDescription>

</UPnPError>

</detail>

</s:Fault>

</s:Body>

</s:Envelope>

Any chance you can look into the SmartThings API?

Yes, I will consider; however it is a major change and will require a Smart App to get and maintain the token.

NEW THREAD for Hubitat-Samsung TV Remote Driver

Starting new thread dedicated to the driver (it now has a life of it's own).

Link: Samsung Hubitat TV Integration

Don't want to crowd the new thread but here's the SmartThings API link:

Thanks