samsungctl icon indicating copy to clipboard operation
samsungctl copied to clipboard

Any chance to have X_GetTVSlideShow or media information

Open matthieut59 opened this issue 6 years ago • 52 comments

Hello,

I tried to understand how getting vo;lume via upnp is working on your lib, but.... No cahcne for me to understand it :/

Any chance you implement a way to get media information currently playing ?

Thks,

MAtt

PS: Idea is again to know if my TV Frame is currently in Frame mode or TV mode...

matthieut59 avatar Feb 01 '19 09:02 matthieut59

OK so that is supported. not from the command line. what I am going to do is I am going to create a list of what can be done. all of these advanced features can only be done from a python script.

I am going to be making a REST API for this thing. so if other people want to make use of it from software that does not run python they will be able to.

give me some time to put together a list of all of the available features.

kdschlosser avatar Feb 01 '19 18:02 kdschlosser

I d also take an example of how to use any of this feature via python script :) Getting access to all those upnp feature would make this API what everyone dreamt about...

matthieut59 avatar Feb 01 '19 18:02 matthieut59

ok this is going to give you the layout...

if you look at the layout you will see a spit in it called "Access Point" you will replace the UPNPObject at the beginning of the access point with "remote"

example:

UPNPObject.MainTVAgent2.GetCurrentConnectionInfo

will become

remote.MainTVAgent2.GetCurrentConnectionInfo

that is how you will access the UPNP function

all of the information about what needs to be passed to the function is listed..

import samsungctl

# new config style. will make file if it does not exist. if it does it will use it
# you no longer need to have 2 different config code types one for first time use 
# and one for every time there after. it is now all done in a single statement.
# it is a lot nicer this way I think.

config = samsungctl.Config.load('path/file.name')('name='samsungtv1', host='192.168.1.1')


with samsungctl.Remote(config) as remote:
    print(remote)

the above code is going to dump a massive amount of information to your screen. so you will either want to direct the information to a file or you are going to want to increase the scroll back buffer on your shell or console window to 5000 lines.. and no i am not kidding about the 5000 lines.

I have created wrappers for most of these items. they are pretty easy to locate because the names are almost the same. you do have a choice to use the wrapper i made. or you can access the UPNP functions directly. NOTE: if a function has a parameter called InstanceId you will ALWAYS pass a 0 for this parameter

an example would be

if you have upnp functions named GetVolume SetVolume

you are going to have a simple property called volume

this will call the GetVolume for you

print(remote.volume)

and this will call the SetVolume for you

remote.volume = 50

if you want to get a complete list of all of the convenience methods/properties.

from samsungctl.upnp.UPNP_Device.upnp_class import UPNPObject

# config assumed

with samsungctl.Remote(config) as remote:
    for item in dir(remote):
        if item in UPNPObject.__dict__:
            if isinstance(UPNPObject.__dict__[item], property):
                print(item, ': property')
            else:
                print(item, ': method')

kdschlosser avatar Feb 01 '19 19:02 kdschlosser

i did want to note.. if you want to only print out information for a specific UPNP function. so you get the "Access Point" from the long printout. do the name swap deal. an print out that function..

# config assumed

with samsungctl.Remote(config) as remote:
    print(remote.MainTVAgent2.GetCurrentConnectionInfo)

UPDATE...

The name you need to swap out may not be UPNPObject. it might be RemoteWrapper. basically anything before the first "." you need to replace with "remote"

kdschlosser avatar Feb 01 '19 19:02 kdschlosser

Just waouh, it works indeed perfectly!

matthieut59 avatar Feb 01 '19 21:02 matthieut59

I explorered all methods, and none gives me a hint on whether I m in frame mode or TV mode :/ A lot of method are in fact not really implemented... so waiting for firmware upgrade... looking at https://github.com/openhab/openhab2-addons/blob/master/addons/binding/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/service/MainTVServerService.java

Some stuff are not available at all on my device :/

matthieut59 avatar Feb 01 '19 21:02 matthieut59

I would imagine that this will return a valid slide show if the frame mode is active

remote.RenderingControl.X_GetTVSlideShow(0)

kdschlosser avatar Feb 01 '19 23:02 kdschlosser

that link only shows code for 2 or 3 UPNP functions it doesn't handle all of them

kdschlosser avatar Feb 01 '19 23:02 kdschlosser

unfortunatly in frame moe or tv mode, I got always "[False, 0, 0]" on this method :( Strangelly the smarthing application on my smartphone is able to get that state, so there should be a way

matthieut59 avatar Feb 02 '19 07:02 matthieut59

if you run the code below. and post the output to me I will have a better idea of what we can get from your TV

# config assumed

with samsungctl.Remote(config) as remote:
    print(remote.as_dict)

kdschlosser avatar Feb 02 '19 08:02 kdschlosser

also.. if you follow these directions to enable logging on the TV.. then use the smartthings application. whatever is happening is going to show in the logs on the TV

https://developer.samsung.com/tv/develop/extension-libraries/smart-view-sdk/receiver-apps/debugging

kdschlosser avatar Feb 02 '19 08:02 kdschlosser

Here is the remote.as_dict output (same if in frame mode or not ) :

{'services': [{'name': 'RenderingControl', 'methods': [{'name': 'ListPresets', 'params': [{'name': 'InstanceID', 'default_value': None, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}], 'ret_vals': [{'name': 'CurrentPresetNameList', 'default_value': 'FactoryDefaults', 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': None}]}, {'name': 'SelectPreset', 'params': [{'name': 'InstanceID', 'default_value': None, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}, {'name': 'PresetName', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'allowed_values': ['FactoryDefaults']}], 'ret_vals': []}, {'name': 'GetMute', 'params': [{'name': 'InstanceID', 'default_value': None, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}, {'name': 'Channel', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'allowed_values': ['Master']}], 'ret_vals': [{'name': 'CurrentMute', 'default_value': None, 'data_type': (<class 'bool'>,), 'returned_values': [False, True]}]}, {'name': 'SetMute', 'params': [{'name': 'InstanceID', 'default_value': None, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}, {'name': 'Channel', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'allowed_values': ['Master']}, {'name': 'DesiredMute', 'default_value': None, 'data_type': (<class 'bool'>,), 'allowed_values': [False, True]}], 'ret_vals': []}, {'name': 'GetVolume', 'params': [{'name': 'InstanceID', 'default_value': None, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}, {'name': 'Channel', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'allowed_values': ['Master']}], 'ret_vals': [{'name': 'CurrentVolume', 'default_value': None, 'data_type': (<class 'int'>,), 'min': 0, 'max': 100, 'step': 1}]}, {'name': 'SetVolume', 'params': [{'name': 'InstanceID', 'default_value': None, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}, {'name': 'Channel', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'allowed_values': ['Master']}, {'name': 'DesiredVolume', 'default_value': None, 'data_type': (<class 'int'>,), 'min': 0, 'max': 100, 'step': 1}], 'ret_vals': []}, {'name': 'X_GetAspectRatio', 'params': [{'name': 'InstanceID', 'default_value': None, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}], 'ret_vals': [{'name': 'AspectRatio', 'default_value': 'Default', 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': ['Default', 'FitScreen']}]}, {'name': 'X_SetAspectRatio', 'params': [{'name': 'InstanceID', 'default_value': None, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}, {'name': 'AspectRatio', 'default_value': 'Default', 'data_type': (<class 'str'>, <class 'bytes'>), 'allowed_values': ['Default', 'FitScreen']}], 'ret_vals': []}, {'name': 'X_Move360View', 'params': [{'name': 'InstanceID', 'default_value': None, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}, {'name': 'LatitudeOffset', 'default_value': 0.0, 'data_type': (<class 'float'>,), 'min': None, 'max': None, 'step': None}, {'name': 'LongitudeOffset', 'default_value': 0.0, 'data_type': (<class 'float'>,), 'min': None, 'max': None, 'step': None}], 'ret_vals': []}, {'name': 'X_Zoom360View', 'params': [{'name': 'InstanceID', 'default_value': None, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}, {'name': 'ScaleFactorOffset', 'default_value': 1.0, 'data_type': (<class 'float'>,), 'min': None, 'max': None, 'step': None}], 'ret_vals': []}, {'name': 'X_Origin360View', 'params': [{'name': 'InstanceID', 'default_value': None, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}], 'ret_vals': []}, {'name': 'X_ControlCaption', 'params': [{'name': 'InstanceID', 'default_value': None, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}, {'name': 'Operation', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'allowed_values': ['Enable', 'Disable']}, {'name': 'Name', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'allowed_values': None}, {'name': 'ResourceURI', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'allowed_values': None}, {'name': 'CaptionURI', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'allowed_values': None}, {'name': 'CaptionType', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'allowed_values': None}, {'name': 'Language', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'allowed_values': None}, {'name': 'Encoding', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'allowed_values': None}], 'ret_vals': []}, {'name': 'X_GetCaptionState', 'params': [{'name': 'InstanceID', 'default_value': None, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}], 'ret_vals': [{'name': 'Captions', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': None}, {'name': 'EnabledCaptions', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': None}]}, {'name': 'X_GetServiceCapabilities', 'params': [{'name': 'InstanceID', 'default_value': None, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}], 'ret_vals': [{'name': 'ServiceCapabilities', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': None}]}, {'name': 'X_SetZoom', 'params': [{'name': 'InstanceID', 'default_value': None, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}, {'name': 'x', 'default_value': None, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}, {'name': 'y', 'default_value': None, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}, {'name': 'w', 'default_value': None, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}, {'name': 'h', 'default_value': None, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}], 'ret_vals': []}, {'name': 'X_GetTVSlideShow', 'params': [{'name': 'InstanceID', 'default_value': None, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}], 'ret_vals': [{'name': 'CurrentShowState', 'default_value': None, 'data_type': (<class 'bool'>,), 'returned_values': [False, True]}, {'name': 'CurrentThemeId', 'default_value': None, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}, {'name': 'TotalThemeNumber', 'default_value': None, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}]}, {'name': 'X_SetTVSlideShow', 'params': [{'name': 'InstanceID', 'default_value': None, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}, {'name': 'CurrentShowState', 'default_value': None, 'data_type': (<class 'bool'>,), 'allowed_values': [False, True]}, {'name': 'CurrentShowTheme', 'default_value': None, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}], 'ret_vals': []}], 'icons': [{'name': 'icon_SML_jpg', 'mime_type': None, 'width': 48, 'height': 48, 'depth': 24, 'url': 'http://192.168.1.7:9197/icon_SML.jpg'}, {'name': 'icon_LRG_jpg', 'mime_type': None, 'width': 120, 'height': 120, 'depth': 24, 'url': 'http://192.168.1.7:9197/icon_LRG.jpg'}, {'name': 'icon_SML_png', 'mime_type': None, 'width': 48, 'height': 48, 'depth': 24, 'url': 'http://192.168.1.7:9197/icon_SML.png'}, {'name': 'icon_LRG_png', 'mime_type': None, 'width': 120, 'height': 120, 'depth': 24, 'url': 'http://192.168.1.7:9197/icon_LRG.png'}], 'deviceType': 'urn:schemas-upnp-org:device:MediaRenderer:1', 'X_compatibleId': 'MS_DigitalMediaDeviceClass_DMR_V001', 'X_deviceCategory': 'Display.TV.LCD Multimedia.DMR', 'X_DLNADOC': 'DMR-1.50', 'friendlyName': '[TV] Samsung Frame Series (43)', 'manufacturer': 'Samsung Electronics', 'manufacturerURL': 'http://www.samsung.com/sec', 'modelDescription': 'Samsung TV DMR', 'modelName': 'UE43LS03N', 'modelNumber': 'AllShare1.0', 'modelURL': 'http://www.samsung.com/sec', 'serialNumber': '0C2A3SCKB01047A', 'UDN': 'uuid:a276d50f-30a1-4a11-8b0f-953f21b240ef', 'ProductCap': 'Tizen,Y2018,WebURIPlayable,NavigateInPause,ScreenMirroringP2PMAC=66:1c:ae:4a:9c:e2,UHD_SCREEN,SerialNumber=0C2A3SCKB01047A,vdProductType=TV,OCF=1', 'X_hardwareId': 'VEN_0105&DEV_VD0001'}, {'name': 'ConnectionManager', 'methods': [{'name': 'GetCurrentConnectionInfo', 'params': [{'name': 'ConnectionID', 'default_value': 0, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}], 'ret_vals': [{'name': 'RcsID', 'default_value': 0, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}, {'name': 'AVTransportID', 'default_value': 0, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}, {'name': 'ProtocolInfo', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': None}, {'name': 'PeerConnectionManager', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': None}, {'name': 'PeerConnectionID', 'default_value': 0, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}, {'name': 'Direction', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': ['Input', 'Output']}, {'name': 'Status', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': ['OK', 'ContentFormatMismatch', 'InsufficientBandwidth', 'UnreliableChannel', 'Unknown']}]}, {'name': 'GetProtocolInfo', 'params': [], 'ret_vals': [{'name': 'Source', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': None}, {'name': 'Sink', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': None}]}, {'name': 'GetCurrentConnectionIDs', 'params': [], 'ret_vals': [{'name': 'ConnectionIDs', 'default_value': '0', 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': None}]}, {'name': 'PrepareForConnection', 'params': [{'name': 'RemoteProtocolInfo', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'allowed_values': None}, {'name': 'PeerConnectionManager', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'allowed_values': None}, {'name': 'PeerConnectionID', 'default_value': 0, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}, {'name': 'Direction', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'allowed_values': ['Input', 'Output']}], 'ret_vals': [{'name': 'ConnectionID', 'default_value': 0, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}, {'name': 'AVTransportID', 'default_value': 0, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}, {'name': 'RcsID', 'default_value': 0, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}]}, {'name': 'ConnectionComplete', 'params': [{'name': 'ConnectionID', 'default_value': 0, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}], 'ret_vals': []}], 'icons': [{'name': 'icon_SML_jpg', 'mime_type': None, 'width': 48, 'height': 48, 'depth': 24, 'url': 'http://192.168.1.7:9197/icon_SML.jpg'}, {'name': 'icon_LRG_jpg', 'mime_type': None, 'width': 120, 'height': 120, 'depth': 24, 'url': 'http://192.168.1.7:9197/icon_LRG.jpg'}, {'name': 'icon_SML_png', 'mime_type': None, 'width': 48, 'height': 48, 'depth': 24, 'url': 'http://192.168.1.7:9197/icon_SML.png'}, {'name': 'icon_LRG_png', 'mime_type': None, 'width': 120, 'height': 120, 'depth': 24, 'url': 'http://192.168.1.7:9197/icon_LRG.png'}], 'deviceType': 'urn:schemas-upnp-org:device:MediaRenderer:1', 'X_compatibleId': 'MS_DigitalMediaDeviceClass_DMR_V001', 'X_deviceCategory': 'Display.TV.LCD Multimedia.DMR', 'X_DLNADOC': 'DMR-1.50', 'friendlyName': '[TV] Samsung Frame Series (43)', 'manufacturer': 'Samsung Electronics', 'manufacturerURL': 'http://www.samsung.com/sec', 'modelDescription': 'Samsung TV DMR', 'modelName': 'UE43LS03N', 'modelNumber': 'AllShare1.0', 'modelURL': 'http://www.samsung.com/sec', 'serialNumber': '0C2A3SCKB01047A', 'UDN': 'uuid:a276d50f-30a1-4a11-8b0f-953f21b240ef', 'ProductCap': 'Tizen,Y2018,WebURIPlayable,NavigateInPause,ScreenMirroringP2PMAC=66:1c:ae:4a:9c:e2,UHD_SCREEN,SerialNumber=0C2A3SCKB01047A,vdProductType=TV,OCF=1', 'X_hardwareId': 'VEN_0105&DEV_VD0001'}, {'name': 'AVTransport', 'methods': [{'name': 'Play', 'params': [{'name': 'InstanceID', 'default_value': None, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}, {'name': 'Speed', 'default_value': '1', 'data_type': (<class 'str'>, <class 'bytes'>), 'allowed_values': None}], 'ret_vals': []}, {'name': 'Stop', 'params': [{'name': 'InstanceID', 'default_value': None, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}], 'ret_vals': []}, {'name': 'Next', 'params': [{'name': 'InstanceID', 'default_value': None, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}], 'ret_vals': []}, {'name': 'Previous', 'params': [{'name': 'InstanceID', 'default_value': None, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}], 'ret_vals': []}, {'name': 'SetPlayMode', 'params': [{'name': 'InstanceID', 'default_value': None, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}, {'name': 'NewPlayMode', 'default_value': 'NORMAL', 'data_type': (<class 'str'>, <class 'bytes'>), 'allowed_values': ['NORMAL']}], 'ret_vals': []}, {'name': 'GetMediaInfo', 'params': [{'name': 'InstanceID', 'default_value': None, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}], 'ret_vals': [{'name': 'NrTracks', 'default_value': 0, 'data_type': (<class 'int'>,), 'min': 0, 'max': 4294967295, 'step': None}, {'name': 'MediaDuration', 'default_value': '00:00:00', 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': None}, {'name': 'CurrentURI', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': None}, {'name': 'CurrentURIMetaData', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': None}, {'name': 'NextURI', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': None}, {'name': 'NextURIMetaData', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': None}, {'name': 'PlayMedium', 'default_value': 'NONE', 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': ['NONE', 'NETWORK']}, {'name': 'RecordMedium', 'default_value': 'NOT_IMPLEMENTED', 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': ['NOT_IMPLEMENTED']}, {'name': 'WriteStatus', 'default_value': 'NOT_IMPLEMENTED', 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': ['NOT_IMPLEMENTED']}]}, {'name': 'GetDeviceCapabilities', 'params': [{'name': 'InstanceID', 'default_value': None, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}], 'ret_vals': [{'name': 'PlayMedia', 'default_value': 'NETWORK', 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': None}, {'name': 'RecMedia', 'default_value': 'NOT_IMPLEMENTED', 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': None}, {'name': 'RecQualityModes', 'default_value': 'NOT_IMPLEMENTED', 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': None}]}, {'name': 'SetAVTransportURI', 'params': [{'name': 'InstanceID', 'default_value': None, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}, {'name': 'CurrentURI', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'allowed_values': None}, {'name': 'CurrentURIMetaData', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'allowed_values': None}], 'ret_vals': []}, {'name': 'SetNextAVTransportURI', 'params': [{'name': 'InstanceID', 'default_value': None, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}, {'name': 'NextURI', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'allowed_values': None}, {'name': 'NextURIMetaData', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'allowed_values': None}], 'ret_vals': []}, {'name': 'X_PrefetchURI', 'params': [{'name': 'InstanceID', 'default_value': None, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}, {'name': 'PrefetchURI', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'allowed_values': None}, {'name': 'PrefetchURIMetaData', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'allowed_values': None}], 'ret_vals': []}, {'name': 'GetTransportSettings', 'params': [{'name': 'InstanceID', 'default_value': None, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}], 'ret_vals': [{'name': 'PlayMode', 'default_value': 'NORMAL', 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': ['NORMAL']}, {'name': 'RecQualityMode', 'default_value': 'NOT_IMPLEMENTED', 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': ['NOT_IMPLEMENTED']}]}, {'name': 'GetTransportInfo', 'params': [{'name': 'InstanceID', 'default_value': None, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}], 'ret_vals': [{'name': 'CurrentTransportState', 'default_value': 'NO_MEDIA_PRESENT', 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': ['STOPPED', 'PAUSED_PLAYBACK', 'PLAYING', 'TRANSITIONING', 'NO_MEDIA_PRESENT']}, {'name': 'CurrentTransportStatus', 'default_value': 'OK', 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': ['OK', 'ERROR_OCCURRED']}, {'name': 'CurrentSpeed', 'default_value': '1', 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': None}]}, {'name': 'Pause', 'params': [{'name': 'InstanceID', 'default_value': None, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}], 'ret_vals': []}, {'name': 'Seek', 'params': [{'name': 'InstanceID', 'default_value': None, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}, {'name': 'Unit', 'default_value': 'REL_TIME', 'data_type': (<class 'str'>, <class 'bytes'>), 'allowed_values': ['TRACK_NR', 'REL_TIME', 'ABS_TIME', 'ABS_COUNT', 'REL_COUNT', 'X_DLNA_REL_BYTE']}, {'name': 'Target', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'allowed_values': None}], 'ret_vals': []}, {'name': 'GetPositionInfo', 'params': [{'name': 'InstanceID', 'default_value': None, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}], 'ret_vals': [{'name': 'Track', 'default_value': 0, 'data_type': (<class 'int'>,), 'min': 0, 'max': 4294967295, 'step': 1}, {'name': 'TrackDuration', 'default_value': '00:00:00', 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': None}, {'name': 'TrackMetaData', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': None}, {'name': 'TrackURI', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': None}, {'name': 'RelTime', 'default_value': '00:00:00', 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': None}, {'name': 'AbsTime', 'default_value': '00:00:00', 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': None}, {'name': 'RelCount', 'default_value': 2147483647, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}, {'name': 'AbsCount', 'default_value': 2147483647, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}]}, {'name': 'GetCurrentTransportActions', 'params': [{'name': 'InstanceID', 'default_value': None, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}], 'ret_vals': [{'name': 'Actions', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': None}]}, {'name': 'X_DLNA_GetBytePositionInfo', 'params': [{'name': 'InstanceID', 'default_value': None, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}], 'ret_vals': [{'name': 'TrackSize', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': None}, {'name': 'RelByte', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': None}, {'name': 'AbsByte', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': None}]}, {'name': 'X_GetStoppedReason', 'params': [{'name': 'InstanceID', 'default_value': None, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}], 'ret_vals': [{'name': 'StoppedReason', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': None}, {'name': 'StoppedReasonData', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': None}]}, {'name': 'X_PlayerAppHint', 'params': [{'name': 'InstanceID', 'default_value': None, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}, {'name': 'UpnpClass', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'allowed_values': ['object.item.imageItem', 'object.item.audioItem', 'object.item.videoItem']}, {'name': 'PlayerHint', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'allowed_values': ['load', 'unload']}], 'ret_vals': []}], 'icons': [{'name': 'icon_SML_jpg', 'mime_type': None, 'width': 48, 'height': 48, 'depth': 24, 'url': 'http://192.168.1.7:9197/icon_SML.jpg'}, {'name': 'icon_LRG_jpg', 'mime_type': None, 'width': 120, 'height': 120, 'depth': 24, 'url': 'http://192.168.1.7:9197/icon_LRG.jpg'}, {'name': 'icon_SML_png', 'mime_type': None, 'width': 48, 'height': 48, 'depth': 24, 'url': 'http://192.168.1.7:9197/icon_SML.png'}, {'name': 'icon_LRG_png', 'mime_type': None, 'width': 120, 'height': 120, 'depth': 24, 'url': 'http://192.168.1.7:9197/icon_LRG.png'}], 'deviceType': 'urn:schemas-upnp-org:device:MediaRenderer:1', 'X_compatibleId': 'MS_DigitalMediaDeviceClass_DMR_V001', 'X_deviceCategory': 'Display.TV.LCD Multimedia.DMR', 'X_DLNADOC': 'DMR-1.50', 'friendlyName': '[TV] Samsung Frame Series (43)', 'manufacturer': 'Samsung Electronics', 'manufacturerURL': 'http://www.samsung.com/sec', 'modelDescription': 'Samsung TV DMR', 'modelName': 'UE43LS03N', 'modelNumber': 'AllShare1.0', 'modelURL': 'http://www.samsung.com/sec', 'serialNumber': '0C2A3SCKB01047A', 'UDN': 'uuid:a276d50f-30a1-4a11-8b0f-953f21b240ef', 'ProductCap': 'Tizen,Y2018,WebURIPlayable,NavigateInPause,ScreenMirroringP2PMAC=66:1c:ae:4a:9c:e2,UHD_SCREEN,SerialNumber=0C2A3SCKB01047A,vdProductType=TV,OCF=1', 'X_hardwareId': 'VEN_0105&DEV_VD0001'}, {'name': 'dial', 'methods': [{'name': 'SendKeyCode', 'params': [{'name': 'KeyCode', 'default_value': None, 'data_type': (<class 'int'>,), 'min': None, 'max': None, 'step': None}, {'name': 'KeyDescription', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'allowed_values': None}], 'ret_vals': []}], 'icons': [], 'deviceType': 'urn:dial-multiscreen-org:device:dialreceiver:1', 'friendlyName': '[TV] Samsung Frame Series (43)', 'manufacturer': 'Samsung Electronics', 'manufacturerURL': 'http://www.samsung.com/sec', 'modelDescription': 'Samsung DTV RCR', 'modelName': 'UE43LS03N', 'modelNumber': '1.0', 'modelURL': 'http://www.samsung.com/sec', 'serialNumber': '20090804RCR', 'UDN': 'uuid:1220bf65-8e1b-4858-82ab-f15ce650aef6', 'deviceID': 'NSNSC5ZTTO2RS', 'ProductCap': 'Resolution:1920X1080,Tizen,Y2017'}, {'name': 'ScreenSharingService', 'methods': [{'name': 'X_ConnectScreenSharingM2TV', 'params': [{'name': 'mWlanMacAddress', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'allowed_values': None}, {'name': 'mP2pDeviceAddress', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'allowed_values': None}, {'name': 'mBluetoothMacAddress', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'allowed_values': None}, {'name': 'mWFDSourcePort', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'allowed_values': None}], 'ret_vals': [{'name': 'tBSSID', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': None}, {'name': 'tWlanFreq', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': None}, {'name': 'tListenFreq', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': None}]}, {'name': 'X_ConnectScreenSharingTV2M', 'params': [{'name': 'mWlanMacAddress', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'allowed_values': None}, {'name': 'mP2pDeviceAddress', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'allowed_values': None}, {'name': 'mBluetoothMacAddress', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'allowed_values': None}], 'ret_vals': [{'name': 'tBSSID', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': None}, {'name': 'tWlanFreq', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': None}, {'name': 'tListenFreq', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': None}, {'name': 'tWFDSourcePort', 'default_value': None, 'data_type': (<class 'str'>, <class 'bytes'>), 'returned_values': None}]}], 'icons': [{'name': 'icon_SML_jpg', 'mime_type': None, 'width': 48, 'height': 48, 'depth': 24, 'url': 'http://192.168.1.7:9119/icon_SML.jpg'}, {'name': 'icon_LRG_jpg', 'mime_type': None, 'width': 120, 'height': 120, 'depth': 24, 'url': 'http://192.168.1.7:9119/icon_LRG.jpg'}, {'name': 'icon_SML_png', 'mime_type': None, 'width': 48, 'height': 48, 'depth': 24, 'url': 'http://192.168.1.7:9119/icon_SML.png'}, {'name': 'icon_LRG_png', 'mime_type': None, 'width': 120, 'height': 120, 'depth': 24, 'url': 'http://192.168.1.7:9119/icon_LRG.png'}], 'deviceType': 'urn:samsung.com:device:ScreenSharing:1', 'friendlyName': '[TV] Samsung Frame Series (43)', 'manufacturer': 'Samsung Electronics', 'manufacturerURL': 'http://www.samsung.com/sec', 'modelDescription': 'Samsung TV ScreenSharing', 'modelName': 'UE43LS03N', 'modelNumber': 'AllShare1.0', 'modelURL': 'http://www.samsung.com/sec', 'serialNumber': '0C2A3SCKB01047A', 'UDN': 'uuid:d0e9838f-d088-4996-b6d3-1ec1693249c8', 'X_ScreenSharing': 'wlanMacAddress:64:1c:ae:4a:9c:e2,eth0MacAddress:fc:03:9f:ae:7c:ed,p2pDeviceAddress:66:1c:ae:4a:9c:e2,BluetoothMacAddress:64:1C:AE:4A:9C:E3,BLEMacAddress:64:1C:AE:4A:9C:E3,supportTDLS:0,supportDMR:1,WFDRole:PrimarySink,supportP2PHandover:1,DMR_UDN:uuid:a276d50f-30a1-4a11-8b0f-953f21b240ef,listenFrequency:2412,wlanFrequency:0,bssid:00:00:00:00:00:00,vdProductType:TV'}, {'name': 'IPControlService', 'methods': [], 'icons': [{'name': 'icon_SML_jpg', 'mime_type': None, 'width': 48, 'height': 48, 'depth': 24, 'url': 'http://192.168.1.7:9110/icon_SML.jpg'}, {'name': 'icon_LRG_jpg', 'mime_type': None, 'width': 120, 'height': 120, 'depth': 24, 'url': 'http://192.168.1.7:9110/icon_LRG.jpg'}, {'name': 'icon_SML_png', 'mime_type': None, 'width': 48, 'height': 48, 'depth': 24, 'url': 'http://192.168.1.7:9110/icon_SML.png'}, {'name': 'icon_LRG_png', 'mime_type': None, 'width': 120, 'height': 120, 'depth': 24, 'url': 'http://192.168.1.7:9110/icon_LRG.png'}], 'deviceType': 'urn:samsung.com:device:IPControlServer:1', 'friendlyName': '[TV] Samsung Frame Series (43)', 'manufacturer': 'Samsung Electronics', 'manufacturerURL': 'http://www.samsung.com/sec', 'modelDescription': 'Samsung TV IPControl', 'modelName': 'UE43LS03N', 'modelNumber': 'AllShare1.0', 'modelURL': 'http://www.samsung.com/sec', 'serialNumber': '0C2A3SCKB01047A', 'UDN': 'uuid:36bf22be-a6af-4d91-83ad-004e34555d57', 'X_IPControl': 'wlanMacAddress:64:1c:ae:4a:9c:e2,eth0MacAddress:fc:03:9f:ae:7c:ed,supportDMR:1,DMR_UDN:uuid:a276d50f-30a1-4a11-8b0f-953f21b240ef,listenFrequency:2412,wlanFrequency:0,bssid:00:00:00:00:00:00,vdProductType:TV'}], 'devices': []}

matthieut59 avatar Feb 02 '19 13:02 matthieut59

By Debugging and using the smarthing APP, I can see this kind of method to activate artmode via the smartphone aPP :

DEBUG "msg : {"method":"ms.channel.emit","params":{"clientIp":"127.0.0.1","data":"{\"id\":\"545fc0c1-bd9b-48f5-8444-02f9c519aaec\",\"event\":\"art_mode_changed\",\"value\":\"on\"}","deviceName":"Smart Device","event":"d2d_service_message","to":"all"}}\n" "timestamp: 1549117499092, file: Channel.cpp, func: onSocketMessage : 733"
DEBUG "msg : {"method":"ms.channel.emit","params":{"clientIp":"192.168.1.20","data":"{\"id\":\"545fc0c1-bd9b-48f5-8444-02f9c519aaec\",\"value\":\"on\",\"request\":\"set_artmode_status\"}","deviceName":"W1Bob25lXWlQaG9uZQ==","event":"art_app_request","to":"host"}}\n

And more interesting :

DEBUG "msg : {"method":"ms.channel.emit","params":{"clientIp":"127.0.0.1","data":"{\"id\":\"259320d8-f368-48a4-bf03-789f24a22c0f\",\"event\":\"artmode_status\",\"value\":\"off\",\"target_client_id\":\"84b12082-5f28-461e-8e81-b98ad1c1ffa\"}","deviceName":"Smart Device","event":"d2d_service_message","to":"84b12082-5f28-461e-8e81-b98ad1c1ffa"}}\n"

Do you think you could get something from that ?

matthieut59 avatar Feb 02 '19 14:02 matthieut59

Ok I got it !

733"

DEBUG | "msg : {"method":"ms.channel.emit","params":{"clientIp":"192.168.1.20","data":"{\"request\":\"get_artmode_status\",\"id\":\"30852acd-1b7d-4496-8bef-53e1178fa839\"}","deviceName":"W1Bob25lXWlQaG9uZQ==","event":"art_app_request","to":"host"}}\n"

Can you propose something to shoot this request ?

matthieut59 avatar Feb 02 '19 14:02 matthieut59

sweet... log more debugging on the TV. the more you log the more command structures will surface for controlling the TV over the websocket.

Now that is the get log. I need the response structure as well. that too will be in that log

kdschlosser avatar Feb 02 '19 19:02 kdschlosser

it would be netter if you could grab large chunks of the log before and after those lines. I do not want to get them out of context

it does look like you also have the responses. there might be more their logs are funky

kdschlosser avatar Feb 02 '19 19:02 kdschlosser

ok so here goes...

you will want to clone develop branch. I added the feature to the command line as well as a revised interactive mode i made.

if you want to use it from code

print(remote.artmode)

remote.artmode = True # ON
remote.artmode = False # OFF

kdschlosser avatar Feb 02 '19 20:02 kdschlosser

here is a more complete log : DEBUG "msg : {"method":"ms.channel.emit","params":{"clientIp":"192.168.1.20","deviceName":"W1Bob25lXWlQaG9uZQ==","event":"","to":"de34a6-2b5f-46a0-ad19-f1a3d56167"}}\n" "timestamp: 1549180262359, file: Channel.cpp, func: onSocketMessage : 733" DEBUG "api/v2 : {"device":{"FrameTVSupport":"true","GamePadSupport":"true","ImeSyncedSupport":"true","OS":"Tizen","TokenAuthSupport":"true","VoiceSupport":"true","countryCode":"FR","description":"Samsung DTV RCR","developerIP":"192.168.1.5","developerMode":"1","duid":"uuid:1220bf65-8e1b-4858-82ab-f15ce650aef6","firmwareVersion":"Unknown","id":"uuid:1220bf65-8e1b-4858-82ab-f15ce650aef6","ip":"192.168.1.7","model":"18_KANTM2_FRAME","modelName":"UE43LS03N","name":"[TV] Samsung Frame Series (43)","networkType":"wired","resolution":"3840x2160","smartHubAgreement":"true","type":"Samsung SmartTV","udn":"uuid:1220bf65-8e1b-4858-82ab-f15ce650aef6","wifiMac":"fc:03:9f:ae:7c:ed"},"id":"uuid:1220bf65-8e1b-4858-82ab-f15ce650aef6","isSupport":"{\"DMP_DRM_PLAYREADY\":\"false\",\"DMP_DRM_WIDEVINE\":\"false\",\"DMP_available\":\"true\",\"EDEN_available\":\"true\",\"FrameTVSupport\":\"true\",\"ImeSyncedSupport\":\"true\",\"TokenAuthSupport\":\"true\",\"remote_available\":\"true\",\"remote_fourDirections\":\"true\",\"remote_touchPad\":\"true\",\"remote_voiceControl\":\"true\"}\n","name":"[TV] Samsung Frame Series (43)","remote":"1.0","type":"Samsung SmartTV","uri":"http://192.168.1.7:8001/api/v2/","version":"2.0.25"}\n" "timestamp: 1549180262345, file: ApiV2.cpp, func: RestHandler : 132" DEBUG "uri : /api/v2/, method: GET" "timestamp: 1549180262344, file: ApiV2.cpp, func: RestHandler : 115" DEBUG "msg : {"method":"ms.channel.emit","params":{"clientIp":"127.0.0.1","data":"{\"id\":\"713fe2f1-2848-4161-b04c-18dd6753ecaf\",\"event\":\"brightness_sensor_setting\",\"value\":\"off\",\"target_client_id\":\"de34a6-2b5f-46a0-ad19-f1a3d56167\"}","deviceName":"Smart Device","event":"d2d_service_message","to":"de34a6-2b5f-46a0-ad19-f1a3d56167"}}\n" "timestamp: 1549180257243, file: Channel.cpp, func: onSocketMessage : 733" DEBUG "msg : {"method":"ms.channel.emit","params":{"clientIp":"127.0.0.1","data":"{\"id\":\"68cf908d-c17f-4b6f-b124-373a82393e23\",\"event\":\"motion_sensitivity\",\"value\":\"2\",\"min\":\"1\",\"max\":\"3\",\"target_client_id\":\"de34a6-2b5f-46a0-ad19-f1a3d56167\"}","deviceName":"Smart Device","event":"d2d_service_message","to":"de34a6-2b5f-46a0-ad19-f1a3d56167"}}\n" "timestamp: 1549180257241, file: Channel.cpp, func: onSocketMessage : 733" DEBUG "msg : {"method":"ms.channel.emit","params":{"clientIp":"127.0.0.1","data":"{\"id\":\"c4a87013-5add-4a56-a550-10a242a60208\",\"event\":\"motion_timer\",\"value\":\"30\",\"valid_values\":\"[\\\"off\\\",\\\"15\\\",\\\"30\\\",\\\"60\\\",\\\"120\\\",\\\"240\\\"]\\n\",\"target_client_id\":\"de34a6-2b5f-46a0-ad19-f1a3d56167\"}","deviceName":"Smart Device","event":"d2d_service_message","to":"de34a6-2b5f-46a0-ad19-f1a3d56167"}}\n" "timestamp: 1549180257239, file: Channel.cpp, func: onSocketMessage : 733" DEBUG "msg : {"method":"ms.channel.emit","params":{"clientIp":"127.0.0.1","data":"{\"id\":\"24639a6e-eabf-4c76-810d-6bc3b906ba23\",\"event\":\"color_temperature\",\"value\":\"0\",\"min\":\"-5\",\"max\":\"5\",\"target_client_id\":\"de34a6-2b5f-46a0-ad19-f1a3d56167\"}","deviceName":"Smart Device","event":"d2d_service_message","to":"de34a6-2b5f-46a0-ad19-f1a3d56167"}}\n" "timestamp: 1549180257235, file: Channel.cpp, func: onSocketMessage : 733" DEBUG "msg : {"method":"ms.channel.emit","params":{"clientIp":"127.0.0.1","data":"{\"id\":\"a7d2dbb2-9a24-4794-aa11-8c58031b8cbe\",\"event\":\"brightness\",\"value\":\"-2\",\"min\":\"-5\",\"max\":\"5\",\"target_client_id\":\"de34a6-2b5f-46a0-ad19-f1a3d56167\"}","deviceName":"Smart Device","event":"d2d_service_message","to":"de34a6-2b5f-46a0-ad19-f1a3d56167"}}\n" "timestamp: 1549180257231, file: Channel.cpp, func: onSocketMessage : 733" DEBUG "msg : {"method":"ms.channel.emit","params":{"clientIp":"192.168.1.20","data":"{\"request\":\"get_brightness_sensor_setting\",\"id\":\"713fe2f1-2848-4161-b04c-18dd6753ecaf\"}","deviceName":"W1Bob25lXWlQaG9uZQ==","event":"art_app_request","to":"host"}}\n" "timestamp: 1549180257227, file: Channel.cpp, func: onSocketMessage : 733" DEBUG "msg : {"method":"ms.channel.emit","params":{"clientIp":"192.168.1.20","data":"{\"request\":\"get_motion_sensitivity\",\"id\":\"68cf908d-c17f-4b6f-b124-373a82393e23\"}","deviceName":"W1Bob25lXWlQaG9uZQ==","event":"art_app_request","to":"host"}}\n" "timestamp: 1549180257227, file: Channel.cpp, func: onSocketMessage : 733" DEBUG "msg : {"method":"ms.channel.emit","params":{"clientIp":"192.168.1.20","data":"{\"request\":\"get_motion_timer\",\"id\":\"c4a87013-5add-4a56-a550-10a242a60208\"}","deviceName":"W1Bob25lXWlQaG9uZQ==","event":"art_app_request","to":"host"}}\n" "timestamp: 1549180257227, file: Channel.cpp, func: onSocketMessage : 733" DEBUG "msg : {"method":"ms.channel.emit","params":{"clientIp":"192.168.1.20","data":"{\"request\":\"get_color_temperature\",\"id\":\"24639a6e-eabf-4c76-810d-6bc3b906ba23\"}","deviceName":"W1Bob25lXWlQaG9uZQ==","event":"art_app_request","to":"host"}}\n" "timestamp: 1549180257227, file: Channel.cpp, func: onSocketMessage : 733" DEBUG "msg : {"method":"ms.channel.emit","params":{"clientIp":"192.168.1.20","data":"{\"request\":\"get_brightness\",\"id\":\"a7d2dbb2-9a24-4794-aa11-8c58031b8cbe\"}","deviceName":"W1Bob25lXWlQaG9uZQ==","event":"art_app_request","to":"host"}}\n" "timestamp: 1549180257227, file: Channel.cpp, func: onSocketMessage : 733" DEBUG "msg : {"method":"ms.channel.emit","params":{"clientIp":"127.0.0.1","data":"{\"id\":\"bf920741-803a-46cf-a022-d0376ae148ea\",\"event\":\"artmode_status\",\"value\":\"on\",\"target_client_id\":\"de34a6-2b5f-46a0-ad19-f1a3d56167\"}","deviceName":"Smart Device","event":"d2d_service_message","to":"de34a6-2b5f-46a0-ad19-f1a3d56167"}}\n" "timestamp: 1549180257223, file: Channel.cpp, func: onSocketMessage : 733" DEBUG "msg : {"method":"ms.channel.emit","params":{"clientIp":"192.168.1.20","data":"{\"request\":\"get_artmode_status\",\"id\":\"bf920741-803a-46cf-a022-d0376ae148ea\"}","deviceName":"W1Bob25lXWlQaG9uZQ==","event":"art_app_request","to":"host"}}\n" "timestamp: 1549180257219, file: Channel.cpp, func: onSocketMessage : 733"

when I tried your code,

I see this received on debug logs :

DEBUG "msg : {"method":"ms.channel.emit","params":{"clientIp":"192.168.1.20","data":"{\"request\":\"get_artmode_status\",\"id\":\"30852acd-1b7d-4496-8bef-53e1178fa839\"}","deviceName":"W1Bob25lXWlQaG9uZQ==","event":"art_app_request","to":"host"}}\n" "timestamp: 1549180404771, file: RemoteChannel.cpp, func: onSocketMessage : 1020"

looks perfect, but i don t get any reply :/

The only difference and may be the root cause is the cpp file handling it on samsung TV : remotechannel.cpp versus channel.cpp

What do you think ?

matthieut59 avatar Feb 03 '19 08:02 matthieut59

keep on passing me those logs. you are going to unlock a shit load of functionality over the websocket..

kdschlosser avatar Feb 03 '19 09:02 kdschlosser

so now I have more websocket commands

get_brightness_sensor_setting get_motion_sensitivity get_motion_timer get_color_temperature get_brightness

on thing tho.. the log from the TV... is that log from when you were using samsungctl? or from the smartthings application??

kdschlosser avatar Feb 03 '19 09:02 kdschlosser

no it did respond..



DEBUG "msg : {

    "method":"ms.channel.emit",
    "params":{
        "clientIp":"127.0.0.1",
        "data":"{\"id\":\"bf920741-803a-46cf-a022-d0376ae148ea\",\"event\":\"artmode_status\",\"value\":\"on\",\"target_client_id\":\"de34a6-2b5f-46a0-ad19-f1a3d56167\"}",
        "deviceName":"Smart Device",
        "event":"d2d_service_message",
        "to":"de34a6-2b5f-46a0-ad19-f1a3d56167"
    }

this is on the line right above the request... this is the data that was returned.. I have something wrong in my code and it is not receiving it.

I am going to go and have a look see.

kdschlosser avatar Feb 03 '19 09:02 kdschlosser

ok something is outta wack with that log..

this is what I need you to do.

I need you to clear the log on the TV start the smartthings application. check the artmode using the app . then close the smartthings application.. go and copy the log to a file.. save that file

then clear the log. connect with samsungctl and try and get the artmode.

go and get the log. save it to a different file. attach both of the files here.

kdschlosser avatar Feb 03 '19 09:02 kdschlosser

OK i was right.. all the log entries you posted are from your iphone. and not samsungctl at all.

kdschlosser avatar Feb 03 '19 09:02 kdschlosser

exactly , I did in fact exactly what you said already :)

There is no asnwer from samsungctrl, I fear it s linked to that channel.cpp used when it s over iphone versus remotechannl.cpp when from the websocket API.

It might be because it s targetting another endpoint, I ll wiresharck it excepte if you have a better idea ?

matthieut59 avatar Feb 03 '19 09:02 matthieut59

i need to see the logs..

all of the log entries you last posted from the TV are for entries created by your iphone and not samsungctl

please follow the steps outlined above for getting the log files.

there should be a whole slew of entries for the authorization process of samsungctl.. I do not see those at all in your previous post.

kdschlosser avatar Feb 03 '19 10:02 kdschlosser

I would also like to see the log entries for the authorization of the smartthings app on your phone. it could point us in a direction.

kdschlosser avatar Feb 03 '19 10:02 kdschlosser

if you can do a man in the middle and wireshark the communications between your phone and the TV that would be really helpful.

kdschlosser avatar Feb 03 '19 10:02 kdschlosser

the thing is, it s not in the output :/ (authorization part)

matthieut59 avatar Feb 03 '19 10:02 matthieut59

i did make a change to the develop branch. if you want to give it a go and see what happens...

kdschlosser avatar Feb 03 '19 12:02 kdschlosser

Nothing new, trying to make a MITM via a raspberry as my laptop is a professional one, and would not allow me to do such thing :/

Will let you know asap

matthieut59 avatar Feb 03 '19 19:02 matthieut59