Samsung Smart TV binding

I have a Samsung UN40EH5300 smart TV. I have verified that the TV works with the remotes available in Android market. I am trying to get it to work with OpenHAB with no luck.
I am following the instructions on the binding wiki here.

I am using the Demo setup provided as an example and enabling samsungtv in it. The problem is, I never even see OpenHAB runtime trying to communicate with the TV.

Here are the modifications I have made so far:

  1. Modified the openhab.cfg file as follows:
################################ SAMSUNG TV Binding ###################################
#
# Host of the first TV to control 
samsungtv:<Livingroom>.host=192.168.0.3
# Port of the TV to control (optional, defaults to 55000)
#samsungtv:<TVid1>.port=55000
  1. Modified demo.items file to include the following:
/* Samsung TV */
Number        directChannel  {samsungtv="1:Livingroom:KEY_1,2:Livingroom:KEY_2"} /* some more items here */
Dimmer        channel        {samsungtv="INCREASE:Livingroom:KEY_CHUP, DECREASE:Livingroom:KEY_CHDOWN"}
Switch        mute           {samsungtv="ON:Livingroom:KEY_MUTE, OFF:Livingroom:KEY_MUTE"}
Rollershutter tvVolume       {samsungtv="UP:Livingroom:KEY_VOLUP, DOWN:Livingroom:KEY_VOLDOWN"}
String		  tvControl	     {samsungtv="Livingroom"}
  1. Added these items to sitemap as follows in demo.sitemap file:

      Text label="Television" icon="video" {
      	Frame label="Samsung TV Control" {
      		Selection item=directChannel mappings=[0="1", 1="2", 2="3", 3="4", 4="5", 5="6", 6="7",7="8",8="9"] label="Channel Selection"
      		Selection item=channel label="Channel Up/Down" mappings=[0="INCREASE", 1="DECREASE"]
      		Switch item=mute label="Mute/Un-mute" mappings=[0="ON", 1="OFF"]
      		Switch item=tvVolume label="Volume Up/Down" mappings=[0="UP", 1="DOWN"]
      	}
    
  2. Started the OpenHAB server on my mac, which is on the same network as my tv. I tried this, both as normal and super user. And used the sitemap to send commands.
    I see output on terminal, which reads something like:

-directChannel command received on bus
command was sent
But I don’t see anything happening on the TV.
In fact, even if I change the IP address that was configured in openhab.cfg, or completely comment out that configuration, I still see the same message on the terminal.

Also, I came across this readme.md, which talks about adding the TV as a thing. I am confused. I’d appreciate any suggestions, comments in this regard.

Change this to:

samsungtv:Livingroom.host=192.168.0.3

That example is for Openhab version 2.x, I guess your are using openhab version 1.x.

Thanks a ton for taking time to reply. I made the necessary change. In-fact, I changed the name to something else across all files, so it doesn’t clash with a group name.

Here’s how the files look now:
####openhab.cfg
################################ SAMSUNG TV Binding ###################################
#
# Host of the first TV to control
samsungtv:swapnil_tv.host=192.168.0.3
# Port of the TV to control (optional, defaults to 55000)
#samsungtv:.port=55000

####demo.items
/* Samsung TV */
Number directChannel {samsungtv=“1:swapnil_tv:KEY_1,2:swapnil_tv:KEY_2, 3:swapnil_tv:KEY_3, 4:swapnil_tv:KEY_4,5:swapnil_tv:KEY_5,6:swapnil_tv:KEY_6,7:swapnil_tv:KEY_7,8:swapnil_tv:KEY_8,9:swapnil_tv:KEY_9”}
Dimmer channel {samsungtv=“INCREASE:swapnil_tv:KEY_CHUP, DECREASE:swapnil_tv:KEY_CHDOWN”}
Switch mute {samsungtv=“ON:swapnil_tv:KEY_MUTE, OFF:swapnil_tv:KEY_MUTE”}
Rollershutter tvVolume {samsungtv=“UP:swapnil_tv:KEY_VOLUP, DOWN:swapnil_tv:KEY_VOLDOWN”}

I see the message like:
21:59:31.169 [INFO ] [runtime.busevents :22 ] - directChannel received command 2

There are no errors shown, even in the debug mode. I am pretty sure I am missing something. I’d appreciate some help in getting me started.

I tested mine with the Mute command first…
In the sitemap change the mappings to be ON=“ON”, OFF=“OFF” as opposed to having the numbers in there.
Do the same for the rest once thats proved out.
I believe the first item in the mapping must match the function you want to activate in the item. (its either the first or the second lol, I’m not at my machine to get the samsung bits from it)

Thanks a lot. I will try that tonight and see what happens.
Meanwhile, one question though:
I did not see any problems with the commands for anything other than mute.
Does the command not go out at all, if it’s not a valid command? I’d assume
that the authentication process would take place anyway and as such, the TV
should ask me if I want to allow commands from OpenHAB or not.
Is my understanding wrong?

When you get the command exiting the server, the first time it will ask on the TV to permit the control.

You “might” have to go into the TV settings and enable allshare.
For reference, the log file will tell you if the Samsung binding send event has been sucessful or not (in info mode, and much more detail in Debug mode)

Sitemap for Mute

Switch item=mute label=“TV Mute” mappings=[ON=“ON”,OFF=“OFF”]

Mappings in “” are the switch text so free for all.

Items
Switch mute {samsungtv=“ON:LoungeTV:KEY_MUTE, OFF:LoungeTV:KEY_MUTE”}

Should help, I hope

Great! Thank you again. I’ll try this as the first thing when I go home.
This community is awesome.

Alright! This finally worked! I want to hide my face somewhere. The problem was, I had never copied the relevant add-on to the addon directory! Once I did that, it started working. Well, at least I see the notification on TV for allowing the access!

Live and learn :smiley: atleast its working

1 Like

Sup?

I have a Samsung TV UE40H6400 and i dont know if the samsung 1.7.1 jar binding is the right one to make it work.
I made an item file, a site map according to the eg above only for one item with directChannel and modified the cfg file with the IP that i see in my router DHCP clients which is 192.168.1.100 and the port 55000. By the way, this IP is changing depending on how many devices connects to the router so every time i need to check the IP and to modify the cfg file in OH.
In the debug log i see that OH receive commands but nothing happen with the TV!
Also the TV works fine with the smart view app on my smartphone but it never display the notification to allow the connection …
Is my TV not compatible with this OH binding? the port is not right?

Any idea would be kindly appreciated.
Thanks!

Hello!

I have Samsung H series TV too, but, as far as I’m aware, 2014 and newer models of Samsung TVs, does not support controlling it over IP (their application works, but not over open protocol, like before). The only available option I see right now is some IR controller, that will send learned remote control commands to the TV.

Best regards,
Davor

Oh, how is this possible? I mean new models cant work with OH but the older ones do? Theres no updated binding that will work with our TV series?
I’m afraid the IR option is kinda complicated to do and requires other hardware and programming like an arduino with the IR receiver etc. and this is too complicated!

I don’t know what to say…

I’m trying to get the source buttons to work on my samsung tv.
I have volume working, so i know its not the binding.

Here is my item:
Switch LRTV_Source “” { samsungtv=“1:LRTV:KEY_HDMI1, 2:LRTV:KEY_HDMI2, 3:LRTV:KEY_HDMI3, 4:LRTV:KEY_HDMI4”, autoupdate=“false” }

Here is my sitemap:
Switch item=LRTV_Source label=“Source” mappings=[1=HDMI1,2=HDMI2,3=HDMI3,4=HDMI4]

I’ve tried numerous combinations of on=on etc…still can’t get it working

I can get KEY_HDMI to work…but it only cycles…i want to use KEY_HDMI1 etc to go directly to that source.

that wont work
sitemap
Switch item=LRTV_Source mappings=[ON=“HDMI1”] label="Source Selection"
item
Switch LRTV_Source { samsungtv=“ON:LRTV:KEY_HDMI” }

Rich, may I ask you what is your TV series? I have a Samsung UE40H6400 and using the samsung 1.7.1.jar binding it’s not doing anything!
Thanks!

Hi Rich

Did you ever get this working ? I am having the same issue.

Thanks
J

mine is a UNC55D7000LF

No I never got the HDMI_1, 2, 3, 4 working just the cycling

I’m using binding 1.8.3 with OpenHab(not 2)