Help ! Samsung TV Bindings with >2016 Samsung TV

For me it is not self healing, but kjknauss comment helped me a lot. I found out issues happened after a OpenHAB reset, but did not realised that TV status was a factor

For the recovery I follow similar steps but I don’t need to do 1)… just delete the thing and rescan (with a OpenHAB reset between them) use to solve the issue

I’m using text files for configuration

My samsung tv is plugged in via ethernet yet the thing constantly goes offline and then comes back randomly. I did notice that the ping times have a somewhat varied response time. the time varies from 2ms up to 40ms. Does the binding have a super tight expectation of response? I believe I have any power save settings disabled on the tv itself.

upon some further looking it appears that the “power” channel goes to an on state after the thing comes online even though the tv is off. It would seem that the binding expects that if the ip thing has just come online by the tv nic card coming out of powersave that the tv would also be on however in my case that isn’t always true.

The power state for the samsung TVs was reworked last year because it had some issues with the websocket models. It makes the decision of power differently depending on how it’s connecting. What model do you have?

EDIT: Let me give more context now that I went back and looked at that PR. Basically the device is online if the UPnP media renderer is showing up in the registry. So if it’s coming online, I would wonder if there is something in the TV that is powering up (maybe looking for updates?) and it’s actually reachable on the network even though the display is off.

I do have the same annoying experience since sometime 2.5.x version (I’m running 3.0.1 now). Samsung binding used to work flawlessly before that but now it reports to be ON all the time, rendering some very fancy scenes automation based on TV power state unusable now. I noticed that TV answers to ping even when screen is off.

Is it any way of getting old behaviour back? I just need to access power state, I don’t care about volume, channels or any other thing. I don’t even need to control it, just to detect when it is switched off in order to be able to turn off home cinema, A/C or heating and turn on lights before going to bed. I really miss that scene

Two suggestions. First, upgrade to 3.1 and see if that fixes things. Of the 3 PRs committed into 3.1 for the samsungtv binding, two dealt with upnp and power. Second, once you upgrade to 3.1, read "HELP! My UPnP device isn't working right!" and other short stories and see if making the settings changes on that help.

Hi there,

as it seems to be a collection thread, here’s my issue with the Samsung Binding (OH 3.1.0).

I have 2 TV’s, UE46D5700 and UE48H6270, both are autodiscovered, however, usually I create textual items. The 46D works fine (with the limited functionality based on the model).

The 48H is autodiscovered with Port 55000 and None as RPC.
It receives Data, e.g. Volume, but if I change the SetPoint via UI to e.g. 12, command wont be send / applied. Also there’s been no popup etc. on the TV (for granting permission etc.)
Here’s the log:

14:52:12.819 [INFO ] [openhab.event.ItemCommandEvent ] - Item ‘TVBedroom_Volume’ received command 12
14:52:12.826 [INFO ] [openhab.event.ItemStatePredictedEvent] - Item ‘TVBedroom_Volume’ predicted to become 12
14:52:12.834 [DEBUG] [gtv.internal.handler.SamsungTvHandler] - Received channel: samsungtv:tv:0a21fe82_00aa_1000_b3ad_90f1aa1464c7:volume, command: 1 2
14:52:12.839 [DEBUG] [internal.service.MediaRendererService] - Received channel: volume, command: 12
14:52:13.127 [TRACE] [internal.service.MediaRendererService] - Value ‘5’ for CurrentVolume hasn’t changed, ignoring update
14:52:13.755 [DEBUG] [internal.service.MediaRendererService] - Received channel: volume, command: REFRESH
14:52:13.909 [TRACE] [internal.service.MediaRendererService] - Value ‘5’ for CurrentVolume hasn’t changed, ignoring update
14:52:13.914 [DEBUG] [ernal.service.RemoteControllerService] - getSupportedChannelNames: [keyCode, power, channel]
14:52:14.461 [TRACE] [gtv.internal.handler.SamsungTvHandler] - channelLinked: samsungtv:tv:0a21fe82_00aa_1000_b3ad_90f1aa1464c7:volume
14:52:14.919 [DEBUG] [internal.service.MediaRendererService] - Received channel: volume, command: REFRESH

As what I’ve already searched and read, starting from the H series the communication also changed, however I cannot find anything about the configuration of the newer communication.

Somebody has an idea?

Thanks in advance!

Hi morth166955, you were right, 3.1 did fix it, at least by now. Let’s see if it last :wink:

I recently purchased a 2021 Frame TV (55") to replace my old Samsung TV, Hence I revisited the samsungtv binding (I’m on OH 3.1).

I see a lot has happened since I first started using this binding!

I dug into the code, and figured out the new websocket interface. I see that “The Frame” TV is well supported by the current binding.

I also put together my own websocket interface (in python) to experiment with some of the possibilities. I found out a few things:

  • Python aiohttp does not work with the Samsung TV websocket, but websockets 9.1 does.
  • keyCode actually supports “Press”, “Release” and “Click” as options
  • You can query the artMode state
  • You can query the slideshow state
  • You can set the slideshow state (off, duration) and set type (slideshow or shuffleslideshow) and the collection used (favorites or my photos). Duration is in minutes, and you can set it to whatever you want.

The last two are not supported by the samsungtv binding.

The documentation for the sansungtv binding leaves out a lot of details.

For example, keyCode does have support for “Press” buried in the binding, but it only seems to be used for turning a Frame TV to “standby” (ie sort of power off mode) - similar to pressing the “power” key on the remote for 3 seconds to turn the TV off totally.

Power
To turn a Frame TV off (ie black screen), you set “power” to OFF (which turns “artMode” on), then set “artMode” to OFF - which turns the TV off totally. You can turn the TV back on by setting “artMode” to ON - which wakes the TV up using WOL (if you have entered the mac address in the Thing, and you are not using WiFi), and then sets “artMode”, or setting “power” to ON, which does the same thing, but turns the TV on instead of “ArtMode”.

If both “artMode” and “power” are OFF - the TV is in standby mode (blank screen), if either “artMode” or “power” is ON, then the TV is showing art or regular TV. Incredibly useful!

Network
Interesting things to note about the Frame TV network connection. If it’s connected via WiFi, the WiFi connection never drops (even in standby). I have mine hard wired to ethernet, and in that case, the network connection does drop in standby mode - but the TV ethernet “wakes up” every 10 minutes or so for about 10 seconds, then drops again (this makes the TV go ONLINE and OFFLINE at intervals). It does respond to WOL packets though.

The connections are:

  • websocket is on port 8001
  • websocketsecure is on port 8002
    This seems to be true of all Samsung TV’s. If you don’t connect to the websocketsecure port, then keyCode is not supported (but “artMode” “volume”, “mute”, apps etc still are). As “keyCode” is used to power on and off, you can’t control the power unless you connect to the websocketsecure.

Token:
This seems to confuse a lot of people. The TV will not allow keyCodes to be sent unless you have accepted the connection (TV will display “allow connection for X”). You have 30 seconds from the request being made to accept the connection, or it will fail to connect. The TV only displays the message if you have “Device Connect Manager” set up on the TV, I also enabled “IP Remote” on the TV (for good measure). these are in the “General” part of the settings menu.

Once you accept the remote connection - a new token is issued by the TV, and stored by the binding. Initially the token in the Thing is blank. The next time a connection is made using the new token, the connection is automatically accepted, and you don’t get the message on screen to accept it again. unfortunately, the token stored in the Thing does not seem to be saved between restarts of OH, so you have to accept the connection on the TV every time you restart OH (unless you use a text Thing configuration).

The TV seems to use a combination of remote ip address and “name” to authenticate the token. The “name” is a base64 encoded string - in the samsungtv binding the “name” is “openHAB” - and you will see this in the list of authorized remote devices on the TV. If no “name” is sent, the TV uses the default name “Smart Device”, so you can send no name, or base64 encoded “Smart Device” (“U21hcnQgRGV2aWNl”) and it will work.

This applies to the websocketsecure connection, as the token is only needed for the “remote.control” channel, and websocket doesn’t accept connections to the “remote.control” channel. the only difference between the two ports is that websocketsecure uses SSL to make the connection, the “secure” part is nothing to do with the token.

As I mention above, the only TV control channel that needs a token is the “remote.control” channel, the “art-app” and “app” control channels don’t use the token (they don’t care if you send it or not).

Slideshow
The Frame TV can display a slideshow, either in sequence, or random. you can set the time that the art is displayed for, but the TV only has certain defined durations, up to 1 day. Slideshow mode does seem to randomly stop from time to time though - some sort of Samsung bug I think.

To query the slideshow status, you send:

{"method": "ms.channel.emit", "params": {"data": "{\"request\": \"get_auto_rotation_status\", \"id\": \"e46f9847-b473-45cd-b5e7-e9ea836d0e5g\"}", "to": "host", "event": "art_app_request"}}

To the “app-art” channel of the websocket (wss://192.168.100.73:8002/api/v2/channels/com.samsung.art-app?name=U21hcnQgRGV2aWNl)

This gets you an enormous amount of data about the slideshow mode, if it’s on, you get the list of artwork being rotated, value is “off” or the duration of each picture in minutes.

Note that the "data’ part of the json string is a string, not json! this had me confused for a while.
The messages use an “id” to identify messages, so you know what messages are being replied to, these are randomly generated UIID’s, and have no significance whatsoever. you can use whatever you like.

To set the slideshow mode, you send:

{"method": "ms.channel.emit", "params": {"data": "{\"request\": \"set_auto_rotation_status\", \"value\": \"off\", \"id\": \"e46f9847-b473-45cd-b5e7-e9ea836d0e5g\"}", "to": "host", "event": "art_app_request"}}

To turn slideshow mode off, or:

{"method": "ms.channel.emit", "params": {"data": "{\"request\": \"set_auto_rotation_status\", \"value\": \"1440\", \"category_id\":\"MY-C0002\", \"type\": \"shuffleslideshow\", \"id\": \"e46f9847-b473-45cd-b5e7-e9ea836d0e5g\"}", "to": "host", "event": "art_app_request"}}

To set slideshow mode on, where value is the duration in minutes (1440 is 1 day), category_id is the category, such as favorites, or my photos (I think MY-C0001 is favorites and MY-C0002 is my photos), and type is serial (slideshow) or random (shuffleslideshow).

It would be good if this feature could be added to the samsungtv binding at some point.

If you query the artMode setting:

{"method": "ms.channel.emit", "params": {"data": "{\"request\": \"get_artmode_status\", \"id\": \"e46f9847-b473-45cd-b5e7-e9ea836d0e5g\"}", "to": "host", "event": "art_app_request"}}

You get back a bunch of stuff, including the currently displayed art (not totally useful as it’s something like “MY_F0029”), and so far I haven’t found out a way to set the current artwork, which would be incredibly useful. if anyone figures this out, please post it!

Night Mode
I found that the “Night Mode” of The frame TV works poorly (possibly worse since we added the modern teak frame to it). The ligh sensor seems to think that the room is darker than it actually is, and so turns the TV off completely at about 9:00pm on an evening (even with the room lights on), and doesn’t turn on until it’s bright daylight the next day. Not what you want for an “art” TV!

Using the samsung tv binding, and my trusty outside light sensors, I wrote a rule that implements “Night Mode” properly.
First you disable “Night Mode” on the TV (and “Motion Detect” - which is off by default). Then my rule sets “power” to off and “artMode” to off if the room lights are off, and it’s dark outside. Another rule turns “artMode” on if it’s after 5am, before 7am, and its light outside, or the room lights turn on, or it’s 7am - whichever occurs first (if power and artMode are both off).
So - a properly implemented Night Mode (which Samsung apparently can’t do).

Thing/Items
If anyone is interested, here is my thing text definition:

Thing samsungtv:tv:family_room "Samsung The Frame 55" [ hostName="192.168.100.73", port=8002, macAddress="10:2b:41:01:6d:27", refreshInterval=1000, protocol="SecureWebSocket", webSocketToken="16295986" ]

Items:

String  TVRemoteControl  "TV Control [%s]" <television> (GF_Family)    { channel="samsungtv:tv:family_room:keyCode", autoupdate="false" }
Dimmer  TV_Volume "TV Volume [%s]" <soundvolume> (GF_Family)           { channel="samsungtv:tv:family_room:volume" }
/* Not Supported on The Frame (but shows anyway) */
//String  TVSource_Name "TV Source [%s]" <television> (GF_Family)        { channel="samsungtv:tv:family_room:sourceName" }
//Number TV_Channel "Channel [%s]"     <television>    (GF_Family)       { channel="samsungtv:tv:family_room:channel" }
//String TV_Title "Program Title [%s]" <television>    (GF_Family)       { channel="samsungtv:tv:family_room:programTitle" }
//String TV_Name "Channel Name [%s]"   <television>    (GF_Family)       { channel="samsungtv:tv:family_room:channelName" }
//Number TV_SourceId "Source id [%s]"  <television>    (GF_Family)       { channel="samsungtv:tv:family_room:sourceId" }

/* Frame only*/
Switch TV_ArtMode "TV Art Mode [%s]" <television>    (GF_Family)       { channel="samsungtv:tv:family_room:artMode" }
/* Supported on all TV's */
Switch TV_Power "TV Power [%s]"      <television>    (GF_Family)       { channel="samsungtv:tv:family_room:power" }
Switch TV_Mute "TV Mute [%s]"        <soundvolume_mute> (GF_Family)    { channel="samsungtv:tv:family_room:mute" }

Volume and mute don’t always seem to work, which is not an issue as I control them via my harmony hub anyway.

If anyone else has discovered more useful insights, please share - a lot of this was figured out by trial and error.

Did you find a way to start apps on “The Frame”? I cannot get it to work at my 2020 65inch.

I haven’t tried it.

I’ll be on the road for the rest of this week, but I’ll give it a go as soon as I get a chance. The key is probably getting the right App ID’s, as they seem to change from model to model.

1 Like

Can you please post full string to set debug log for this binding? Got power, volume, mute, but cannot get anything else.

Found a new bug in the binding (I reported it). This bug is to do with power state on the Frame TV - it causes the power button on the remote control to stop working (yes the actual physical remotes can’t turn the TV on or off anymore).

Here it is:

Putting the 2021 Frame TV into Standby from ArtMode has a bug in it. It’s primarily caused by the art-app channel reporting artMode ON incorrectly when the TV is actually in standby. You have to read the PowerState from the https://ip:8002/api/v2/ page to tell if the TV is actually on or in standby - artMode will report ON even in standby mode when the TV interface randomly wakes up in standby mode.

Because of this behavior, you can lock up the TV power buttons - which means you can’t turn the TV on or off via the remote control.

Expected Behavior

When Artmode is ON, setting it to OFF should put the TV into standby mode. This should be achieved by sending a long press of the KEY_POWER approximately 4 seconds long.

Current Behavior

The Binding sends a long press of the KEY_POWER to put the TV into standby, however, it assumes that the TV goes into standby, as there is no corresponding Release of the KEY_POWER as there should be. Sometimes the TV does not go into standby as expected (because it’s already in standby - so it actually turns the TV on), and as there is no corresponding Release to the Press command, the power key remains pressed. This leads to the power buttons on the actual remote controls no longer working, and the standby command cannot be retried (as the KEY_POWER is now continually pressed, so you can’t press it again).

Possible Solution

The simple solution is to send a Press KEY_POWER command, followed 4 seconds later by a Release KEY_POWER - if the websocket disconnects, then the Release is never sent, but if it doesn’t, the release would be sent normally, and the command can be retried.
The artMode status cannot be simply determined by reading the artmode status from the app-art channel, you have to read the powerState as well. This should be implemented, as it would solve the issue of the artMode channel status being read incorrectly when the TV wakes while in standby mode.

Steps to Reproduce (for Bugs)

When the TV has just woken up (the TV wakes up at random intervals when in standby), it can still be in standby - however the art-app websocket reports artMode ‘ON’ - this not the case though, the https://ip:8002/api/v2/ page reports standby not on - if you send an artMode OFF command (to put it back into standby) - it doesn’t work as the TV is still in standby (in fact it turns the TV on), but now power buttons don’t work anymore.

Context

I’m trying to put the TV into standby at night (when the light are out), but the TV will randomly wake up, go into artMode, and then you can’t turn the TV OFF or on with the physical remote anymore. This is very annoying. The only way out is to use the power channel to turn the TV on. This is not helpful for other household family members trying to turn the TV on/off.

Your Environment

This is OH 3.1 running on Ubuntu 20.04. TV is a 2021 55" The Frame TV, ethernet is hard wired (not WiFi). Night mode and motion sensors are off.

Here is a TRACE log capture of the problem occurring:

samsungtv.log:2021-09-22 01:34:08.306 [DEBUG] [tv.internal.handler.SamsungTvHandler] - Received channel: samsungtv:tv:family_room:artMode, command: OFF
samsungtv.log:2021-09-22 01:34:08.306 [DEBUG] [rnal.service.RemoteControllerService] - getSupportedChannelNames: [keyCode, volume, mute, power, channel, url, sourceApp, artMode]
samsungtv.log:2021-09-22 01:34:08.307 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: artMode, command: OFF
samsungtv.log:2021-09-22 01:34:08.307 [DEBUG] [l.protocol.RemoteControllerWebSocket] - Try to send command: KEY_POWER
samsungtv.log:2021-09-22 01:34:08.307 [TRACE] [ngtv.internal.protocol.WebSocketBase] - WebSocketRemote: sendCommand: {"method":"ms.remote.control","params":{"Cmd":"Press","DataOfCmd":"KEY_POWER","Option":"false","TypeOfRemote":"SendRemoteKey"}}
samsungtv.log:2021-09-22 01:34:08.921 [DEBUG] [rnal.service.RemoteControllerService] - getSupportedChannelNames: [keyCode, volume, mute, power, channel, url, sourceApp, artMode]
samsungtv.log:2021-09-22 01:34:08.922 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: keyCode, command: REFRESH
samsungtv.log:2021-09-22 01:34:08.922 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: volume, command: REFRESH
samsungtv.log:2021-09-22 01:34:08.922 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: mute, command: REFRESH
samsungtv.log:2021-09-22 01:34:08.922 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: power, command: REFRESH
samsungtv.log:2021-09-22 01:34:08.922 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: url, command: REFRESH
samsungtv.log:2021-09-22 01:34:08.922 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: artMode, command: REFRESH
samsungtv.log:2021-09-22 01:34:08.922 [DEBUG] [nternal.service.MediaRendererService] - Received channel: volume, command: REFRESH
samsungtv.log:2021-09-22 01:34:08.927 [TRACE] [nternal.service.MediaRendererService] - Value '20' for CurrentVolume hasn't changed, ignoring update
samsungtv.log:2021-09-22 01:34:08.928 [DEBUG] [nternal.service.MediaRendererService] - Received channel: mute, command: REFRESH
samsungtv.log:2021-09-22 01:34:08.931 [TRACE] [nternal.service.MediaRendererService] - Value 'false' for CurrentMute hasn't changed, ignoring update
samsungtv.log:2021-09-22 01:34:09.932 [DEBUG] [rnal.service.RemoteControllerService] - getSupportedChannelNames: [keyCode, volume, mute, power, channel, url, sourceApp, artMode]
.
.
.
samsungtv.log:2021-09-22 01:34:13.991 [DEBUG] [rnal.service.RemoteControllerService] - getSupportedChannelNames: [keyCode, volume, mute, power, channel, url, sourceApp, artMode]
samsungtv.log:2021-09-22 01:34:13.992 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: keyCode, command: REFRESH
samsungtv.log:2021-09-22 01:34:13.992 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: volume, command: REFRESH
samsungtv.log:2021-09-22 01:34:13.993 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: mute, command: REFRESH
samsungtv.log:2021-09-22 01:34:13.993 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: power, command: REFRESH
samsungtv.log:2021-09-22 01:34:13.993 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: url, command: REFRESH
samsungtv.log:2021-09-22 01:34:13.993 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: artMode, command: REFRESH
samsungtv.log:2021-09-22 01:34:13.994 [DEBUG] [nternal.service.MediaRendererService] - Received channel: volume, command: REFRESH
samsungtv.log:2021-09-22 01:34:14.000 [TRACE] [nternal.service.MediaRendererService] - Value '20' for CurrentVolume hasn't changed, ignoring update
samsungtv.log:2021-09-22 01:34:14.000 [DEBUG] [nternal.service.MediaRendererService] - Received channel: mute, command: REFRESH
samsungtv.log:2021-09-22 01:34:14.004 [TRACE] [nternal.service.MediaRendererService] - Value 'false' for CurrentMute hasn't changed, ignoring update
samsungtv.log:2021-09-22 01:34:15.005 [DEBUG] [rnal.service.RemoteControllerService] - getSupportedChannelNames: [keyCode, volume, mute, power, channel, url, sourceApp, artMode]
samsungtv.log:2021-09-22 01:34:15.006 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: keyCode, command: REFRESH
samsungtv.log:2021-09-22 01:34:15.006 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: volume, command: REFRESH
samsungtv.log:2021-09-22 01:34:15.006 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: mute, command: REFRESH
samsungtv.log:2021-09-22 01:34:15.006 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: power, command: REFRESH
samsungtv.log:2021-09-22 01:34:15.006 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: url, command: REFRESH
samsungtv.log:2021-09-22 01:34:15.007 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: artMode, command: REFRESH
samsungtv.log:2021-09-22 01:34:15.007 [DEBUG] [nternal.service.MediaRendererService] - Received channel: volume, command: REFRESH
samsungtv.log:2021-09-22 01:34:15.014 [TRACE] [nternal.service.MediaRendererService] - Value '20' for CurrentVolume hasn't changed, ignoring update
samsungtv.log:2021-09-22 01:34:15.014 [DEBUG] [nternal.service.MediaRendererService] - Received channel: mute, command: REFRESH
samsungtv.log:2021-09-22 01:34:15.018 [TRACE] [nternal.service.MediaRendererService] - Value 'false' for CurrentMute hasn't changed, ignoring update
samsungtv.log:2021-09-22 01:34:16.019 [DEBUG] [rnal.service.RemoteControllerService] - getSupportedChannelNames: [keyCode, volume, mute, power, channel, url, sourceApp, artMode]
samsungtv.log:2021-09-22 01:34:16.019 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: keyCode, command: REFRESH
samsungtv.log:2021-09-22 01:34:16.020 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: volume, command: REFRESH
samsungtv.log:2021-09-22 01:34:16.020 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: mute, command: REFRESH
samsungtv.log:2021-09-22 01:34:16.020 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: power, command: REFRESH
samsungtv.log:2021-09-22 01:34:16.020 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: url, command: REFRESH
samsungtv.log:2021-09-22 01:34:16.020 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: artMode, command: REFRESH
samsungtv.log:2021-09-22 01:34:16.020 [DEBUG] [nternal.service.MediaRendererService] - Received channel: volume, command: REFRESH
samsungtv.log:2021-09-22 01:34:16.025 [TRACE] [nternal.service.MediaRendererService] - Value '20' for CurrentVolume hasn't changed, ignoring update
samsungtv.log:2021-09-22 01:34:16.025 [DEBUG] [nternal.service.MediaRendererService] - Received channel: mute, command: REFRESH
samsungtv.log:2021-09-22 01:34:16.029 [TRACE] [nternal.service.MediaRendererService] - Value 'false' for CurrentMute hasn't changed, ignoring update
samsungtv.log:2021-09-22 01:34:17.030 [DEBUG] [rnal.service.RemoteControllerService] - getSupportedChannelNames: [keyCode, volume, mute, power, channel, url, sourceApp, artMode]
samsungtv.log:2021-09-22 01:34:17.030 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: keyCode, command: REFRESH
samsungtv.log:2021-09-22 01:34:17.030 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: volume, command: REFRESH
samsungtv.log:2021-09-22 01:34:17.031 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: mute, command: REFRESH
samsungtv.log:2021-09-22 01:34:17.031 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: power, command: REFRESH
samsungtv.log:2021-09-22 01:34:17.031 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: url, command: REFRESH
samsungtv.log:2021-09-22 01:34:17.031 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: artMode, command: REFRESH
samsungtv.log:2021-09-22 01:34:17.031 [DEBUG] [nternal.service.MediaRendererService] - Received channel: volume, command: REFRESH
samsungtv.log:2021-09-22 01:34:17.036 [TRACE] [nternal.service.MediaRendererService] - Value '20' for CurrentVolume hasn't changed, ignoring update
samsungtv.log:2021-09-22 01:34:17.037 [DEBUG] [nternal.service.MediaRendererService] - Received channel: mute, command: REFRESH
samsungtv.log:2021-09-22 01:34:17.041 [TRACE] [nternal.service.MediaRendererService] - Value 'false' for CurrentMute hasn't changed, ignoring update
samsungtv.log:2021-09-22 01:34:18.042 [DEBUG] [rnal.service.RemoteControllerService] - getSupportedChannelNames: [keyCode, volume, mute, power, channel, url, sourceApp, artMode]
samsungtv.log:2021-09-22 01:34:18.043 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: keyCode, command: REFRESH
samsungtv.log:2021-09-22 01:34:18.043 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: volume, command: REFRESH
samsungtv.log:2021-09-22 01:34:18.043 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: mute, command: REFRESH
samsungtv.log:2021-09-22 01:34:18.043 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: power, command: REFRESH
samsungtv.log:2021-09-22 01:34:18.043 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: url, command: REFRESH
samsungtv.log:2021-09-22 01:34:18.043 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: artMode, command: REFRESH
samsungtv.log:2021-09-22 01:34:18.043 [DEBUG] [nternal.service.MediaRendererService] - Received channel: volume, command: REFRESH
samsungtv.log:2021-09-22 01:34:18.049 [TRACE] [nternal.service.MediaRendererService] - Value '20' for CurrentVolume hasn't changed, ignoring update
samsungtv.log:2021-09-22 01:34:18.049 [DEBUG] [nternal.service.MediaRendererService] - Received channel: mute, command: REFRESH
samsungtv.log:2021-09-22 01:34:18.053 [TRACE] [nternal.service.MediaRendererService] - Value 'false' for CurrentMute hasn't changed, ignoring update
samsungtv.log:2021-09-22 01:34:19.056 [DEBUG] [rnal.service.RemoteControllerService] - getSupportedChannelNames: [keyCode, volume, mute, power, channel, url, sourceApp, artMode]

The is the TV randomly waking up, it reports artMode ON, but it’s actually in standby

samsungtv.log:2021-09-22 01:33:43.858 [DEBUG] [tv.internal.handler.SamsungTvHandler] - remoteDeviceAdded: MediaRenderer, http://192.168.100.73:9197/dmr
samsungtv.log:2021-09-22 01:33:43.858 [DEBUG] [covery.SamsungTvDiscoveryParticipant] - Retrieved Thing UID for a Samsung TV 'Samsung TV' model 'QN55LS03AAFXZC' thing with UDN 'ea645e34_d3dd_4b9b_a246_e2947f8973d6'
samsungtv.log:2021-09-22 01:33:43.858 [DEBUG] [tv.internal.handler.SamsungTvHandler] - remoteDeviceAdded, upnpUDN=ea645e34_d3dd_4b9b_a246_e2947f8973d6
samsungtv.log:2021-09-22 01:33:43.858 [DEBUG] [tv.internal.handler.SamsungTvHandler] - Check and create missing UPnP services
samsungtv.log:2021-09-22 01:33:43.858 [DEBUG] [covery.SamsungTvDiscoveryParticipant] - Created a DiscoveryResult for device 'QN55LS03AAFXZC' with UDN 'ea645e34-d3dd-4b9b-a246-e2947f8973d6' and properties: {hostName=192.168.100.73}
samsungtv.log:2021-09-22 01:33:43.858 [TRACE] [tv.internal.handler.SamsungTvHandler] - Skipping unknown UPnP service: QN55LS03AAFXZC, dialreceiver (e6b20cd8-719b-4225-81e2-897c3198068f)
samsungtv.log:2021-09-22 01:33:43.858 [DEBUG] [nternal.service.MediaRendererService] - Creating a Samsung TV MediaRenderer service
samsungtv.log:2021-09-22 01:33:43.858 [DEBUG] [tv.internal.handler.SamsungTvHandler] - Started service for: QN55LS03AAFXZC, MediaRenderer (ea645e34-d3dd-4b9b-a246-e2947f8973d6)
samsungtv.log:2021-09-22 01:33:43.858 [DEBUG] [tv.internal.handler.SamsungTvHandler] - Device was online
samsungtv.log:2021-09-22 01:33:43.859 [INFO ] [rnal.service.RemoteControllerService] - Using SecureWebSocket interface
samsungtv.log:2021-09-22 01:33:43.866 [TRACE] [l.protocol.RemoteControllerWebSocket] - openConnection()
samsungtv.log:2021-09-22 01:33:43.866 [DEBUG] [l.protocol.RemoteControllerWebSocket] - RemoteControllerWebSocket start Client
samsungtv.log:2021-09-22 01:33:43.866 [TRACE] [l.protocol.RemoteControllerWebSocket] - WebSocketClient starting
samsungtv.log:2021-09-22 01:33:43.870 [TRACE] [l.protocol.RemoteControllerWebSocket] - WebSocketClient started
samsungtv.log:2021-09-22 01:33:43.871 [TRACE] [l.protocol.RemoteControllerWebSocket] - connectWebSockets()
samsungtv.log:2021-09-22 01:33:43.871 [DEBUG] [ngtv.internal.protocol.WebSocketBase] - WebSocketRemote connecting to: wss://192.168.100.73:8002/api/v2/channels/samsung.remote.control?name=b3BlbkhBQg==&token=16295986
samsungtv.log:2021-09-22 01:33:43.871 [TRACE] [ngtv.internal.protocol.WebSocketBase] - Connecting session Future: java.util.concurrent.CompletableFuture@6c9c768c[Not completed, 1 dependents]
samsungtv.log:2021-09-22 01:33:43.872 [DEBUG] [ngtv.internal.protocol.WebSocketBase] - WebSocketArt connecting to: wss://192.168.100.73:8002/api/v2/channels/com.samsung.art-app?name=b3BlbkhBQg==
samsungtv.log:2021-09-22 01:33:43.874 [TRACE] [ngtv.internal.protocol.WebSocketBase] - Connecting session Future: java.util.concurrent.CompletableFuture@3be184f2[Not completed, 1 dependents]
samsungtv.log:2021-09-22 01:33:43.879 [DEBUG] [ngtv.internal.protocol.WebSocketBase] - WebSocketV2 connecting to: wss://192.168.100.73:8002/api/v2?name=b3BlbkhBQg==
samsungtv.log:2021-09-22 01:33:43.882 [TRACE] [ngtv.internal.protocol.WebSocketBase] - Connecting session Future: java.util.concurrent.CompletableFuture@2e1122ce[Not completed, 1 dependents]
samsungtv.log:2021-09-22 01:33:43.886 [DEBUG] [tv.internal.handler.SamsungTvHandler] - remoteDeviceAdded: ScreenMirroring, http://192.168.100.73:9119/screen_sharing
samsungtv.log:2021-09-22 01:33:43.886 [DEBUG] [tv.internal.handler.SamsungTvHandler] - remoteDeviceAdded, upnpUDN=adc92018_fd3b_4276_b534_19ea2d3e007a
samsungtv.log:2021-09-22 01:33:43.886 [DEBUG] [tv.internal.handler.SamsungTvHandler] - Check and create missing UPnP services
samsungtv.log:2021-09-22 01:33:43.886 [TRACE] [tv.internal.handler.SamsungTvHandler] - Skipping unknown UPnP service: QN55LS03AAFXZC, ScreenMirroring (adc92018-fd3b-4276-b534-19ea2d3e007a)
samsungtv.log:2021-09-22 01:33:43.886 [TRACE] [tv.internal.handler.SamsungTvHandler] - Skipping unknown UPnP service: QN55LS03AAFXZC, dialreceiver (e6b20cd8-719b-4225-81e2-897c3198068f)
samsungtv.log:2021-09-22 01:33:43.886 [DEBUG] [tv.internal.handler.SamsungTvHandler] - Service rediscovered, clearing caches: QN55LS03AAFXZC, MediaRenderer (ea645e34-d3dd-4b9b-a246-e2947f8973d6)
samsungtv.log:2021-09-22 01:33:43.887 [DEBUG] [tv.internal.handler.SamsungTvHandler] - Device was online
samsungtv.log:2021-09-22 01:33:43.887 [TRACE] [l.protocol.RemoteControllerWebSocket] - openConnection()
samsungtv.log:2021-09-22 01:33:43.887 [TRACE] [l.protocol.RemoteControllerWebSocket] - connectWebSockets()
samsungtv.log:2021-09-22 01:33:43.887 [TRACE] [ngtv.internal.protocol.WebSocketBase] - WebSocketRemote already connecting or connected
samsungtv.log:2021-09-22 01:33:43.887 [TRACE] [ngtv.internal.protocol.WebSocketBase] - WebSocketArt already connecting or connected
samsungtv.log:2021-09-22 01:33:43.887 [TRACE] [ngtv.internal.protocol.WebSocketBase] - WebSocketV2 already connecting or connected
samsungtv.log:2021-09-22 01:33:43.962 [DEBUG] [ngtv.internal.protocol.WebSocketBase] - WebSocketRemote connection established: 192.168.100.73
samsungtv.log:2021-09-22 01:33:44.619 [DEBUG] [rnal.service.RemoteControllerService] - getSupportedChannelNames: [keyCode, volume, mute, power, channel, url, sourceApp, artMode]
samsungtv.log:2021-09-22 01:33:44.620 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: keyCode, command: REFRESH
samsungtv.log:2021-09-22 01:33:44.620 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: volume, command: REFRESH
samsungtv.log:2021-09-22 01:33:44.620 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: mute, command: REFRESH
samsungtv.log:2021-09-22 01:33:44.620 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: power, command: REFRESH
samsungtv.log:2021-09-22 01:33:44.620 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: url, command: REFRESH
samsungtv.log:2021-09-22 01:33:44.620 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: artMode, command: REFRESH
samsungtv.log:2021-09-22 01:33:44.620 [DEBUG] [nternal.service.MediaRendererService] - Received channel: volume, command: REFRESH
samsungtv.log:2021-09-22 01:33:44.626 [DEBUG] [tv.internal.handler.SamsungTvHandler] - Received value 'volume':'20' for thing 'samsungtv:tv:family_room'
samsungtv.log:2021-09-22 01:33:44.626 [DEBUG] [nternal.service.MediaRendererService] - Received channel: mute, command: REFRESH
samsungtv.log:2021-09-22 01:33:44.631 [DEBUG] [tv.internal.handler.SamsungTvHandler] - Received value 'mute':'ON' for thing 'samsungtv:tv:family_room'
samsungtv.log:2021-09-22 01:33:45.106 [DEBUG] [ngtv.internal.protocol.WebSocketBase] - WebSocketV2 connection established: 192.168.100.73
samsungtv.log:2021-09-22 01:33:45.122 [TRACE] [ngtv.internal.protocol.WebSocketBase] - WebSocketRemote: onWebSocketText: {"data":{"clients":[{"attributes":{"name":"U21hcnQgRGV2aWNl","token":"86540594"},"connectTime":1632288805659,"deviceName":"U21hcnQgRGV2aWNl","id":"c693d5a8-708e-4e69-9a89-435bfc2dcba7","isHost":false},{"attributes":{"name":"b3BlbkhBQg==","token":"16295986"},"connectTime":1632288823605,"deviceName":"b3BlbkhBQg==","id":"b389295b-b289-48d4-b2d5-a838722c1ce","isHost":false}],"id":"b389295b-b289-48d4-b2d5-a838722c1ce"},"event":"ms.channel.connect"}
samsungtv.log:2021-09-22 01:33:45.122 [TRACE] [ngtv.internal.protocol.WebSocketBase] - WebSocketV2: onWebSocketText: {"data":{"clients":[{"attributes":{"name":"b3BlbkhBQg=="},"connectTime":1632288824760,"deviceName":"b3BlbkhBQg==","id":"b24c9ad-248b-4a20-9655-432b272ac8b","isHost":false}],"id":"b24c9ad-248b-4a20-9655-432b272ac8b"},"event":"ms.channel.connect"}
samsungtv.log:2021-09-22 01:33:45.123 [DEBUG] [ngtv.internal.protocol.WebSocketBase] - WebSocketArt connection established: 192.168.100.73
samsungtv.log:2021-09-22 01:33:45.123 [DEBUG] [tv.internal.protocol.WebSocketRemote] - Remote channel connected. Token = null
samsungtv.log:2021-09-22 01:33:45.123 [DEBUG] [sungtv.internal.protocol.WebSocketV2] - V2 channel connected. Token = null
samsungtv.log:2021-09-22 01:33:45.124 [TRACE] [ngtv.internal.protocol.WebSocketBase] - WebSocketRemote: sendCommand: {"method":"ms.channel.emit","params":{"event":"ed.installedApp.get","to":"host"}}
samsungtv.log:2021-09-22 01:33:45.134 [TRACE] [ngtv.internal.protocol.WebSocketBase] - WebSocketArt: onWebSocketText: {"data":{"clients":[{"attributes":{"name":null},"connectTime":1632288814585,"deviceName":"Smart Device","id":"b69042-807-427f-b033-c36b1277f4c","isHost":true},{"attributes":{"name":"b3BlbkhBQg=="},"connectTime":1632288824770,"deviceName":"b3BlbkhBQg==","id":"3aef24e6-5e1f-4ba6-ace5-34a01b5c862b","isHost":false}],"id":"3aef24e6-5e1f-4ba6-ace5-34a01b5c862b"},"event":"ms.channel.connect"}
samsungtv.log:2021-09-22 01:33:45.135 [DEBUG] [ungtv.internal.protocol.WebSocketArt] - Art channel connected
samsungtv.log:2021-09-22 01:33:45.135 [TRACE] [ngtv.internal.protocol.WebSocketBase] - WebSocketArt: onWebSocketText: {"data":null,"event":"ms.channel.ready"}
samsungtv.log:2021-09-22 01:33:45.135 [DEBUG] [ungtv.internal.protocol.WebSocketArt] - Art channel ready
samsungtv.log:2021-09-22 01:33:45.136 [TRACE] [ngtv.internal.protocol.WebSocketBase] - WebSocketArt: sendCommand: {"method":"ms.channel.emit","params":{"event":"art_app_request","to":"host","data":"{\"request\":\"get_artmode_status\",\"id\":\"d824284d-7a32-4648-ab83-7ed524f95da3\"}"}}
samsungtv.log:2021-09-22 01:33:45.168 [TRACE] [ngtv.internal.protocol.WebSocketBase] - WebSocketArt: onWebSocketText: {"data":"{\n  \"id\": \"d824284d-7a32-4648-ab83-7ed524f95da3\",\n  \"event\": \"artmode_status\",\n  \"value\": \"on\",\n  \"target_client_id\": \"3aef24e6-5e1f-4ba6-ace5-34a01b5c862b\"\n}","event":"d2d_service_message","from":"b69042-807-427f-b033-c36b1277f4c"}
samsungtv.log:2021-09-22 01:33:45.168 [DEBUG] [ungtv.internal.protocol.WebSocketArt] - artmode_status: on
samsungtv.log:2021-09-22 01:33:45.169 [DEBUG] [tv.internal.handler.SamsungTvHandler] - Received value 'artMode':'ON' for thing 'samsungtv:tv:family_room'
samsungtv.log:2021-09-22 01:33:45.169 [DEBUG] [tv.internal.handler.SamsungTvHandler] - Received value 'power':'OFF' for thing 'samsungtv:tv:family_room'

So now, it you try to put the TV back into standby by sending ArtMode OFF, you actually wake up the TV, and the power keys no longer work:

samsungtv.log:2021-09-22 01:33:56.195 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: artMode, command: OFF
samsungtv.log:2021-09-22 01:33:56.195 [DEBUG] [l.protocol.RemoteControllerWebSocket] - Try to send command: KEY_POWER
samsungtv.log:2021-09-22 01:33:56.196 [TRACE] [ngtv.internal.protocol.WebSocketBase] - WebSocketRemote: sendCommand: {"method":"ms.remote.control","params":{"Cmd":"Press","DataOfCmd":"KEY_POWER","Option":"false","TypeOfRemote":"SendRemoteKey"}}
samsungtv.log:2021-09-22 01:33:56.760 [DEBUG] [rnal.service.RemoteControllerService] - getSupportedChannelNames: [keyCode, volume, mute, power, channel, url, sourceApp, artMode]
samsungtv.log:2021-09-22 01:33:56.761 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: keyCode, command: REFRESH
samsungtv.log:2021-09-22 01:33:56.761 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: volume, command: REFRESH
samsungtv.log:2021-09-22 01:33:56.761 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: mute, command: REFRESH
samsungtv.log:2021-09-22 01:33:56.761 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: power, command: REFRESH
samsungtv.log:2021-09-22 01:33:56.761 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: url, command: REFRESH
samsungtv.log:2021-09-22 01:33:56.762 [DEBUG] [rnal.service.RemoteControllerService] - Received channel: artMode, command: REFRESH
samsungtv.log:2021-09-22 01:33:56.762 [DEBUG] [nternal.service.MediaRendererService] - Received channel: volume, command: REFRESH
samsungtv.log:2021-09-22 01:33:56.766 [TRACE] [nternal.service.MediaRendererService] - Value '20' for CurrentVolume hasn't changed, ignoring update
samsungtv.log:2021-09-22 01:33:56.766 [DEBUG] [nternal.service.MediaRendererService] - Received channel: mute, command: REFRESH
samsungtv.log:2021-09-22 01:33:56.770 [TRACE] [nternal.service.MediaRendererService] - Value 'true' for CurrentMute hasn't changed, ignoring update
samsungtv.log:2021-09-22 01:33:57.229 [TRACE] [ngtv.internal.protocol.WebSocketBase] - WebSocketArt: onWebSocketText: {"data":"{\n  \"event\": \"wakeup\"\n}","event":"d2d_service_message","from":"b69042-807-427f-b033-c36b1277f4c"}
samsungtv.log:2021-09-22 01:33:57.230 [DEBUG] [ungtv.internal.protocol.WebSocketArt] - wakeup
samsungtv.log:2021-09-22 01:33:57.230 [TRACE] [ngtv.internal.protocol.WebSocketBase] - WebSocketArt: sendCommand: {"method":"ms.channel.emit","params":{"event":"art_app_request","to":"host","data":"{\"request\":\"get_artmode_status\",\"id\":\"d824284d-7a32-4648-ab83-7ed524f95da3\"}"}}
samsungtv.log:2021-09-22 01:33:57.267 [TRACE] [ngtv.internal.protocol.WebSocketBase] - WebSocketArt: onWebSocketText: {"data":"{\n  \"id\": \"d824284d-7a32-4648-ab83-7ed524f95da3\",\n  \"event\": \"artmode_status\",\n  \"value\": \"on\",\n  \"target_client_id\": \"3aef24e6-5e1f-4ba6-ace5-34a01b5c862b\"\n}","event":"d2d_service_message","from":"b69042-807-427f-b033-c36b1277f4c"}
samsungtv.log:2021-09-22 01:33:57.267 [DEBUG] [ungtv.internal.protocol.WebSocketArt] - artmode_status: on
samsungtv.log:2021-09-22 01:33:57.268 [DEBUG] [tv.internal.handler.SamsungTvHandler] - Received value 'artMode':'ON' for thing 'samsungtv:tv:family_room'
samsungtv.log:2021-09-22 01:33:57.268 [DEBUG] [tv.internal.handler.SamsungTvHandler] - Received value 'power':'OFF' for thing 'samsungtv:tv:family_room'

I’m not sure if anyone is still following this (long) thread, but here is an update:

I found some odd behavior, and bugs in the current binding (the worst is the disabling off the remote controller power button described above), so I decided to dive into the binding, and see if I could fix them (specifically the Frame TV behavior).

So, not too hard to fix, I’m testing my new version of the binding right now (fixes power button, saving of token, and several others I found). During this testing, I found more odd behaviour, which is down to the TV itself. I thought I would report them here, as it may explain some of the odd things people have seen, specifically with Frame TV’s (I have the 2021 version).

POWER Modes
Power modes on the Frame are odd. There is on (TV on), artMode (displaying art) - which also counts as on, but there is also standby where the TV is off, but the network interface is still up, and finally off where the TV is off, and the network interface is off.

If you turn the TV off (long press on power button), the TV goes to standby, but then, after a short time interval (30 seconds or so), it switches to off. Every 5 minutes or so, the TV “wakes up” - ie it appears on the network, and you can connect to it for about 30 seconds - it reports standby mode, then goes back to off mode.

This makes determining if the TV is on or off or in artmode very hard, as you can’t just rely on pinging the TV, or reading the artMode status. It can be figured out, but it’s complicated.

WOL
Wake on Lan is supported by Frame TV’s (and Samsung TV’s after 2016). Of course it is complicated.

What I have found is that WOL works reliably on hardwired Ethernet, as long as you don’t have a sound bar connected via ARC (or eARC). if you have a soundbar connected via ARC, then WOL via hardwired ethernet no longer works.

However, if you connect your TV via WiFi, then WOL works (yes, even on WiFi), even if you have a soundbar connected. I have no explanation for this baffling behavior. I have tested this with my Sonos Beam gen 2, other soundbars may behave differently, and the connection method matters as it seems to be something to do with CEC (Anynet+).

You can still turn artMode on (or the TV on) using IR commands (tested via Harmony). See POWER Control below:

POWER Control
2016 and later TV’s do not have discreet network PowerOn and PowerOff commands, they just have a PowerToggle command. On a Frame TV, this switches between TV on and artMode. A long press (4 seconds) of PowerToggle turns the TV off (via standby mode). If the TV is off sending WOL wakes the TV up in artMode, you can’t send a network PowerToggle unless the TV is on (or in standby). Then, once the TV is on sending PowerToggle turns the TV on (ie artMode off).

The Frame TV’s do, however have discreet IR PowerOn and Off commands. These are not accessible via the samsungtv binding (as it doesn’t have an IR interface) - but I’m still investigating what can be done.

INTERFACES
There are several network interfaces available on Samsung TV’s leaving the UPnP interfaces to one side, the three main interfaces are:

  • Legacy remote control interface on port 55000
  • Insecure websocket Server on port 8001
  • Secure websocket Server on port 8002

Also, there is an http(s) server on ports 8001 and 8002 with an end point of /api/V2/
You will have either the legacy interface (older TV’s) or both websocket interfaces (2016 and later TV’s). The remote control protocol works on the legacy interface or port 8002 interface, but not the port 8001 interface.

There is nothing particularly “secure” about the port 8002 interface, it just uses TLS encryption. It is the only channel that remote control commands work over though, and you have to accept the connection on the TV (the first time it connects) - a ‘token’ (8 digit number) is then issued, which can be stored and reused in order to avoid having to accept the connection every time.

All Frame TV’s are modern TV’s and so have interfaces on port 8001 and 8002. However, seeing as the only way to control the power mode is via the remote control protocol, and that only works on port 8002 - it follows that you should only use the securewebsocket interface on port 8002.

Other Channels
The other channels, Volume, Mute, etc are via a different UpNp MediaRenderer interface, which is another bag of OMG confusion, which is why I’m not dealing with it. I suspect most people are mostly interested in Power status, artMode, and Power Control - so that is what I am focused on.

APP Control
App control is via the websocket interfaces (8001 or 8002) - no token required, but controlled via the RemoteControl interface (port 8002). It seems on the latest Frame TV’s (2021), the command that retrieves the list of installed apps doesn’t work (at least it is sent but produces no response). This is why apps don’t work on the latest TV’s. I think if you could get the App ID’s, you might be able to start apps, but as I say, the command to retrieve the App ID’s doesn’t work. Something to work on.

Art Mode
On a Frame TV, the only way to tell what mode the TV is in, is by connecting to the websocket ArtChannel, and reading the status (artMode ON or OFF). This works on ports 8001 and 8002, but you can only control Power via port 8002. This only works if the TV is not off (ie on or standby), but in standby mode the artMode is reported as ON, even though the TV is actually in standby ie off mode. Fortunately, you can read the TV mode from the http server on port 8001 and (https) 8002, 8001 is easiest (as you don’t have to deal with secure certificates etc). Obviously this doesn’t work if the TV is off, but does work in standby and 'on` modes.

Once you are connected to the ArtChannel, it automatically reports when the artMode changes, slide show changes, current art displayed changes, and (sometimes) when the TV goes to standby or wakes up from standby.

I have also figured out how to set slideshow mode, set the timing, get the slideshow status etc, but I’m not looking to add extra channels right now.

The binding has no way of figuring out whether the TV is a Frame TV or not, until you send an artMode channel command, or it receives an ArtChannel response - which is when it enables artMode. until then you get the artMode not supported message in the log. It doesn’t mean artMode is not supported, it just means the binding hasn’t been able to connect to the ArtChannel yet. this happens every time the binding is restarted.

Trying to figure all this out, so the improved binding works reliably, without messing up the legacy (or other non Frame TV’s) is a huge task, but I have it mostly working (until I connected my new soundbar and WOL stopped working).

If anyone else has any insights on the weirdness of Samsung TV’s that I should be aware of, please post them here, and I’ll take notice.

I will post a new jar file for testing at some point, when I’m confident that it works.

Thanks.

2 Likes

Will this binding work with OH 2.x? I’m still using the 2.4 binding version due to all the issues with 2.5.x.

I have numerous legacy and numerous newer Samsung TVs but NO frame TVs.

Lmk?

Best, Jay

Well in theory addon development is independent of OH core development in the first place so it could.

But still back on 2.4 and that even on Synology is ancient and no good basis and likely to make you hit issues of various sort soon.

If I were you I’d start migration to OH3. Also take the opportunity and change hardware to a Raspi. Install that in parallel and sort issues out there before you switch.

I’m still struggling trying to make my Samsung TVs work with openhab after the update to 3.1. I have two different devices: one QE55Q64 and one UE32 and neither is working correctly. The devices are not discovered automatically and also when using scan from the binding sometimes are discovered sometimes not.
When they are discovered usually the binding uses the 55000 port but it seems the channels are correctly updated only for some minutes. The thing remains online also after I power off the TVs and I receive timouts from ping. It seems the only way to update correctly things and channel is to start a new scan from the binding.
I’ve tried almost evrything I know (clear openhab cache and start with TVs on, start with TVs off and then scan etc…).

I’m desperately looking for help…

Will this binding work with OH 2.x? I’m still using the 2.4 binding version due to all the issues with 2.5.x.

The latest version is compiled for java 11, so probably not.

I was dreading the move to OH3 myself, but it turned out to be a lot easier than I thought. I had been moving everything over to OH2 bindings, and getting rid of OH1 bindings for a while though, as I knew the old V1 bindings were going to be dropped.

MQTT was the worst to move over to OH2.

Once everything was on OH2 bindings, the switch to OH3 was painless. I reccomend moving over to OH 3.1 stable, and go from there.

@Rickytr How old are your TV’s? (I’m not clear on dates from model numbers).
The problem isn’t with OH, caches or anything, the binding itself has a few kinks in it. One of those is that it doesn’t discover the correct configuration for your TV. You have to set this manually in the Thing.
The “channels” you see updating are mostly not real, they are just placeholders. The only channels you are likely to get are Volume and Mute, as these are UpNp services.

As I tried to explain in my long message above (and failed obviously), you have to select the right protocol/port combination yourself.

So, old TV’s (before 2016) use the legacy protocol and port 55000, 2016 TV’s and later use either the websocket protocol on port 8001, or securewebsocket protocol on 8002.

Start with the TV’s on (or the binding won’t find them at all - its not magic), add the Things when/if they appear in the Inbox, then configure the Things as I describe (I would start with securewebsocket and port 8002 if your TV’s are recent).

You will have to accept the connection on the TV when the “Remote Connection” box pops up on the screen - you have 30 seconds to do this from when you click “Save” on the Thing, or the binding won’t connect. If you miss accepting the connection, you have to try all over again. Nothing will work until you manage to click on the “Accept” connection on the TV. If you are sitting at your computer, and the TV is in another room, you may not be aware of the box appearing on the TV screen prompting you to allow openHAB to connect.

Another quirk of the binding is that you have to accept the connection (on the TV) every time you restart OH3, or add the Thing (if you delete it - don’t delete it!).

In addition, your TV’s have to be configured to accept remote connections. I don’t know what your menu’s look like, but usually there is a setting for “IPControl” and “External Device Manager”.

It would probably help me if you could post the output of http://<ip>:8001/api/V2/ where <ip> is the ip address of each of your TV’s. You can enter this in any web browser connected to the same network as your TV’s. You can try https://<ip>:8002/api/V2/ as well, let me know which works.

Let me know how you get on, it took me a while to figure it out, as I also assumed the Thing would be automatically configured correctly for my TV - and it isn’t.

@Nicholas_Waterton I’m sorry if it seems I didn’t read (or appreciate) your long post. But I already tried all you suggested. If I put manually the settings I receive correctly the request on my TV and after I accept it I can see the websocket token in thing (I’m using port 8002 and secure websocket because my TVs are both from 2020). But the thing still stays offline and channels are not read correctly…

The ouput of both paths is as follows:
“404”

Thnaks a lot for your help.