ha-samsungtv-tizen icon indicating copy to clipboard operation
ha-samsungtv-tizen copied to clipboard

Compatibility with QLED Q55Q7FAM

Open phrfpeixoto opened this issue 4 years ago • 1 comments

Hi there,

First and foremost, amazing job! This is by far the most working condition I've had with this TV so far. THANK YOU BIG TIME.

The only issue I'm having is that the media_player entity is not correctly detecting the TV being ON or OFF. Sometimes the TV is OFF, but the entity is showing OFF, so when I hit the power button on HA (to turn is ON), the actual TV turns off.

This is my config:

media_player:
  - platform: samsungtv_tizen
    host: 192.168.20.252
    port: 8002
    mac: 7C:64:56:XX:XX:XX
    source_list: '{"PlayStation": "ST_HDMI3", "Cable TV": "ST_HDMI4"}'
    update_method: ping
    name: qled_tv
    api_key: "REDACTED"
    device_id: "REDACTED"

I've also seen some exceptions on HA log, but I'm under the impression that after the permission popup on the screen appeared, I no longer get these:

2020-03-20 00:17:46 WARNING (MainThread) [homeassistant.components.media_player] Updating samsungtv_tizen media_player took longer than the scheduled update interval 0:00:15
2020-03-20 00:17:48 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/core.py", line 1253, in _execute_service
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 198, in handle_service
    self._platforms.values(), func, call, required_features
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 402, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 590, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 433, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 527, in async_turn_off
    await self.hass.async_add_job(self.turn_off)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/samsungtv_tizen/media_player.py", line 591, in turn_off
    self.send_command("KEY_POWER")
  File "/config/custom_components/samsungtv_tizen/media_player.py", line 446, in send_command
    self._ws.send_key(payload, key_press_delay)
  File "/config/custom_components/samsungtv_tizen/websockets.py", line 181, in send_key
    key_press_delay
  File "/config/custom_components/samsungtv_tizen/websockets.py", line 109, in _ws_send
    self.open()
  File "/config/custom_components/samsungtv_tizen/websockets.py", line 152, in open
    response = self._process_api_response(self.connection.recv())
  File "/usr/local/lib/python3.7/site-packages/websocket/_core.py", line 313, in recv
    opcode, data = self.recv_data()
  File "/usr/local/lib/python3.7/site-packages/websocket/_core.py", line 330, in recv_data
    opcode, frame = self.recv_data_frame(control_frame)
  File "/usr/local/lib/python3.7/site-packages/websocket/_core.py", line 343, in recv_data_frame
    frame = self.recv_frame()
  File "/usr/local/lib/python3.7/site-packages/websocket/_core.py", line 377, in recv_frame
    return self.frame_buffer.recv_frame()
  File "/usr/local/lib/python3.7/site-packages/websocket/_abnf.py", line 383, in recv_frame
    frame.validate(self.skip_utf8_validation)
  File "/usr/local/lib/python3.7/site-packages/websocket/_abnf.py", line 182, in validate
    raise WebSocketProtocolException("Invalid close opcode.")
websocket._exceptions.WebSocketProtocolException: Invalid close opcode.

Is there a way to improve the reliability of the ON/OFF state?

One minor glitch I also noticed is that the entity status is showing as Netflix, even though is on Cable TV:

image

Is this related to the app_list?

phrfpeixoto avatar Mar 20 '20 03:03 phrfpeixoto

I've also seen some exceptions on HA log, but I'm under the impression that after the permission popup on the screen appeared, I no longer get these

I haven't seen that error before, it might indeed be due to lack of permission on the TV.

One minor glitch I also noticed is that the entity status is showing as Netflix, even though is on Cable TV

State updates normally take around 15 seconds, if the previous app gets locked for a longer period it might indeed be some bug. We're constantly working on improving state updates though.

jaruba avatar Mar 20 '20 07:03 jaruba