Control newer Samsung TVs


#1

Hi,
for those who have the same problem with newer Samsung TVs. The component included in HASS will detect the TV, but controlling is not possible. So I created a custom component. Just create a file samsungtv.py in the custom_components/media_player folder and copy the following content into it:

"""
Support for interface with an Samsung TV.

For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.samsungtv/
"""
import logging
import socket
from bs4 import BeautifulSoup

import voluptuous as vol

from homeassistant.components.media_player import (
    SUPPORT_SELECT_SOURCE, SUPPORT_TURN_OFF, SUPPORT_VOLUME_MUTE, SUPPORT_VOLUME_SET,
    SUPPORT_VOLUME_STEP, MediaPlayerDevice, PLATFORM_SCHEMA, SUPPORT_TURN_ON)
from homeassistant.const import (
    CONF_HOST, CONF_NAME, STATE_OFF, STATE_ON, STATE_UNKNOWN, CONF_PORT,
    CONF_MAC)
import homeassistant.helpers.config_validation as cv

REQUIREMENTS = ['wakeonlan==0.2.2', 'beautifulsoup4==4.6.0']

_LOGGER = logging.getLogger(__name__)

CONF_TIMEOUT = 'timeout'

DEFAULT_NAME = 'Samsung TV Remote'
DEFAULT_PORT = 55000
DEFAULT_TIMEOUT = 0

KNOWN_DEVICES_KEY = 'samsungtv_known_devices'

SUPPORT_SAMSUNGTV = SUPPORT_SELECT_SOURCE | SUPPORT_VOLUME_SET | \
    SUPPORT_VOLUME_STEP | SUPPORT_VOLUME_MUTE | SUPPORT_TURN_OFF

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
    vol.Required(CONF_HOST): cv.string,
    vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
    vol.Optional(CONF_PORT, default=DEFAULT_PORT): cv.port,
    vol.Optional(CONF_TIMEOUT, default=DEFAULT_TIMEOUT): cv.positive_int,
})


# pylint: disable=unused-argument
def setup_platform(hass, config, add_devices, discovery_info=None):
    """Set up the Samsung TV platform."""
    known_devices = hass.data.get(KNOWN_DEVICES_KEY)
    if known_devices is None:
        known_devices = set()
        hass.data[KNOWN_DEVICES_KEY] = known_devices

    # Is this a manual configuration?
    if config.get(CONF_HOST) is not None:
        host = config.get(CONF_HOST)
        port = config.get(CONF_PORT)
        name = config.get(CONF_NAME)
        mac = config.get(CONF_MAC)
        timeout = config.get(CONF_TIMEOUT)
    elif discovery_info is not None:
        tv_name = discovery_info.get('name')
        model = discovery_info.get('model_name')
        host = discovery_info.get('host')
        name = "{} ({})".format(tv_name, model)
        port = DEFAULT_PORT
        timeout = DEFAULT_TIMEOUT
        mac = None
    else:
        _LOGGER.warning("Cannot determine device")
        return

    # Only add a device once, so discovered devices do not override manual
    # config.
    ip_addr = socket.gethostbyname(host)
    if ip_addr not in known_devices:
        known_devices.add(ip_addr)
        add_devices([SamsungTVDevice(host, port, name, timeout, mac)])
        _LOGGER.info("Samsung TV %s:%d added as '%s'", host, port, name)
    else:
        _LOGGER.info("Ignoring duplicate Samsung TV %s:%d", host, port)


class SamsungTVDevice(MediaPlayerDevice):
    """Representation of a Samsung TV."""

    def __init__(self, host, port, name, timeout, mac):
        """Initialize the Samsung device."""
        from wakeonlan import wol
        # Save a reference to the imported classes
        self._name = name
        self._mac = mac
        self._wol = wol
        # Assume that the TV is not muted
        self._muted = False
        self._volume = 0
        self._state = STATE_OFF
        # Generate a configuration for the Samsung library
        self._config = {
            'name': 'HomeAssistant',
            'description': name,
            'id': 'ha.component.samsung',
            'port': 7676,
            'host': host,
            'timeout': timeout,
        }
        self._selected_source = ''
        self._source_names = self.SendSOAP('smp_4_', 'urn:samsung.com:service:MainTVAgent2:1', 'GetSourceList', '', 'sourcetype')
        if self._source_names:
            del self._source_names[0]
            self._source_ids = self.SendSOAP('smp_4_', 'urn:samsung.com:service:MainTVAgent2:1', 'GetSourceList', '', 'id')
            self._sources = dict(zip(self._source_names, self._source_ids))
        else:
            self._source_names = {}
            self._source_ids = {}
            self._sources = {}        

    def update(self):
        """Retrieve the latest data."""
        currentvolume = self.SendSOAP('smp_17_', 'urn:schemas-upnp-org:service:RenderingControl:1', 'GetVolume', '<InstanceID>0</InstanceID><Channel>Master</Channel>','currentvolume')
        if currentvolume:
            self._volume = int(currentvolume) / 100
            currentmute = self.SendSOAP('smp_17_', 'urn:schemas-upnp-org:service:RenderingControl:1', 'GetMute', '<InstanceID>0</InstanceID><Channel>Master</Channel>','currentmute')
            if currentmute == '1':
                self._muted = True
            else:
                self._muted = False
            source = self.SendSOAP('smp_4_', 'urn:samsung.com:service:MainTVAgent2:1', 'GetCurrentExternalSource', '','currentexternalsource')
            self._selected_source = source
            self._state = STATE_ON
            return True
        else:
            self._state = STATE_OFF
            return False

    def SendSOAP(self,path,urn,service,body,XMLTag):
        CRLF = "\r\n"
        xmlBody = "";
        xmlBody += '<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">'
        xmlBody += '<s:Body>'
        xmlBody += '<u:{service} xmlns:u="{urn}">{body}</u:{service}>'
        xmlBody += '</s:Body>'
        xmlBody += '</s:Envelope>'
        xmlBody = xmlBody.format(urn = urn, service = service, body = body)
    
        soapRequest  = "POST /{path} HTTP/1.0%s" % (CRLF)
        soapRequest += "HOST: {host}:{port}%s" % (CRLF)
        soapRequest += "CONTENT-TYPE: text/xml;charset=\"utf-8\"%s" % (CRLF)
        soapRequest += "SOAPACTION: \"{urn}#{service}\"%s" % (CRLF)
        soapRequest += "%s" % (CRLF)
        soapRequest += "{xml}%s" % (CRLF)
        soapRequest = soapRequest.format(host = self._config['host'], port = self._config['port'], xml = xmlBody, path = path, urn = urn, service = service)
    
        
        client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        client.settimeout(0.5)
        client.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
        dataBuffer = ''
        response_xml = ''
        _LOGGER.info("Samsung TV sending: %s", soapRequest)
    
        try:
            client.connect( (self._config['host'], self._config['port']) )
            client.send(bytes(soapRequest, 'utf-8'))
            while True:
                dataBuffer = client.recv(4096)
                if not dataBuffer: break
                response_xml += str(dataBuffer)
        except socket.error as e:
            return
        
        response_xml = bytes(response_xml, 'utf-8')
        response_xml = response_xml.decode(encoding="utf-8")
        response_xml = response_xml.replace("&lt;","<")
        response_xml = response_xml.replace("&gt;",">")
        response_xml = response_xml.replace("&quot;","\"")
        _LOGGER.info("Samsung TV received: %s", response_xml)
        if XMLTag:
            soup = BeautifulSoup(str(response_xml), 'html.parser')
            xmlValues = soup.find_all(XMLTag)
            xmlValues_names = [xmlValue.string for xmlValue in xmlValues]
            if len(xmlValues_names)== 1: 
                return xmlValues_names[0]
            else:
                return xmlValues_names
        else:
            return response_xml[response_xml.find('<s:Envelope'):]

    @property
    def name(self):
        """Return the name of the device."""
        return self._name

    @property
    def state(self):
        """Return the state of the device."""
        return self._state

    @property
    def volume_level(self):
        """Volume level of the media player (0..1)."""
        return self._volume

    @property
    def is_volume_muted(self):
        """Boolean if volume is currently muted."""
        return self._muted
    @property

    def source(self):
        """Return the current input source."""
        return self._selected_source

    @property
    def source_list(self):
        """List of available input sources."""
        return self._source_names

    @property
    def media_title(self):
        """Title of current playing media."""
        return self._selected_source

    @property
    def supported_features(self):
        """Flag media player features that are supported."""
        if self._mac:
            return SUPPORT_SAMSUNGTV | SUPPORT_TURN_ON
        return SUPPORT_SAMSUNGTV

    def select_source(self, source):
        """Select input source."""
        self.SendSOAP('smp_4_', 'urn:samsung.com:service:MainTVAgent2:1', 'SetMainTVSource', '<Source>'+source+'</Source><ID>' + self._sources[source] + '</ID><UiID>0</UiID>','')

    def turn_off(self):
        """Turn off media player."""

    def set_volume_level(self, volume):
        """Volume up the media player."""
        volset = str(round(volume * 100))
        self.SendSOAP('smp_17_', 'urn:schemas-upnp-org:service:RenderingControl:1', 'SetVolume', '<InstanceID>0</InstanceID><DesiredVolume>' + volset + '</DesiredVolume><Channel>Master</Channel>','')

    def volume_up(self):
        """Volume up the media player."""
        volume = self._volume + 0.01
        self.set_volume_level(volume)

    def volume_down(self):
        """Volume down media player."""
        volume = self._volume - 0.01
        self.set_volume_level(volume)

    def mute_volume(self, mute):
        """Send mute command."""
        if self._muted == True:
            doMute = '0'
        else:
            doMute = '1'
        self.SendSOAP('smp_17_', 'urn:schemas-upnp-org:service:RenderingControl:1', 'SetMute', '<InstanceID>0</InstanceID><DesiredMute>' + doMute + '</DesiredMute><Channel>Master</Channel>','')

    def turn_on(self):
        """Turn the media player on."""
        if self._mac:
            self._wol.send_magic_packet(self._mac)

What works:
Mute / Unmute
Set volume
Increase / Decrease volume
Set Source

Not working:
Power On and Power Off

Tested device models:
Q = 2017 (QLED) (not tested)
MU = 2017(UHD) (not tested)
M = 2017 (not tested)
KS = 2016 SUHD (not tested)
KU = 2016 UHD (not working)
K = 2016 (not tested)
JS = 2015 SUHD (not tested)
JU = 2015 UHD (not working)
J = 2015 (not tested)
HU = 2014 UHD (not tested)
H = 2014 (working)
F = 2013 (not tested)
E = 2012 (not tested)
D = 2011 (not tested)
C = 2010 (not tested)
B = 2009 (not tested)
A = 2008 (not tested)

Changelog:
10/17/2017 : Initial upload
10/18/2017 : Added beautifullsoup as requirement, check at init if input sources on TV are available


Universal media player volume is broken
Universal media player volume is broken
#2

I was missing beautifulsoup4 in my python3 installation. I added it, but then I got the following error:

2017-10-18 20:49:43 ERROR (MainThread) [homeassistant.components.media_player] Error while setting up platform samsungtv
Traceback (most recent call last):
raise self._exception
TypeError: zip argument #1 must support iteration


#3

Thanks for the hint, I will add beautifulsoup4 as requirement to the code.

Could you check your log and see if your TV sends back more then one source (search for “GetSourceList”)? My TV sends back about 8 sources. Maybe you could provide that part of you log here. Your TV Model would also be interesting ( I have a Samsung LED TV (UE55H6200)).


#4

I have UE49KU6450S. I have added port (8001), host & mac address to conf.yaml

Error log:

2017-10-18 21:47:16 ERROR (MainThread) [homeassistant.components.media_player] Error while setting up platform samsungtv
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 164, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=self.hass.loop)
  File "/usr/lib/python3.4/asyncio/tasks.py", line 372, in wait_for
    return fut.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/homeassistant/.homeassistant/custom_components/media_player/samsungtv.py", line 76, in setup_platform
    add_devices([SamsungTVDevice(host, port, name, timeout, mac)])
  File "/home/homeassistant/.homeassistant/custom_components/media_player/samsungtv.py", line 109, in __init__
    self._sources = dict(zip(self._source_names, self._source_ids))
TypeError: zip argument #1 must support iteration

#5

Could you try the updated version above? You should also get a message on your TV asking for permission. Without permission, no communication.
The Port will be automatically changed to 7676, this is the port for the UPNP communication on Samsung TVs.


#6

No errors, no warnings, but it does not work and does not ask for a permission. It shows in the frontend that tv set is off.
Ports in my samsung are open
Starting Nmap 6.47 ( http://nmap.org ) at 2017-10-18 22:18 CEST
Nmap scan report for 192.168.0.248
Host is up (0.014s latency).
Not shown: 993 closed ports
PORT STATE SERVICE
7676/tcp open imqbrokerd
8000/tcp open http-alt
8001/tcp open vcom-tunnel
8002/tcp open teradataordbms
8080/tcp open http-proxy
9080/tcp open glrpc
9999/tcp open abyss
Nmap done: 1 IP address (1 host up) scanned in 0.47 seconds


#7

You should have some lines in you log like these:

2017-10-18 22:21:55 INFO (SyncWorker_18) [custom_components.media_player.samsungtv] Samsung TV sending:…
2017-10-18 22:21:55 INFO (SyncWorker_18) [custom_components.media_player.samsungtv] Samsung TV received: …

Could you check in these lines if you receive an answer from your TV?


#8

I deleted __pycache__ from custom_components/media_player folder and restarted hass.

2017-10-18 22:59:46 INFO (Thread-11) [custom_components.media_player.samsungtv] Samsung TV sending: POST /smp_17_ HTTP/1.0
HOST: 192.168.0.248:7676
CONTENT-TYPE: text/xml;charset="utf-8"
SOAPACTION: "urn:schemas-upnp-org:service:RenderingControl:1#GetVolume"
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:GetVolume xmlns:u="urn:schemas-upnp-org:service:RenderingControl:1"><InstanceID>0</InstanceID><Channel>Master</Channel></u:GetVolume></s:Body></s:Envelope>

2017-10-18 22:59:57 INFO (Thread-7) [custom_components.media_player.samsungtv] Samsung TV sending: POST /smp_17_ HTTP/1.0
HOST: 192.168.0.248:7676
CONTENT-TYPE: text/xml;charset="utf-8"
SOAPACTION: "urn:schemas-upnp-org:service:RenderingControl:1#GetVolume"
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:GetVolume xmlns:u="urn:schemas-upnp-org:service:RenderingControl:1"><InstanceID>0</InstanceID><Channel>Master</Channel></u:GetVolume></s:Body></s:Envelope>

2017-10-18 23:00:08 INFO (Thread-8) [custom_components.media_player.samsungtv] Samsung TV sending: POST /smp_17_ HTTP/1.0
HOST: 192.168.0.248:7676
CONTENT-TYPE: text/xml;charset="utf-8"
SOAPACTION: "urn:schemas-upnp-org:service:RenderingControl:1#GetVolume"
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:GetVolume xmlns:u="urn:schemas-upnp-org:service:RenderingControl:1"><InstanceID>0</InstanceID><Channel>Master</Channel></u:GetVolume></s:Body></s:Envelope>

#9

It seems that your TV is not responding to the SOAP requests. Does HASS discover your TV (when you have no configuration for the samsungtv component)?

Please check if your IP is listed in TV Menu (Network - Multimedia Device Settings).


#10

I will check this after the weekend.


#11

I have got the same : no error nor warnings. In my frontend I got my samsung tv written “off” I cannot turn it on.


#12

It’s not possible to turn the TV on (see first post). You have to turn it on and HASS has to detect your TV itself. If HASS detects the TV, then the component should also work.


#13

Same issue I turned it on but on my front end I don’t get an option to do anything.


#14

Did HASS detect the TV automatically or did you add it to your configuration? What model do you have?


#15

It detects it automatically my model is UE48JU6445.


#16

Could you download the dlnap.py from https://github.com/cherezov/dlnap and try following commands:

python dlnap.py --ip <your_tv_ip> --log=debug

and

python dlnap.py --ip <your_tv_ip> --mute
python dlnap.py --ip <your_tv_ip> --unmute

Tell me if you get a response from the first command and if your Tv reacts to the second and third command.


#17

No compatible devices found.
:frowning:

INFO:DlnapDevice:=> New DlnapDevice (ip = 192.168.0.248) initialization..
INFO:DlnapDevice:location: http://192.168.0.248:9119/screen_sharing
INFO:DlnapDevice:port: 9119
INFO:DlnapDevice:friendlyName: [TV] Samsung
INFO:DlnapDevice:control_url: None
INFO:DlnapDevice:rendering_control_url: None
INFO:DlnapDevice:=> Initialization completed
INFO:DlnapDevice:=> New DlnapDevice (ip = 192.168.0.248) initialization..
INFO:DlnapDevice:location: http://192.168.0.248:7676/rcr/
INFO:DlnapDevice:port: 7676
INFO:DlnapDevice:friendlyName: [TV] Samsung
INFO:DlnapDevice:control_url: None
INFO:DlnapDevice:rendering_control_url: None
INFO:DlnapDevice:=> Initialization completed
INFO:DlnapDevice:=> New DlnapDevice (ip = 192.168.0.248) initialization..
INFO:DlnapDevice:location: http://192.168.0.248:9119/screen_sharing
INFO:DlnapDevice:port: 9119
INFO:DlnapDevice:friendlyName: [TV] Samsung
INFO:DlnapDevice:control_url: None
INFO:DlnapDevice:rendering_control_url: None
INFO:DlnapDevice:=> Initialization completed
INFO:DlnapDevice:=> New DlnapDevice (ip = 192.168.0.248) initialization..
INFO:DlnapDevice:location: http://192.168.0.248:9197/dmr
INFO:DlnapDevice:port: 9197
INFO:DlnapDevice:friendlyName: [TV] Samsung
INFO:DlnapDevice:control_url: None
INFO:DlnapDevice:rendering_control_url: None
INFO:DlnapDevice:=> Initialization completed
INFO:DlnapDevice:=> New DlnapDevice (ip = 192.168.0.248) initialization..
INFO:DlnapDevice:location: http://192.168.0.248:7678/nservice/
INFO:DlnapDevice:port: 7678
INFO:DlnapDevice:friendlyName: [TV] Samsung
INFO:DlnapDevice:control_url: None
INFO:DlnapDevice:rendering_control_url: None
INFO:DlnapDevice:=> Initialization completed
INFO:DlnapDevice:=> New DlnapDevice (ip = 192.168.0.248) initialization..
INFO:DlnapDevice:location: http://192.168.0.248:7678/nservice/
INFO:DlnapDevice:port: 7678
INFO:DlnapDevice:friendlyName: [TV] Samsung
INFO:DlnapDevice:control_url: None
INFO:DlnapDevice:rendering_control_url: None
INFO:DlnapDevice:=> Initialization completed
INFO:DlnapDevice:=> New DlnapDevice (ip = 192.168.0.248) initialization..
INFO:DlnapDevice:location: http://192.168.0.248:9197/dmr
INFO:DlnapDevice:port: 9197
INFO:DlnapDevice:friendlyName: [TV] Samsung
INFO:DlnapDevice:control_url: None
INFO:DlnapDevice:rendering_control_url: None
INFO:DlnapDevice:=> Initialization completed
INFO:DlnapDevice:=> New DlnapDevice (ip = 192.168.0.248) initialization..
INFO:DlnapDevice:location: http://192.168.0.248:7676/rcr/
INFO:DlnapDevice:port: 7676
INFO:DlnapDevice:friendlyName: [TV] Samsung
INFO:DlnapDevice:control_url: None
INFO:DlnapDevice:rendering_control_url: None
INFO:DlnapDevice:=> Initialization completed
INFO:DlnapDevice:=> New DlnapDevice (ip = 192.168.0.248) initialization..
INFO:DlnapDevice:location: http://192.168.0.248:9119/screen_sharing
INFO:DlnapDevice:port: 9119
INFO:DlnapDevice:friendlyName: [TV] Samsung
INFO:DlnapDevice:control_url: None
INFO:DlnapDevice:rendering_control_url: None
INFO:DlnapDevice:=> Initialization completed
INFO:DlnapDevice:=> New DlnapDevice (ip = 192.168.0.248) initialization..
INFO:DlnapDevice:location: http://192.168.0.248:9197/dmr
INFO:DlnapDevice:port: 9197
INFO:DlnapDevice:friendlyName: [TV] Samsung
INFO:DlnapDevice:control_url: None
INFO:DlnapDevice:rendering_control_url: None
INFO:DlnapDevice:=> Initialization completed
INFO:DlnapDevice:=> New DlnapDevice (ip = 192.168.0.248) initialization..
INFO:DlnapDevice:location: http://192.168.0.248:9119/screen_sharing
INFO:DlnapDevice:port: 9119
INFO:DlnapDevice:friendlyName: [TV] Samsung
INFO:DlnapDevice:control_url: None
INFO:DlnapDevice:rendering_control_url: None
INFO:DlnapDevice:=> Initialization completed
INFO:DlnapDevice:=> New DlnapDevice (ip = 192.168.0.248) initialization..
INFO:DlnapDevice:location: http://192.168.0.248:7678/nservice/
INFO:DlnapDevice:port: 7678
INFO:DlnapDevice:friendlyName: [TV] Samsung
INFO:DlnapDevice:control_url: None
INFO:DlnapDevice:rendering_control_url: None
INFO:DlnapDevice:=> Initialization completed
INFO:DlnapDevice:=> New DlnapDevice (ip = 192.168.0.248) initialization..
INFO:DlnapDevice:location: http://192.168.0.248:9197/dmr
INFO:DlnapDevice:port: 9197
INFO:DlnapDevice:friendlyName: [TV] Samsung
INFO:DlnapDevice:control_url: None
INFO:DlnapDevice:rendering_control_url: None
INFO:DlnapDevice:=> Initialization completed
INFO:DlnapDevice:=> New DlnapDevice (ip = 192.168.0.248) initialization..
INFO:DlnapDevice:location: http://192.168.0.248:7676/rcr/
INFO:DlnapDevice:port: 7676
INFO:DlnapDevice:friendlyName: [TV] Samsung
INFO:DlnapDevice:control_url: None
INFO:DlnapDevice:rendering_control_url: None
INFO:DlnapDevice:=> Initialization completed
INFO:DlnapDevice:=> New DlnapDevice (ip = 192.168.0.248) initialization..
INFO:DlnapDevice:location: http://192.168.0.248:7678/nservice/
INFO:DlnapDevice:port: 7678
INFO:DlnapDevice:friendlyName: [TV] Samsung
INFO:DlnapDevice:control_url: None
INFO:DlnapDevice:rendering_control_url: None
INFO:DlnapDevice:=> Initialization completed
INFO:DlnapDevice:=> New DlnapDevice (ip = 192.168.0.248) initialization..
INFO:DlnapDevice:location: http://192.168.0.248:9197/dmr
INFO:DlnapDevice:port: 9197
INFO:DlnapDevice:friendlyName: [TV] Samsung
INFO:DlnapDevice:control_url: None
INFO:DlnapDevice:rendering_control_url: None
INFO:DlnapDevice:=> Initialization completed
INFO:DlnapDevice:=> New DlnapDevice (ip = 192.168.0.248) initialization..
INFO:DlnapDevice:location: http://192.168.0.248:9197/dmr
INFO:DlnapDevice:port: 9197
INFO:DlnapDevice:friendlyName: [TV] Samsung
INFO:DlnapDevice:control_url: None
INFO:DlnapDevice:rendering_control_url: None
INFO:DlnapDevice:=> Initialization completed
INFO:DlnapDevice:=> New DlnapDevice (ip = 192.168.0.248) initialization..
INFO:DlnapDevice:location: http://192.168.0.248:7676/rcr/
INFO:DlnapDevice:port: 7676
INFO:DlnapDevice:friendlyName: [TV] Samsung
INFO:DlnapDevice:control_url: None
INFO:DlnapDevice:rendering_control_url: None
INFO:DlnapDevice:=> Initialization completed
INFO:DlnapDevice:=> New DlnapDevice (ip = 192.168.0.248) initialization..
INFO:DlnapDevice:location: http://192.168.0.248:9197/dmr
INFO:DlnapDevice:port: 9197
INFO:DlnapDevice:friendlyName: [TV] Samsung
INFO:DlnapDevice:control_url: None
INFO:DlnapDevice:rendering_control_url: None
INFO:DlnapDevice:=> Initialization completed
INFO:DlnapDevice:=> New DlnapDevice (ip = 192.168.0.248) initialization..
INFO:DlnapDevice:location: http://192.168.0.248:9080
INFO:DlnapDevice:port: 9080
INFO:DlnapDevice:friendlyName: Unknown
INFO:DlnapDevice:control_url: None
INFO:DlnapDevice:rendering_control_url: None
INFO:DlnapDevice:=> Initialization completed
INFO:DlnapDevice:=> New DlnapDevice (ip = 192.168.0.248) initialization..
INFO:DlnapDevice:location: http://192.168.0.248:9080
INFO:DlnapDevice:port: 9080
INFO:DlnapDevice:friendlyName: Unknown
INFO:DlnapDevice:control_url: None
INFO:DlnapDevice:rendering_control_url: None
INFO:DlnapDevice:=> Initialization completed
INFO:DlnapDevice:=> New DlnapDevice (ip = 192.168.0.248) initialization..
INFO:DlnapDevice:location: http://192.168.0.248:9080
INFO:DlnapDevice:port: 9080
INFO:DlnapDevice:friendlyName: Unknown
INFO:DlnapDevice:control_url: None
INFO:DlnapDevice:rendering_control_url: None
INFO:DlnapDevice:=> Initialization completed
INFO:DlnapDevice:=> New DlnapDevice (ip = 192.168.0.248) initialization..
INFO:DlnapDevice:location: http://192.168.0.248:9080
INFO:DlnapDevice:port: 9080
INFO:DlnapDevice:friendlyName: Unknown
INFO:DlnapDevice:control_url: None
INFO:DlnapDevice:rendering_control_url: None
INFO:DlnapDevice:=> Initialization completed

#18

Sorry, but without UPNP it will not work. I have added a “Device supported” list into the first post.
Thanks for your efforts.


#19

I get the same No compatible devices found as @ferges


#20

Get error when i mute:

INFO:DlnapDevice:=> New DlnapDevice (ip = 192.168.10.159) initialization…
INFO:DlnapDevice:location: http://192.168.10.159:7676/smp_25_
INFO:DlnapDevice:port: 7676
DEBUG:DlnapDevice:description xml: {u’root’: [{u’device’: [{u’manufacturerURL’: [u’http://www.samsung.com/sec’], u’serviceList’: [{u’service’: [{u’controlURL’: [u’/smp_27_’], u’serviceType’: [u’urn:dial-multiscreen-org:service:dial:1’], u’serviceId’: [u’urn:dial-multiscreen-org:serviceId:dial’], u’eventSubURL’: [u’/smp_28_’], u’SCPDURL’: [u’/smp_26_’]}]}], u’modelName’: [u’UE50H6200’], u’serialNumber’: [u’20090804RCR’], u’sec:Capabilities’: [{u’sec:Capability’: []}], u’sec:deviceID’: [u’CPCPH5RIUFRPY’], u’sec:ProductCap’: [u’Resolution:1280X720,Y2014’], u’modelNumber’: [u’1.0’], u’deviceType’: [u’urn:dial-multiscreen-org:device:dialreceiver:1’], u’friendlyName’: [u’[TV]Samsung LED50’], u’modelURL’: [u’http://www.samsung.com/sec’], u’modelDescription’: [u’Samsung TV NS’], u’UDN’: [u’uuid:07bfa482-0082-1000-b3aa-bc14851ae88b’], u’manufacturer’: [u’Samsung Electronics’]}], u’specVersion’: [{u’major’: [u’1’], u’minor’: [u’0’]}]}]}
INFO:DlnapDevice:friendlyName: [TV]Samsung LED50
INFO:DlnapDevice:control_url: None
INFO:DlnapDevice:rendering_control_url: None
INFO:DlnapDevice:=> Initialization completed
INFO:DlnapDevice:=> New DlnapDevice (ip = 192.168.10.159) initialization…
INFO:DlnapDevice:location: http://192.168.10.159:7676/smp_25_
INFO:DlnapDevice:port: 7676
DEBUG:DlnapDevice:description xml: {u’root’: [{u’device’: [{u’manufacturerURL’: [u’http://www.samsung.com/sec’], u’serviceList’: [{u’service’: [{u’controlURL’: [u’/smp_27_’], u’serviceType’: [u’urn:dial-multiscreen-org:service:dial:1’], u’serviceId’: [u’urn:dial-multiscreen-org:serviceId:dial’], u’eventSubURL’: [u’/smp_28_’], u’SCPDURL’: [u’/smp_26_’]}]}], u’modelName’: [u’UE50H6200’], u’serialNumber’: [u’20090804RCR’], u’sec:Capabilities’: [{u’sec:Capability’: []}], u’sec:deviceID’: [u’CPCPH5RIUFRPY’], u’sec:ProductCap’: [u’Resolution:1280X720,Y2014’], u’modelNumber’: [u’1.0’], u’deviceType’: [u’urn:dial-multiscreen-org:device:dialreceiver:1’], u’friendlyName’: [u’[TV]Samsung LED50’], u’modelURL’: [u’http://www.samsung.com/sec’], u’modelDescription’: [u’Samsung TV NS’], u’UDN’: [u’uuid:07bfa482-0082-1000-b3aa-bc14851ae88b’], u’manufacturer’: [u’Samsung Electronics’]}], u’specVersion’: [{u’major’: [u’1’], u’minor’: [u’0’]}]}]}
INFO:DlnapDevice:friendlyName: [TV]Samsung LED50
INFO:DlnapDevice:control_url: None
INFO:DlnapDevice:rendering_control_url: None
INFO:DlnapDevice:=> Initialization completed
INFO:DlnapDevice:=> New DlnapDevice (ip = 192.168.10.159) initialization…
INFO:DlnapDevice:location: http://192.168.10.159:7676/smp_25_
INFO:DlnapDevice:port: 7676
DEBUG:DlnapDevice:description xml: {u’root’: [{u’device’: [{u’manufacturerURL’: [u’http://www.samsung.com/sec’], u’serviceList’: [{u’service’: [{u’controlURL’: [u’/smp_27_’], u’serviceType’: [u’urn:dial-multiscreen-org:service:dial:1’], u’serviceId’: [u’urn:dial-multiscreen-org:serviceId:dial’], u’eventSubURL’: [u’/smp_28_’], u’SCPDURL’: [u’/smp_26_’]}]}], u’modelName’: [u’UE50H6200’], u’serialNumber’: [u’20090804RCR’], u’sec:Capabilities’: [{u’sec:Capability’: []}], u’sec:deviceID’: [u’CPCPH5RIUFRPY’], u’sec:ProductCap’: [u’Resolution:1280X720,Y2014’], u’modelNumber’: [u’1.0’], u’deviceType’: [u’urn:dial-multiscreen-org:device:dialreceiver:1’], u’friendlyName’: [u’[TV]Samsung LED50’], u’modelURL’: [u’http://www.samsung.com/sec’], u’modelDescription’: [u’Samsung TV NS’], u’UDN’: [u’uuid:07bfa482-0082-1000-b3aa-bc14851ae88b’], u’manufacturer’: [u’Samsung Electronics’]}], u’specVersion’: [{u’major’: [u’1’], u’minor’: [u’0’]}]}]}
INFO:DlnapDevice:friendlyName: [TV]Samsung LED50
INFO:DlnapDevice:control_url: None
INFO:DlnapDevice:rendering_control_url: None
INFO:DlnapDevice:=> Initialization completed
INFO:DlnapDevice:=> New DlnapDevice (ip = 192.168.10.159) initialization…
INFO:DlnapDevice:location: http://192.168.10.159:7676/smp_25_
INFO:DlnapDevice:port: 7676
DEBUG:DlnapDevice:description xml: {u’root’: [{u’device’: [{u’manufacturerURL’: [u’http://www.samsung.com/sec’], u’serviceList’: [{u’service’: [{u’controlURL’: [u’/smp_27_’], u’serviceType’: [u’urn:dial-multiscreen-org:service:dial:1’], u’serviceId’: [u’urn:dial-multiscreen-org:serviceId:dial’], u’eventSubURL’: [u’/smp_28_’], u’SCPDURL’: [u’/smp_26_’]}]}], u’modelName’: [u’UE50H6200’], u’serialNumber’: [u’20090804RCR’], u’sec:Capabilities’: [{u’sec:Capability’: []}], u’sec:deviceID’: [u’CPCPH5RIUFRPY’], u’sec:ProductCap’: [u’Resolution:1280X720,Y2014’], u’modelNumber’: [u’1.0’], u’deviceType’: [u’urn:dial-multiscreen-org:device:dialreceiver:1’], u’friendlyName’: [u’[TV]Samsung LED50’], u’modelURL’: [u’http://www.samsung.com/sec’], u’modelDescription’: [u’Samsung TV NS’], u’UDN’: [u’uuid:07bfa482-0082-1000-b3aa-bc14851ae88b’], u’manufacturer’: [u’Samsung Electronics’]}], u’specVersion’: [{u’major’: [u’1’], u’minor’: [u’0’]}]}]}
INFO:DlnapDevice:friendlyName: [TV]Samsung LED50
INFO:DlnapDevice:control_url: None
INFO:DlnapDevice:rendering_control_url: None
INFO:DlnapDevice:=> Initialization completed
INFO:DlnapDevice:=> New DlnapDevice (ip = 192.168.10.159) initialization…
INFO:DlnapDevice:location: http://192.168.10.159:7676/smp_15_
INFO:DlnapDevice:port: 7676
DEBUG:DlnapDevice:description xml: {u’root’: [{u’device’: [{u’manufacturerURL’: [u’http://www.samsung.com/sec’], u’serviceList’: [{u’service’: [{u’controlURL’: [u’/smp_17_’], u’serviceType’: [u’urn:schemas-upnp-org:service:RenderingControl:1’], u’serviceId’: [u’urn:upnp-org:serviceId:RenderingControl’], u’eventSubURL’: [u’/smp_18_’], u’SCPDURL’: [u’/smp_16_’]}, {u’controlURL’: [u’/smp_20_’], u’serviceType’: [u’urn:schemas-upnp-org:service:ConnectionManager:1’], u’serviceId’: [u’urn:upnp-org:serviceId:ConnectionManager’], u’eventSubURL’: [u’/smp_21_’], u’SCPDURL’: [u’/smp_19_’]}, {u’controlURL’: [u’/smp_23_’], u’serviceType’: [u’urn:schemas-upnp-org:service:AVTransport:1’], u’serviceId’: [u’urn:upnp-org:serviceId:AVTransport’], u’eventSubURL’: [u’/smp_24_’], u’SCPDURL’: [u’/smp_22_’]}]}], u’modelName’: [u’UE50H6200’], u’iconList’: [{u’icon’: [{u’mimetype’: [u’image/jpeg’], u’width’: [u’48’], u’depth’: [u’24’], u’url’: [u’/dmr/icon_SML.jpg’], u’height’: [u’48’]}, {u’mimetype’: [u’image/jpeg’], u’width’: [u’120’], u’depth’: [u’24’], u’url’: [u’/dmr/icon_LRG.jpg’], u’height’: [u’120’]}, {u’mimetype’: [u’image/png’], u’width’: [u’48’], u’depth’: [u’24’], u’url’: [u’/dmr/icon_SML.png’], u’height’: [u’48’]}, {u’mimetype’: [u’image/png’], u’width’: [u’120’], u’depth’: [u’24’], u’url’: [u’/dmr/icon_LRG.png’], u’height’: [u’120’]}]}], u’dlna:X_DLNADOC’: [u’DMR-1.50’], u’df:X_deviceCategory’: [u’Display.TV.LCD Multimedia.DMR’], u’serialNumber’: [u’20110517DMR’], u’sec:deviceID’: [u’CPCPH5RIUFRPY’], u’pnpx:X_compatibleId’: [u’MS_DigitalMediaDeviceClass_DMR_V001’], u’sec:ProductCap’: [u’Y2014,WebURIPlayable,SeekTRACK_NR,NavigateInPause,ScreenMirroringP2PMAC=92:f1:aa:be:de:f8’], u’modelNumber’: [u’AllShare1.0’], u’deviceType’: [u’urn:schemas-upnp-org:device:MediaRenderer:1’], u’friendlyName’: [u’[TV]Samsung LED50’], u’modelURL’: [u’http://www.samsung.com/sec’], u’modelDescription’: [u’Samsung TV DMR’], u’UDN’: [u’uuid:0aba9502-00b4-1000-9b56-bc14851ae88b’], u’pnpx:X_hardwareId’: [u’VEN_0105&amp;DEV_VD0001’], u’manufacturer’: [u’Samsung Electronics’]}], u’specVersion’: [{u’major’: [u’1’], u’minor’: [u’0’]}]}]}
INFO:DlnapDevice:friendlyName: [TV]Samsung LED50
INFO:DlnapDevice:control_url: /smp_23_
INFO:DlnapDevice:rendering_control_url: /smp_17_
INFO:DlnapDevice:=> Initialization completed
Discovered devices:
[a] [TV]Samsung LED50 @ 192.168.10.159

Mute:

Olas-Air:~ djungelola$ python /Users/djungelola/Downloads/dlnap-master/dlnap/dlnap.py --ip 192.168.10.159 --mute
[TV]Samsung LED50 @ 192.168.10.159
ERROR:root:Action Failed