Samsungtv binding with UN55MU6300 issues

Linux Ubuntu 18.04
openHAB 2.4
samsungtv binding 2.5-SNAPSHOT

I can’t make it work with UN55MU6300 thing.
The state is Unknown.

I see communications between openHAB and a TV:

tcpdump -vv -X src 10.10.5.15 and dst 10.10.5.118 and port 8001

10.10.5.15.40586 > 10.10.5.118.8001: Flags [P.], cksum 0xaffe (correct), seq 14:21, ack 7, win 254, options [nop,nop,TS val 717232745 ecr 75735519], length 7
    0x0000:  4500 003b ba0e 0000 4006 a216 0a0a 050f  E..;....@.......
    0x0010:  0a0a 0576 9e8a 1f41 9fc2 54c6 31c4 57bf  ...v...A..T.1.W.
    0x0020:  8018 00fe affe 0000 0101 080a 2ac0 1a69  ............*..i
    0x0030:  0483 a1df 8a81 03fc ee37 03      

tcpdump -vv -X dst 10.10.5.15 and src 10.10.5.118 and port 8001

10:44:12.953899 IP (tos 0x0, ttl 64, id 58495, offset 0, flags [DF], proto TCP (6), length 52)
    10.10.5.118.8001 > 10.10.5.15.40584: Flags [.], cksum 0x6505 (correct), seq 3, ack 8, win 235, options [nop,nop,TS val 75756525 ecr 717316769], length 0
        0x0000:  4500 0034 e47f 4000 4006 37ac 0a0a 0576  E..4..@.@.7....v
        0x0010:  0a0a 050f 1f41 9e88 ca26 1870 4116 8aea  .....A...&.pA...
        0x0020:  8010 00eb 6505 0000 0101 080a 0483 f3ed  ....e...........
        0x0030:  2ac1 62a1                                *.b.

I even disabled tcp offloading on the server nic to fix tcp/udp checksum errors :

ethtool -K enp5s0 tx off rx off

openHAB and UN55MU6300 do not understand each other?

At least as of today, UN55MU6300 is not listed as a tested TV on https://www.openhab.org/addons/bindings/samsungtv/

This might be helpful:

device
FrameTVSupport “false”
GamePadSupport “true”
ImeSyncedSupport “true”
OS “Tizen”
TokenAuthSupport “true”
VoiceSupport “true”
countryCode “US”
description “Samsung DTV RCR”
developerIP “0.0.0.0”
developerMode “0”
duid “uuid:b53757e5-3bc1-42e5-b115-42c02f9093b5”
firmwareVersion “Unknown”
id “uuid:b53757e5-3bc1-42e5-b115-42c02f9093b5”
ip “10.10.5.118”
model “17_KANTM_UHD_BASIC”
modelName “UN55MU6300”
name “[TV] Samsung 6 Series (55)”
networkType “wireless”
resolution “3840x2160”
smartHubAgreement “true”
ssid “10:da:43:8f:a3:25”
type “Samsung SmartTV”
udn “uuid:b53757e5-3bc1-42e5-b115-42c02f9093b5”
wifiMac “F8:3F:51:7C:92:94”
id “uuid:b53757e5-3bc1-42e5-b115-42c02f9093b5”
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 6 Series (55)”
remote “1.0”
type “Samsung SmartTV”
uri http://10.10.5.118:8001/api/v2/
version “2.0.25”

UPDATE:

Turning on works (not always) but nothing else.

I have just tested an Android Samsung Smart TV WiFi Remote. It looks like it starts its communications on 8001 and then switches to 8002. It requires pairing with TV. I do not know it might be a websocket token must be generated. How?

Sionce I needed this binding only for a TV status (ON/OFF) and my TV requires pairing and remote access Allow/Deny Authentication, I decided to move on.
The exec binding works perfectly well for my purposes.

  1. bash script openhab-tv-monitoring.sh (my TV IP 10.10.5.118):

#! /bin/bash

ping -c 3 -O -t 30 10.10.5.118 > /dev/null
if [ $? -eq 0 ]
then
echo “ON”
exit 0
fi
echo “OFF”
exit 0

  1. placed it in /home/<username>/ directory
  2. sudo chmod 755 /home/<username>/openhab-tv-monitoring.sh
  3. Things:
    Thing exec:command:tv_monitoring [command="/bin/bash /home/<username>/openhab-tv-monitoring.sh", interval=300, timeout=10, autorun=true]
  4. Items:
String   TvStatusMonitoring "TV Status Monitoring [%s]"  { channel="exec:command:tv_monitoring:output" }
Switch EnableTvMonitoring
  1. Rules:
rule "TV-Living-Status" 
when   
      Item TvStatusMonitoring changed
then
    if (TvStatusMonitoring.state == "ON" && EnableTvMonitoring.state == ON) {
 	     sendPushoverMessage(pushoverBuilder("TV is ON"))
           <or whatever we need>
       logInfo("TV Status Changed", "TV is ON" )
    }
    else 
    if (TvStatusMonitoring.state == "OFF" && EnableTvMonitoring.state == ON) {
         sendPushoverMessage(pushoverBuilder("TV is OFF")) 
      <or whatever we need>
       logInfo("TV Status Changed", "TV is OFF" )
    }
end
  1. Sitemap:
sitemap TvStatusCheck label="TV Living Room Status"
{
	Frame {
	Switch item=EnableTvMonitoring label="Monitoring" mappings=[ON="Enable",OFF="Disable"]
        Text item=TvStatusMonitoring label="TV Status" icon="screen"
	}
}

UPDATE:

This is an option with enabling/disabling pinging when Monitoring is Enabled/Disabled:

Script:

#! /bin/bash
if [[ "$1" -eq "11" ]]
then
ping -c 3 -O -t 30 10.10.5.118  > /dev/null
  if [ $? -eq 0 ]
  then 
        echo "ON"
     exit 0
  fi
  echo "OFF"
  exit 0
fi
  exit 0

Items:

String TvStatusMonitoring "TV Status Monitoring [%s]" { channel="exec:command:tv_monitoring:output" }

String TvStatusMonitoring_Args { channel="exec:command:tv_monitoring:input" }

Switch EnableTvMonitoring

Things:

Thing exec:command:tv_monitoring [command="/bin/bash /home/<username>/openhab-tv-monitoring.sh %2$s", interval=300, timeout=10, autorun=true]

Rules:

rule "TV-Monitoring-Ping-Enabling-Disabling"
when
     Item EnableTvMonitoring changed
then
     if (EnableTvMonitoring.state == ON) {
          TvStatusMonitoring_Args.sendCommand("11")
    }
    else 
    if (EnableTvMonitoring.state == OFF ) {
          TvStatusMonitoring_Args.sendCommand("22")
    }
end

rule "TV-Living-Status" 
when   
      Item TvStatusMonitoring changed
then
    if (TvStatusMonitoring.state == "ON" && EnableTvMonitoring.state == ON) {
 	sendPushoverMessage(pushoverBuilder("TV is ON"))
        <whatever we need>
        logInfo("TV Status Changed", "TV is ON" )
    }
    else 
    if (TvStatusMonitoring.state == "OFF" && EnableTvMonitoring.state == ON) {
         sendPushoverMessage(pushoverBuilder("TV is OFF"))
         <whatever we need>
         logInfo("TV Status Changed", "TV is OFF" ) 
    }
end