Samsung TV 2014 H Series not working

Wow!! Finally something with some potential. It kinda works for me. I have a UA60H6400.

  • Power Off does not work
  • Only have TV and HDMI as sources. This seems consistent with all other Samsung TV components I have tried with my other Samsung D6600 TV.
    This I just cannot work out
  • It seems to timeout and stops working. I have to turn off, which doesn’t work, and wait for it to detect the TV is on for it to work again.
  • I don’t use mute/volume keys on this TV, so would be good to be able to hide those controls.

The development of this component was moved to: https://github.com/sermayoral/ha-samsungtv-encrypted

1 Like

You guys may also to try my fork from the HACS one. https://github.com/StevusPrimus/ha-samsungtv-custom/tree/H-J-Models-integration . Works with my UE55H6600. Please vote for my pull request https://github.com/roberodin/ha-samsungtv-custom/pull/42 if you tested it working :slight_smile:

What just happened with repo? It was 2.0, and then 1.0 was released about 30 minutes ago.

Sorry I had a problem with HACS, so I had to remake the repository again…

Now available again and …

WE ARE IN HACS!!!

:slight_smile:

Please help me, i get the message:

from . import crypto

ValueError: Attempted relative import in non-package

what do i wrong?

I’m sure this is a stupid question, but…
I already installed SamsungTV Encrypted using HACS, but I’m stuck in the first step of the configuration:

  1. Use get_token.py to get your Samsung TV token (use --port 8080). Store CTX and <SESSION_ID> output. Your TV must be turned on and connected to Internet with the specific IP. Terminal where you have executed get_token.py will ask for a PIN, that will be showed in your TV screen.

How do I execute get_token.py???

You need to have Python installed.

I want to do anything in the custom in order to execute the get_token.py script for you :slight_smile:

StevusPrimus,
have downloaded your component, and am playing around with it to work an H series tv. Have configured as per your readme file, using the following in my configuration.yaml:

media_player:
  - platform: samsungtv_custom
    host: !secret samsungtv_IP
    port: 8001
    mac: !secret samsungtv_MAC
    protocol: ctl_beta
    token: !secret samsungtv_token
    id: !secret samsungtv_id

When the server (v0.107) starts, I get an config err

Invalid config for [media_player.samsungtv_custom]: [token] is an invalid option for [media_player.samsung_custom]. Check media_player.samsungtv_custom->token. (See ?, line?)

Any ideas on how to resolve (or even start troubleshooting)?

What component have you installed?

Mine would be:

media_player:
  - platform: samsungtv_encrypted
  ...

I can not get the token from tv

root@nuci5:~/ha-samsungtv-encrypted/custom_components/samsungtv_encrypted# python3 get_token.py -ip 192.168.1.118 -port 8000
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 141, in _new_conn
    (self.host, self.port), self.timeout, **extra_kw)
  File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 60, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "/usr/lib/python3.6/socket.py", line 745, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 601, in urlopen
    chunked=chunked)
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 357, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/lib/python3.6/http/client.py", line 1254, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.6/http/client.py", line 1300, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.6/http/client.py", line 1249, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.6/http/client.py", line 1036, in _send_output
    self.send(msg)
  File "/usr/lib/python3.6/http/client.py", line 974, in send
    self.connect()
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 166, in connect
    conn = self._new_conn()
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 150, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f66809fd358>: Failed to establish a new connection: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 440, in send
    timeout=timeout
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 639, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 398, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='p', port=8000): Max retries exceeded with url: /socket.io/1/?t=1584881659537 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f66809fd358>: Failed to establish a new connection: [Errno -2] Name or service not known',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "get_token.py", line 27, in <module>
    main(sys.argv[1:])
  File "get_token.py", line 24, in main
    PySmartCrypto(ip, port)
  File "/root/ha-samsungtv-encrypted/custom_components/samsungtv_encrypted/PySmartCrypto/pysmartcrypto.py", line 123, in __init__
    self._connection = self.connect()
  File "/root/ha-samsungtv-encrypted/custom_components/samsungtv_encrypted/PySmartCrypto/pysmartcrypto.py", line 95, in connect
    websocket_response = requests.get(step4_url)
  File "/usr/lib/python3/dist-packages/requests/api.py", line 72, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 520, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 630, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 508, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='p', port=8000): Max retries exceeded with url: /socket.io/1/?t=1584881659537 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f66809fd358>: Failed to establish a new connection: [Errno -2] Name or service not known',))
root@nuci5:~/ha-samsungtv-encrypted/custom_components/samsungtv_encrypted#

Host must be an IP, like 192.168.1.XX

Hi! Is there any way to define entity name for the entities created by samsungtv_encrypted?
I have 2 Samsung TVs and got them working with this setup:

media_player:
  - platform: samsungtv_encrypted # Samsung TV da Sala
    host: !secret samsungtv_encrypted_sala_host
    token: !secret samsungtv_encrypted_sala_token
    sessionid: !secret samsungtv_encrypted_sala_sessionid
    port: !secret samsungtv_encrypted_sala_port

  - platform: samsungtv_encrypted # Samsung TV da Suite
    host: !secret samsungtv_encrypted_suite_host
    token: !secret samsungtv_encrypted_suite_token
    sessionid: !secret samsungtv_encrypted_suite_sessionid
    port: !secret samsungtv_encrypted_suite_port

These were the entities after setup:

media_player.samsung_tv_remote = Family Room TV
media_player.samsung_tv_remote_2 = Bedroom TV

But after I restarted HA, they changed entities names and messed up the automations, Lovelace cards, etc…:

media_player.samsung_tv_remote = Bedroom TV
media_player.samsung_tv_remote_2 = Family Room TV

1 Like

This is my ip

python3 get_token.py -ip 192.168.1.118 -port 8080

@andrepia Please try:
name:

At least in the code I see that the property name exists and is filled with “Samsung TV Remote” by default

hi @ForumUser,

you may have done just a clone and not change the branch. I merged my chenges into my master so a git pull should fix it.

@StevusPrimus
Great!! It worked!!
Thank you!!!

For me the syntax that worked was python ./custom_components/samsungtv_encrypted/get_token.py -ixxxxxx -p8080 (I used my tv’s local hostname, so the parameter to -i doesn’t have to be an IP)

No :pensive:

oot@nuci5:~/ha-samsungtv-encrypted/custom_components/samsungtv_encrypted# python ./get_token.py -i samsungtv -p 8080                                                 Traceback (most recent call last):
  File "./get_token.py", line 3, in <module>
    from PySmartCrypto.pysmartcrypto import PySmartCrypto
  File "/root/ha-samsungtv-encrypted/custom_components/samsungtv_encrypted/PySmartCrypto/pysmartcrypto.py", line 2, in <module>
    from . import crypto
  File "/root/ha-samsungtv-encrypted/custom_components/samsungtv_encrypted/PySmartCrypto/crypto.py", line 6, in <module>
    from .py3rijndael.rijndael import Rijndael
ImportError: No module named py3rijndael.rijndael
root@nuci5:~/ha-samsungtv-encrypted/custom_components/samsungtv_encrypted#

@StevusPrimus
I’ve been downloading the zip file from the website link you posted, and get a similar file whether I select master or “H-J-Models-Integration”. I then get a file downloaded called ha-samsungtv-custom-H-J-Models-integration.zip

I load the relevant directory into custom_components

A server restart yields a config error. Forcing my host to kill and restart the docker container, starts the container but an error occurs on boot. I suspect the relevant part of the error stack is

File "/config/custom_components/samsungtv_custom/media_player.py", line 84, in <module>                                                        
     vol.Optional(CONF_ID): cv.string,                                                                                                          
NameError: name 'CONF_ID' is not defined

The boot then fails, and I can’t restart until I delete the samsuntv_custom custom_component.

Thanks for your help, and your efforts in trying to get this working.