Samsung TV Binding (Beta)


When I switch the source from TV to screen mirroring the power channel switches to off.

Can you get me a log (TRACE level) of what happens when you switch to Screen Mirroring.

What exactly is Screen Mirroring? Can you explain the feature?


Can you get me a log (TRACE level) of what happens when you turn the Serif on and off (both power and art).

Can you also post the output of http://tv_ip:8001/api/v2/ where tv_ip is the IP address of the Serif.

Does the Serif display art when it’s off? Or is it just on/off?


@Nicholas_Waterton Thank you for your request. Please find attached the output of


{"device":{"FrameTVSupport":"false","GamePadSupport":"true","ImeSyncedSupport":"true","Language":"de_DE","OS":"Tizen","PowerState":"on","TokenAuthSupport":"true","VoiceSupport":"true","WallScreenRatio":"0","WallService":"false","countryCode":"DE","description":"Samsung DTV RCR","developerIP":"","developerMode":"0","duid":"uuid:f2cc06d3-b8c9-4409-a136-96adda319600","firmwareVersion":"Unknown","id":"uuid:f2cc06d3-b8c9-4409-a136-96adda319600","ip":"","model":"19_MUSEM_SERIF","modelName":"QE43LS01RAUXZG","name":"[TV] Samsung Serif TV (43)","networkType":"wireless","resolution":"3840x2160","smartHubAgreement":"true","ssid":"3c:a6:2f:91:36:c8","type":"Samsung SmartTV","udn":"uuid:f2cc06d3-b8c9-4409-a136-96adda319600","wifiMac":"D0:03:DF:9C:40:18"},"id":"uuid:f2cc06d3-b8c9-4409-a136-96adda319600","isSupport":"{\"DMP_DRM_PLAYREADY\":\"false\",\"DMP_DRM_WIDEVINE\":\"false\",\"DMP_available\":\"true\",\"EDEN_available\":\"true\",\"FrameTVSupport\":\"false\",\"ImeSyncedSupport\":\"true\",\"TokenAuthSupport\":\"true\",\"remote_available\":\"true\",\"remote_fourDirections\":\"true\",\"remote_touchPad\":\"true\",\"remote_voiceControl\":\"true\"}\n","name":"[TV] Samsung Serif TV (43)","remote":"1.0","type":"Samsung SmartTV","uri":"","version":"2.0.25"}

It is just on/off

I have to find out how to enable this and come back with it later.

Anything else?

On your question on how to change log levels: documentation
You will need to go into the Karaf console.

Thanks for your support!

Screenshot from my TV, you see the TV, HDMI1, HDMI2… source inputs.
There is also the Screen Mirroring source, by selecting this input I can eg share my phone screen to the TV.

Attached my full trace log (log.txt).

This is the part where I switched source to Screen Mirroring. It seems that the device is removed during this step:

2022-01-05 15:11:26.198 [TRACE] [internal.service.MainTVServerService] - Received channel: sourceName, command: REFRESH
2022-01-05 15:11:26.292 [TRACE] [internal.service.MainTVServerService] - Value '0' for ID hasn't changed, ignoring update
2022-01-05 15:11:26.294 [TRACE] [internal.service.MainTVServerService] - Value 'TV' for CurrentExternalSource hasn't changed, ignoring update
2022-01-05 15:11:26.297 [TRACE] [nternal.service.MediaRendererService] - Received channel: volume, command: REFRESH
2022-01-05 15:11:26.310 [DEBUG] [tv.internal.handler.SamsungTvHandler] - Device removed: udn=058
2022-01-05 15:11:26.312 [DEBUG] [tv.internal.handler.SamsungTvHandler] - Shutdown all Samsung services
2022-01-05 15:11:26.312 [DEBUG] [nternal.service.MediaRendererService] - onStatusChanged: status=false
2022-01-05 15:11:26.323 [DEBUG] [tv.internal.handler.SamsungTvHandler] - Shutdown all Samsung services
2022-01-05 15:11:26.324 [DEBUG] [tv.internal.handler.SamsungTvHandler] - TV is Offline
2022-01-05 15:11:26.326 [TRACE] [nternal.service.MediaRendererService] - Received channel: mute, command: REFRESH
2022-01-05 15:11:26.328 [DEBUG] [tv.internal.handler.SamsungTvHandler] - TV is Offline

Here I switched back to source TV:

2022-01-05 15:12:13.578 [DEBUG] [tv.internal.handler.SamsungTvHandler] - remoteDeviceAdded: RemoteControlReceiver,, upnpUDN=0eeb58
2022-01-05 15:12:13.580 [DEBUG] [tv.internal.handler.SamsungTvHandler] - Check and create missing services
2022-01-05 15:12:13.582 [DEBUG] [rnal.service.RemoteControllerService] - Creating a Samsung TV RemoteController service: is UPNP:true
2022-01-05 15:12:13.584 [DEBUG] [rnal.protocol.RemoteControllerLegacy] - Open connection to host ''
2022-01-05 15:12:13.589 [DEBUG] [rnal.protocol.RemoteControllerLegacy] - Connection successfully opened...querying access
2022-01-05 15:12:13.694 [DEBUG] [rnal.protocol.RemoteControllerLegacy] - Access granted
2022-01-05 15:12:13.696 [DEBUG] [tv.internal.handler.SamsungTvHandler] - Started service for: UE40F6500, RemoteControlReceiver (0eeb58)
2022-01-05 15:12:13.699 [DEBUG] [tv.internal.handler.SamsungTvHandler] - TV is online


here are the instructions on how to enable TRACE level logging from the binding documentation:

Separating the Samsung logging into its own file

To separate all the Samsung logging information into a separate file, please edit the file userdata/etc/log4j2.xml as follows:

  1. Add an logger appender definition (including the log file name)
  2. Add a logger definition referencing the appender defined in step 1

Example for logging all DEBUG logs into a separate file samsungtv.log under the standard log folder

    <!-- SamsungTV binding appender -->
    <RollingFile fileName="${sys:openhab.logdir}/samsungtv.log" filePattern="${sys:openhab.logdir}/samsungtv-%d{yyyyMMdd-HHmmss}.log" name="SAMSUNGTV">
        <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5.5p] [%-36.36c] - %m%n"/>
            <SizeBasedTriggeringPolicy size="16 MB"/>
    <Logger additivity="false" level="DEBUG" name="org.openhab.binding.samsungtv">
        <AppenderRef ref="SAMSUNGTV"/>

If you have problems with the binding, set the log level to TRACE (in place of DEBUG) and post a message with a TRACE log covering 30 seconds before the issue and 30 seconds after (please don’t send me a log with one line that you think is relevant in it, I can’t tell much from this).

This will create a separate log file called samsungtv.log.

Your TV configuration looks normal for an on/off TV (no artMode), so I need to find out if your TV switches on to standby or on mode.


1 Like


So I can see that when the TV switches to Screen Mirroring, the MediaRenderer service stops. This is the service that is used to determine if the TV is Online/ON or not (as all Samsung TV’s have this service).

There is not much that I can do about that. The TV does not actually turn off - just the power and ONLINE indicators show the TV as OFF and OFFLINE.

I’m afraid it’s just one of those edge cases that the binding has no way of dealing with.

1 Like


Thank you for the link I wanted to look it up myself but this is easier. I entered the KARAF and hit
Log:set TRACE org.openhab.binding.samsungtv

After that I changed the log4j2.xml according to your instructions and changed DEBUG to TRACE

The log file was created but remains empty. Sorry. Maybe there is a general problem with logging on my pi.


If you make the changes to the log4j2.xml file, you don’t have to do anything in the console.

The logging is still probably going to your openhab.log file. Try capturing from that that.

Ok. Got it. There is an issue with the logging. I fixed it with this one:

Please find attached the trace (DEBUG)
samsungtv.log (40.4 KB)


Are you using my binding? That log looks like it’s from the original binding, not mine.

You need to uninstall the original samsungtv binding for the new one to load.

You can tell the difference in the log. The new binding shows the IP address of the TV in each log line (I added this so that you can tell which TV is reporting if you have more than one).

Oh yes. You are right. Apologize. There was a confusion of the used binding when I tried to get the binding access acknowledged by the TV and I had to reinstall it.
I made sure the right binding is installed now and the TV is reacting on it. The TV behaviour is not as consistent anymore.

I will attach the log later. Nevertheless I noticed that your binding is more focussing on The Frame and I have The Serif so my Setup is maybe not the right one for your binding.

Here are the logs. I changed the binding at around 08:58 and used the ART switch and the power switch.
samsungtv.log (283.4 KB)


Thanks for the log.

The Serif should work just fine, as it works like a standard TV.

I do really need a TRACE level log to see what is happening in detail, your log is DEBUG level.

having said that I can see a number of problems.

Everything starts out OK, with the TV discovered and configured correctly. There is something wrong with the way you have the volume channel configured.

2022-01-06 09:05:53.307 [DEBUG] [tv.internal.handler.SamsungTvHandler] - Received channel: samsungtv:tv:043aa128-fa86-49dc-a5c1-305fe7ce3caa:volume, command: 40
2022-01-06 09:05:53.308 [WARN ] [rnal.service.RemoteControllerService] - Remote control: wrong command type 40 channel volume

This is the message you get if you send the wrong command type to the volume channel. It should be set up as a Dimmer (are you sending a string?). Anyway, that isn’t the major problem.

You then seem to reconfigure the TV to use port 8001. Port 8001 will NOT work for your TV, and this causes the websockets connection to fail.

There are a lot of messages about the websocket connection failures (and sending commands while the websockets are disconnected), then you change the connection type from websocketsecure to websocket, and port 8002 - this is the wrong connection type for your TV, you MUST use websocketsecure in order for commands to work (like power).

As a result, there are a lot more messages about websocket connection failures.

Finally, you go back to the correct settings, ie websocketsecure and port 8002. at 09:08:14.341.

When you send the artMode OFF command, it is ignored (no artMode). You then send Power OFF, which works, and shuts the TV down (09:08:28.658).

Now you send artMode ON, which actually starts sending the WOL command. WOL can take 10 - 15 seconds to work, but 5 seconds later you send Power ON, which cancels the WOL job, and restarts it. 3 seconds later, you send Power ON again, which does the same. 2 seconds later, you send artMode ON, again cancelling the WOL job.

This keeps going until the TV comes online at 09:09:04.936, however, the websockets are unable to connect for some reason - I suspect the TV is not really on at this point. This cycle of commands and failing websocket connection prevents WOL commands being sent.
Finally the WOL seems to work at 09:09:30.872 (or at least the TV turns on), and the websockets connect.

There are a bunch of errors about the connection order, and I think I have some work to do in the rediscovery process - the websocket connection is a problem when it fails.

Things that you can do:

  1. Set the log to TRACE level
  2. Disconnect the artMode channel - this is confusing things - you don’t have artMode
  3. Be patient, turning the TV on takes up to 30 seconds. the TV is slow to respond to WOL packets. Sending repeated ON commands does not help.
  4. Once the TV is OFF, wait 60 seconds before turning it on (this time can vary depending on the TV).
  5. Fix your volume channel (Item should be Dimmer).

I will work on the rediscovery reliability and update later today.

Thanks for the log - this was very helpful.

I have uploaded a fixed binding. Please try this out - do not use the artMode switch! try using the Power switch to turn the TV ON and OFF. Please be patient, sometimes WOL can take a few seconds to work, and sometimes you have to wait 60 seconds or so after the TV turns off, before you can turn it back on.

This is because Samsung TV’s do not completely power down immediately after you turn them off (this is called the “instant on” feature). The TV will not respond to WOL until it has fully powered down, which can take 60 seconds or so. During this time the TV only responds to IR commands (from the remote).

If you can post a TRACE log with the new binding, it will help me see if it is now working as expected.

Thanks again.

Hi Nicholas,

please find attached the trace. I recorded one, after removing the model and the thing, deleted the binding, restarted the pi, and made a new installation of the binding from the marketplace, scanned for the thing, added it, acknowledged the TV, created a model without the artswitch (The Serif has ambient mode not art mode as you stated, but maybe similiar functionality from customer point of view), looked up, that volume is recognized as dimmer, was patient.

I changed the logger to TRACE.

I noticed, that key press is not recognized as it is in the samsung binding, so I cannot use it. Then I played around, with power, mute, volume, power.

Thank you very much for your work!
I hope the trace is helpful.
samsungtv.log (318.2 KB)

I deleted the model and created it again from the thing, again without the art mode and without advanced channels. I tried the key press again and it worked for key_mute. The rest I have not tried.


Thanks for the log, glad to see that everything is now working as expected.

I’m not sure what you meant by:

“key press” is one of the new features that I introduced for the keyCode channel. You use it by sending a command like this -4000,KEY_POWER to the keyCode channel (as a string). This would send a 4 second press of the KEY_POWER key (4000ms). You can use any duration, or key, and you can chain them together. I give full instructions in the documentation in the keyCode section.

There is now support for KEY_AMBIENT to put the TV in ambient mode as well.

I did notice you linked the following channels:

  • sourceName
  • channelName
  • programTitle

These channels will not work on your TV, unless you add your TV to the SmartThings App, and create a SmartThings Personal Access Token, which you then enter in the binding configuration.

Channels that do work on your TV, but are not linked include:

  • sourceApp
  • url
  • stopBrowser

Although url and stopBrowser are fairly limited in what they can do. The sourceApp channel shows you the current app running, and allows you to launch apps by sending the name of the app (eg Netflix) to the channel. Sending "" to the channel closes the current app.

Thanks for taking the time to send me the logs - they were a great help.

Is the keycode MediaTrackNext as found the Samsung developer docs supported by these TVs?
I see it’s not in the KeyCode enum but not sure if that was an oversight or not supported.

Would be very useful if available.


According to the documentation, MediaTrackNext is a long press of the fast forward key:
On the basic remote control:

Table 1. Basic remote control key functions

Key Click Key Name Long Press Key Name
“Rewind” MediaRewind MediaTrackPrevious
“Fast Forward” MediaFastForward MediaTrackNext

So to send this to your TV you would send the following to the keyCode channel:
I’m not sure what a “long press” duration is, the above would send a 2 second long press of Fast Forward, you may have to experiment with the duration.

The sitemap entry would be:

Switch item=TV_KeyCode label="Media" mappings=["-2000,KEY_REWIND"="Previous","-2000,KEY_FF"="Next"]

Where TV_KeyCode is the item linked to the keyCode channel.

Try this and let me know if it works.

Hello to all,

Did some testing with the binding and instead of the command to install upnp I installed the Upnp Binding (I guess it is the same thing, right?).
I tested that power, mute and volume works correctly with both of my TV’s but when I power them off by the binding or the remote control the Thing does not offline and after that the channels do not update anymore. If I remove the Thing and add it again, all the channels start working again. I tried to stop openHAB clean the cache and start again, but it does not solve this issue.
This is a strange issue and I do not know where to start looking.
Could you please try and help me with this situation?

Thanks in advanced.

Best regards.

@Nicholas_Waterton it seems that the long press just fastforwards for X seconds.
I will continue to research but it’s possible the long press button presses are not compatible programatically. Reference: Samsung remote (CEC) Long-press working in Android but NOT in Kodi

Has anyone else gotten a Long Press working for something else?


I don’t know if installing the UPNP binding is the same thing or not. Maybe you have to configure the UPNP binding somehow. The problem you are describing sounds as though the samsungtv binding is not seeing the UPNP services.

The UPNP service MediaRenderer is used to detect if the TV is ON or OFF.

When you first add the thing the binding probes the configuration, and if it can connect to a RemoteControlService on one of the common ports, it saves the configuration, marks the TV as ON and starts the various channels.

If you turn the TV off, it will send the off command, but if it doesn’t see a MediaRenderer instance go offline, it won’t make the TV Offline (but the channels will disconnect). The same is true if the TV turns on, if the binding does not see a MediaRenderer service for your TV’s ip address, it doesn’t know the TV is on, and won’t start up the channels.

So I think your problem is that either UPNP is disabled on your network, or you do in fact need to install the upnp transport io as I describe in the instructions.

What model TV’s do you have? do you know what year they are?