Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Samsung PIN-based TV intergration (UE32J5200AK) #117694

Open
Ferbez opened this issue May 18, 2024 · 7 comments
Open

Samsung PIN-based TV intergration (UE32J5200AK) #117694

Ferbez opened this issue May 18, 2024 · 7 comments

Comments

@Ferbez
Copy link

Ferbez commented May 18, 2024

The problem

Samsung TV integration mentions J-series support, though my UE32J5200AK doesn't really work - it just fails to connect. I tried to play around myself, and had partial success - through port 8080.

Commands like curl -X GET -i http://192.168.1.X:8080/ws/apps/YouTube gave me info about YouTube app, curl -X GET -i http://192.168.1.X:8080/ws/apps/YouTube/install opened SmartHub page with installation and most importantly - curl -X GET -i http://192.168.1.X:8080/ws/pairing\?step\=$\{step\}\&app_id\=$\{this._config.appId\}\&device_id\=$\{this._config.deviceId\} made PIN appear on TV screen. Is it possible to use Samsung TV integration on this TV?

What version of Home Assistant Core has the issue?

core-2024.5.0

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Samsung Smart TV

Link to integration documentation on our website

https://www.home-assistant.io/integrations/samsungtv

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@home-assistant
Copy link

Hey there @chemelli74, @epenet, mind taking a look at this issue as it has been labeled with an integration (samsungtv) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of samsungtv can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign samsungtv Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


samsungtv documentation
samsungtv source
(message by IssueLinks)

@chemelli74
Copy link
Contributor

Hi @Ferbez, can you show us the issue and the log when it fails with the integration?

@Ferbez
Copy link
Author

Ferbez commented May 19, 2024

It doesn't discover my TV automatically and when I try to manually setup integration via IP it just says "failed to connect". Samsung TV-related logs:

x_homeassistant_matching_domains={'samsungtv'})
2024-05-19 21:48:51.347 DEBUG (MainThread) [homeassistant.components.ssdp] Discovered samsungtv at http://192.168.1.X:7676/smp_11_
x_homeassistant_matching_domains={'samsungtv'})
2024-05-19 21:48:51.352 DEBUG (MainThread) [homeassistant.components.ssdp] Discovered samsungtv at http://192.168.1.X:7676/smp_3_
2024-05-19 21:49:27.664 INFO (SyncWorker_7) [homeassistant.loader] Loaded samsungtv from homeassistant.components.samsungtv
2024-05-19 21:49:37.541 DEBUG (MainThread) [homeassistant.loader] Importing platforms for samsungtv executor=['config_flow'] loop=[] took 9.71s
2024-05-19 21:49:37.542 DEBUG (MainThread) [homeassistant.components.samsungtv] Samsung device found via SSDP: SsdpServiceInfo(ssdp_usn='uuid:17d78401-0090-1000-a055-f877b82db53e::urn:schemas-upnp-org:service:RenderingControl:1', ssdp_st='urn:schemas-upnp-org:service:RenderingControl:1', upnp={'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', 'manufacturer': 'Samsung Electronics', 'manufacturerURL': 'http://www.samsung.com/sec', 'modelDescription': 'Samsung TV DMR', 'modelName': 'UE32J5200', 'modelNumber': 'AllShare1.0', 'modelURL': 'http://www.samsung.com/sec', 'serialNumber': '20110517DMR', 'UDN': 'uuid:17d78401-0090-1000-a055-f877b82db53e', 'deviceID': 'H3CBBEJV772NS', 'iconList': {'icon': [{'mimetype': 'image/jpeg', 'width': '48', 'height': '48', 'depth': '24', 'url': '/dmr/icon_SML.jpg'}, {'mimetype': 'image/jpeg', 'width': '120', 'height': '120', 'depth': '24', 'url': '/dmr/icon_LRG.jpg'}, {'mimetype': 'image/png', 'width': '48', 'height': '48', 'depth': '24', 'url': '/dmr/icon_SML.png'}, {'mimetype': 'image/png', 'width': '120', 'height': '120', 'depth': '24', 'url': '/dmr/icon_LRG.png'}]}, 'serviceList': {'service': [{'serviceType': 'urn:schemas-upnp-org:service:RenderingControl:1', 'serviceId': 'urn:upnp-org:serviceId:RenderingControl', 'controlURL': '/smp_13_', 'eventSubURL': '/smp_14_', 'SCPDURL': '/smp_12_'}, {'serviceType': 'urn:schemas-upnp-org:service:ConnectionManager:1', 'serviceId': 'urn:upnp-org:serviceId:ConnectionManager', 'controlURL': '/smp_16_', 'eventSubURL': '/smp_17_', 'SCPDURL': '/smp_15_'}, {'serviceType': 'urn:schemas-upnp-org:service:AVTransport:1', 'serviceId': 'urn:upnp-org:serviceId:AVTransport', 'controlURL': '/smp_19_', 'eventSubURL': '/smp_20_', 'SCPDURL': '/smp_18_'}]}, 'ProductCap': 'Y2014,WebURIPlayable,SeekTRACK_NR,NavigateInPause,ScreenMirroringP2PMAC=16:bb:6e:10:b9:72', 'X_hardwareId': 'VEN_0105&DEV_VD0001'}, ssdp_location='http://192.168.1.X:7676/smp_11_', ssdp_nt=None, ssdp_udn='uuid:17d78401-0090-1000-a055-f877b82db53e', ssdp_ext='', ssdp_server='SHP, UPnP/1.0, Samsung UPnP SDK/1.0', ssdp_headers={'CACHE-CONTROL': 'max-age=1800', 'Date': 'Thu, 01 Jan 1970 03:31:33 GMT', 'EXT': '', 'LOCATION': 'http://192.168.1.X:7676/smp_11_', 'SERVER': 'SHP, UPnP/1.0, Samsung UPnP SDK/1.0', 'ST': 'urn:schemas-upnp-org:service:RenderingControl:1', 'USN': 'uuid:17d78401-0090-1000-a055-f877b82db53e::urn:schemas-upnp-org:service:RenderingControl:1', 'Content-Length': '0', '_host': '192.168.1.X', '_udn': 'uuid:17d78401-0090-1000-a055-f877b82db53e', '_location_original': 'http://192.168.1.X:7676/smp_11_', 'location': 'http://192.168.1.X:7676/smp_11_', '_timestamp': datetime.datetime(2024, 5, 19, 21, 48, 48, 117894), '_remote_addr': ('192.168.1.X', 55086), '_port': 55086, '_local_addr': ('0.0.0.0', 0), '_source': <SsdpSource.SEARCH: 'search'>}, ssdp_all_locations={'http://192.168.1.X:7676/smp_11_'}, x_homeassistant_matching_domains={'samsungtv'})
2024-05-19 21:49:37.548 DEBUG (MainThread) [homeassistant.components.samsungtv] Set SSDP RenderingControl location to: http://192.168.1.X:7676/smp_11_
2024-05-19 21:49:37.549 DEBUG (MainThread) [samsungtvws.async_rest] Get device info via rest api
2024-05-19 21:49:37.725 DEBUG (MainThread) [homeassistant.components.samsungtv] Samsung device found via SSDP: SsdpServiceInfo(ssdp_usn='uuid:09896800-00a0-1000-adfd-f877b82db53e::urn:samsung.com:device:RemoteControlReceiver:1', ssdp_st='urn:samsung.com:device:RemoteControlReceiver:1', upnp={'deviceType': 'urn:samsung.com:device:RemoteControlReceiver:1', 'friendlyName': '[TV] Samsung', 'manufacturer': 'Samsung Electronics', 'manufacturerURL': 'http://www.samsung.com/sec', 'modelDescription': 'Samsung TV RCR', 'modelName': 'UE32J5200', 'modelNumber': '1.0', 'modelURL': 'http://www.samsung.com/sec', 'serialNumber': '20090804RCR', 'UDN': 'uuid:09896800-00a0-1000-adfd-f877b82db53e', 'deviceID': 'H3CBBEJV772NS', 'ProductCap': 'Resolution:1920X1080,ImageZoom,ImageRotate,Y2014,ENCP,Y2015', 'serviceList': {'service': {'serviceType': 'urn:samsung.com:service:MultiScreenService:1', 'serviceId': 'urn:samsung.com:serviceId:MultiScreenService', 'controlURL': '/smp_5_', 'eventSubURL': '/smp_6_', 'SCPDURL': '/smp_4_'}}, 'Capabilities': {'Capability': {'@name': 'samsung:multiscreen:1', '@port': '8001', '@location': '/ms/1.0/'}}}, ssdp_location='http://192.168.1.X:7676/smp_3_', ssdp_nt=None, ssdp_udn='uuid:09896800-00a0-1000-adfd-f877b82db53e', ssdp_ext='', ssdp_server='SHP, UPnP/1.0, Samsung UPnP SDK/1.0', ssdp_headers={'CACHE-CONTROL': 'max-age=1800', 'Date': 'Thu, 01 Jan 1970 03:31:33 GMT', 'EXT': '', 'LOCATION': 'http://192.168.1.X:7676/smp_3_', 'SERVER': 'SHP, UPnP/1.0, Samsung UPnP SDK/1.0', 'ST': 'urn:samsung.com:device:RemoteControlReceiver:1', 'USN': 'uuid:09896800-00a0-1000-adfd-f877b82db53e::urn:samsung.com:device:RemoteControlReceiver:1', 'Content-Length': '0', '_host': '192.168.1.X', '_udn': 'uuid:09896800-00a0-1000-adfd-f877b82db53e', '_location_original': 'http://192.168.1.X:7676/smp_3_', 'location': 'http://192.168.1.X:7676/smp_3_', '_timestamp': datetime.datetime(2024, 5, 19, 21, 48, 48, 138490), '_remote_addr': ('192.168.1.X', 54561), '_port': 54561, '_local_addr': ('0.0.0.0', 0), '_source': <SsdpSource.SEARCH: 'search'>}, ssdp_all_locations={'http://192.168.1.X:7676/smp_3_'}, x_homeassistant_matching_domains={'samsungtv'})
2024-05-19 21:49:37.726 DEBUG (MainThread) [samsungtvws.async_rest] Get device info via rest api
2024-05-19 21:49:38.634 DEBUG (MainThread) [samsungtvws.async_rest] Get device info via rest api
2024-05-19 21:49:38.641 DEBUG (MainThread) [samsungtvws.async_rest] Get device info via rest api
2024-05-19 21:49:38.649 DEBUG (SyncWorker_2) [homeassistant.components.samsungtv] Try config: {'name': 'HomeAssistant', 'description': 'HomeAssistant', 'id': 'ha.component.samsung', 'host': '192.168.1.X', 'method': 'legacy', 'port': None, 'timeout': 31}
2024-05-19 21:49:38.653 DEBUG (SyncWorker_1) [homeassistant.components.samsungtv] Try config: {'name': 'HomeAssistant', 'description': 'HomeAssistant', 'id': 'ha.component.samsung', 'host': '192.168.1.X', 'method': 'legacy', 'port': None, 'timeout': 31}
2024-05-19 21:49:38.657 DEBUG (SyncWorker_2) [homeassistant.components.samsungtv] Failing config: {'name': 'HomeAssistant', 'description': 'HomeAssistant', 'id': 'ha.component.samsung', 'host': '192.168.1.X', 'method': 'legacy', 'port': None, 'timeout': 31}, error: [Errno 111] Connection refused
2024-05-19 21:49:38.660 DEBUG (SyncWorker_1) [homeassistant.components.samsungtv] Failing config: {'name': 'HomeAssistant', 'description': 'HomeAssistant', 'id': 'ha.component.samsung', 'host': '192.168.1.X', 'method': 'legacy', 'port': None, 'timeout': 31}, error: [Errno 111] Connection refused
2024-05-19 21:49:38.665 DEBUG (MainThread) [homeassistant.components.samsungtv] Host:192.168.1.X did not return device info
2024-05-19 21:49:38.666 DEBUG (MainThread) [homeassistant.components.samsungtv] Host:192.168.1.X did not return device info

Should I attach full log file?

@Ferbez
Copy link
Author

Ferbez commented May 23, 2024

http://192.168.1.X:7676/smp_4_ gives something interesting:

<scpd xmlns="urn:schemas-upnp-org:service-1-0">
<specVersion>
<major>1</major>
<minor>0</minor>
</specVersion>
<actionList>
<action>
<name>SendKeyCode</name>
<argumentList>
<argument>
<name>KeyCode</name>
<direction>in</direction>
<relatedStateVariable>A_ARG_TYPE_KeyCode</relatedStateVariable>
</argument>
<argument>
<name>KeyDescription</name>
<direction>in</direction>
<relatedStateVariable>A_ARG_TYPE_KeyDescription</relatedStateVariable>
</argument>
</argumentList>
</action>
</actionList>
<serviceStateTable>
<stateVariable sendEvents="no">
<name>A_ARG_TYPE_KeyCode</name>
<dataType>ui4</dataType>
</stateVariable>
<stateVariable sendEvents="no">
<name>A_ARG_TYPE_KeyDescription</name>
<dataType>string</dataType>
</stateVariable>
</serviceStateTable>
</scpd>

@epenet
Copy link
Contributor

epenet commented May 23, 2024

Port 7676 is for UPNP, and is only used AFTER the config entry is successful.
For now this port can be ignored.

"UE32J5200AK" is a "J" model, and according to the documentation:

H and J models
Some televisions from the H and J series use an encrypted protocol and require manual pairing with the TV. This should be detected automatically when attempting to send commands using the WebSocket connection, and trigger the corresponding authentication flow.

So you should be able to connect using the "legacy" mode.
Did you enable logging for samsungctl package or only homeassistant.components.samsungtv?

@Ferbez
Copy link
Author

Ferbez commented May 23, 2024

I enabled both samsungctl and homeassistant.components.samsungtv - there's no log entries for samsungctl in log. I even tried to enable debug logging for everything and searched through log - still no samsungctl entries. Looks like this TV just rejects connection - which port is used for configuration?

@epenet
Copy link
Contributor

epenet commented May 24, 2024

I don't have an H/J model to test with - so I'm not sure exactly how I can replicate your issue :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants