ollo69/ha-samsungtv-smart

(SamsungPing) [root] Uncaught thread exception requiring integration reload

Closed this issue · 9 comments

Describe the bug
the integration stops working and there is no tv control until the integration is reloaded.

Expected behavior
calling media_content_id: key_right, media_content_type: send_key via media_player.play_media service to move the selection one to the right. This affects all content_id's, this is just one example.

Environment details:

  • Environment (HASSIO, Raspbian, etc): HAOS
  • Home Assistant version installed: 2023.2.4
  • Component version installed: 0.11.6
  • Last know working version: maybe v0.11.3
  • TV model: UN65NU8000

Output of HA logs

2023-02-15 02:42:29.455 ERROR (SamsungPing) [root] Uncaught thread exception
Traceback (most recent call last):
File "/usr/local/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/config/custom_components/samsungtv_smart/api/samsungws.py", line 873, in _ping_thread_method
self._check_remote()
File "/config/custom_components/samsungtv_smart/api/samsungws.py", line 890, in _check_remote
self._get_running_app()
File "/config/custom_components/samsungtv_smart/api/samsungws.py", line 951, in _get_running_app
self._get_app_status(app.app_id, app.app_type)
File "/config/custom_components/samsungtv_smart/api/samsungws.py", line 702, in _get_app_status
self._ws_send(
File "/config/custom_components/samsungtv_smart/api/samsungws.py", line 414, in _ws_send
connection.send(payload)
File "/usr/local/lib/python3.10/site-packages/websocket/_app.py", line 239, in send
if not self.sock or self.sock.send(data, opcode) == 0:
File "/usr/local/lib/python3.10/site-packages/websocket/_core.py", line 283, in send
return self.send_frame(frame)
File "/usr/local/lib/python3.10/site-packages/websocket/_core.py", line 311, in send_frame
l = self._send(data)
File "/usr/local/lib/python3.10/site-packages/websocket/_core.py", line 525, in _send
return send(self.sock, data)
File "/usr/local/lib/python3.10/site-packages/websocket/_socket.py", line 170, in send
return _send()
File "/usr/local/lib/python3.10/site-packages/websocket/_socket.py", line 147, in _send
return sock.send(data)
File "/usr/local/lib/python3.10/ssl.py", line 1206, in send
return self._sslobj.write(data)
ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:2396)

Additional context
individual key presses are configured via scripts, which are called from a button card. every 24-48 hours they stop responding until the integration for said tv is reloaded, and then begin functioning again immediately afterwards.

button:
- entity: script.1599937982764 #basement_tv key_right
icon: mdi:arrow-right
show_icon: true
show_name: false
tap_action:
action: toggle
type: button

script:
data:
entity_id: media_player.basement_tv
media_content_id: KEY_RIGHT
media_content_type: send_key
service: media_player.play_media

This is probably something related to python 3.10. Can you check python version (3.10.x, I need the x) installed in your environment?

python --version reports 3.10.9. I can't confirm which version of homeassistant it started in exactly, but it was for sure in one of the 2023.2.x releases.

This issue occurs only when you press the buttons or randomly in any condition?

I've not tried calling the service without using the aforementioned buttons. Next time it stops working I'll test to be sure, but I do not believe the buttons have anything to do with the issue - more just trying to give a complete picture of my use-case.

This time it presented with media_player.basement_tv state showing off, when the TV was most certainly on. A service call to change the input to disney plus and plex, as well as the enter key worked one time each before having no effect. Those three service calls were the first I tried.

There's also this in the logs:

Logger: custom_components.samsungtv_smart.media_player
Source: custom_components/samsungtv_smart/media_player.py:847
Integration: SamsungTV Smart ([documentation](https://github.com/ollo69/ha-samsungtv-smart), [issues](https://github.com/ollo69/ha-samsungtv-smart/issues))
First occurred: February 15, 2023 at 11:44:01 PM (66 occurrences)
Last logged: 8:01:37 PM

media_player.basement_tv - SmartThings report TV is off but status detected is on. Check connection status with TV on the phone App
media_player.living_room_tv - SmartThings report TV is off but status detected is on. Check connection status with TV on the phone App
media_player.basement_tv - Connection to SmartThings restored
media_player.living_room_tv - Connection to SmartThings restored

I do not have these devices attached to smartthings as far as I am aware.

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 7 days.

This issue is still ongoing. Let me know what info\logs you need from me and I'll be happy to provide.

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 7 days.

This issue was closed because it has been stalled for 7 days with no activity.