Git Product home page Git Product logo

ha-samsungtv-smart's People

Contributors

briktor avatar fherreror avatar giefca avatar jaruba avatar leandroissa avatar marekjdj avatar ollo69 avatar pegatron89 avatar peledzius avatar roberodin avatar v1k70rk4 avatar vmonkey avatar xchwarze avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ha-samsungtv-smart's Issues

Turning OFF the TV, HASSIO retain state ON

The problem
Problem is like #issue10, but a bit different.

When I try to switch OFF the TV from HASSIO or from IR Control, TV power OFF perfectly but... HASSIO retain "TV State ON" or, if it going OFF, after about 25 seconds, return ON.

image

  • Also happen sending key KEY_POWER using the service media_player.play_media.
  • Also happen tapping "toggle button" on media_player.samsungtv TAB
  • On SmartThings APP TV stay in correct state OFF.

image

Environment

  • Hardware: Raspberry Pi3
  • HASSIO release: 0.108.9
  • SamsungTV Smart Integration release: v0.2.1 (via HACS)
  • TV model: RU7170 (UE50RU7170UXZT)
  • SmartThings integration NOT configured

Please help me to enable log, if you need more details.

Device won't stay in the one state

Describe the bug
When the TV is physically on, HA recognises it as on but after a few seconds, it displays it as off. It won't accept any commands during the time it is listed as off when the TV is on. So if you leave the TV on and an automation script turns it off and the plugin is displaying the TV is off (when it's actually on) the script won't power off the TV.

Expected behavior
The script should know the TV is on whenever the TV is on

Environment details:

  • Environment (HASSIO, Raspbian, etc): HASSIO
  • Home Assistant version installed: 0.113.3
  • Component version installed:0.3.7
  • Last know working version:
  • TV model:

[BUG] MediaPlayerDevice error with 110 release

Describe the bug
After updating HA release 110 an error is shown in the log:

2020-05-20 21:01:26 WARNING (MainThread) [homeassistant.components.media_player] MediaPlayerDevice is deprecated, modify SamsungTVDevice to extend MediaPlayerEntity

Expected behavior
It seems that MediaPlayerDevice has changed to MediaPlayerEntity

Screenshots
If applicable, add screenshots to help explain your problem.

Environment details:

  • Environment (HASSIO, Raspbian, etc): HA Core
  • Home Assistant version installed: 110.0
  • Component version installed: Newest
  • Last know working version: HA release 109.6
  • TV model: Samsung UE7000

Output of HA logs
Paste the relavant output of the HA log here.


2020-05-20 21:01:26 WARNING (MainThread) [homeassistant.components.media_player] MediaPlayerDevice is deprecated, modify SamsungTVDevice to extend MediaPlayerEntity

Additional context
Add any other context about the problem here.

KeyError: 'volume'

Describe the bug
Basically all is working what im expect but logs are flooded with errors.

Expected behavior
If applicable, a clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment details:

  • Environment (HASSIO, Raspbian, etc): hassio
  • Home Assistant version installed: 0.115.2
  • Component version installed: latest
  • Last know working version: tba
  • TV model: UE50TU7172UXXH

Output of HA logs

2020-09-22 02:10:51 ERROR (MainThread) [homeassistant.helpers.entity] Update for media_player.tvsamsung fails


Traceback (most recent call last):


  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state


    await self.async_device_update()


  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 469, in async_device_update


    await self.async_update()  # type: ignore


  File "/config/custom_components/samsungtv_smart/media_player.py", line 617, in async_update


    await self._st.async_device_update(use_channel_info)


  File "/config/custom_components/samsungtv_smart/api/smartthings.py", line 326, in async_device_update


    device_volume = data["main"]["volume"]["value"]


KeyError: 'volume'


Additional context
Add any other context about the problem here.

Remote Control from Remote app on iPhone

In the iPhone Remote App I can choose the Samsung TV after setting it up with ha-samsungtv-smart. But it does not send the commands to the tv from the iPhone Remote App. I would love to be able to use my iPhone as a remote just like i have used to do with HomeBridge instead. Alternatives could be to be able to remote control from inside Home Assistant, but it is still more convenient to use the iPhone Remote App.

And, btw great work!

Not working for (UE55)RU8000 series

Is your feature request related to a problem? Please describe.
I can add the TV, on/off not reporting correctly (WOL works only via smarthing, not with this integration)

Describe the solution you'd like
Support for the RU8000 series. WiFi WOL works for this TV, some sort of smartthings API thing?

Broken on/off state recognition for NU8042

Describe the bug
v0.3.6 breaks state recognition for my NU8042. I'm not using Smart Things. I can control TV via integration but it does not detect on/off state changes. TV state is always off.

Expected behavior
Behavior from v0.3.5, I've already downgraded to that and it works well.

Environment details:

  • Environment: HassOS
  • Home Assistant version installed: 0.112.3
  • Component version installed: v0.3.6
  • Last know working version: v0.3.5
  • TV model: Samsung NU8000 / NU8042 / NU8072

Output of HA logs
No errors were seen in HA logs.

Power control problem

Describe the bug
Since the recent update to 0.3.0 I can not power on/off the TV reliably anymore.

Environment details:

  • Environment (HASSIO, on a Intel NUC
  • Home Assistant version installed: 0.110.1
  • Component version installed: 0.3.0
  • Last know working version: ? (previous version)
  • TV model: Samsung Q90R

I use this TV network and HDMI only, NO TV channels active via cable or satellite.

Output of HA logs

Logger: homeassistant.components.websocket_api.http.connection.140449134994960
Source: custom_components/samsungtv_smart/api/samsungws.py:638
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 16:16:52 (7 occurrences)
Last logged: 16:27:39

{'event': 'ms.channel.unauthorized'}
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 130, in handle_call_service
    connection.context(msg),
  File "/usr/src/homeassistant/homeassistant/core.py", line 1253, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1288, in _execute_service
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service
    self._platforms.values(), func, call, required_features
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 453, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 597, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 484, in _handle_entity_call
    await result
  File "/config/custom_components/samsungtv_smart/media_player.py", line 783, in async_turn_off
    await self.hass.async_add_executor_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_smart/media_player.py", line 777, in _turn_off
    self.send_command("KEY_POWER")
  File "/config/custom_components/samsungtv_smart/media_player.py", line 592, in send_command
    key_code, key_press_delay, "Press" if press else "Click"
  File "/config/custom_components/samsungtv_smart/api/samsungws.py", line 662, in send_key
    key_press_delay,
  File "/config/custom_components/samsungtv_smart/api/samsungws.py", line 243, in _ws_send
    connection = self.open()
  File "/config/custom_components/samsungtv_smart/api/samsungws.py", line 638, in open
    raise exceptions.ConnectionFailure(response)
custom_components.samsungtv_smart.api.exceptions.ConnectionFailure: {'event': 'ms.channel.unauthorized'}

SmartThings information issues

Hi Ollo,

I follow all steps (several times) but can't connect with my Samsung Q55 when I try to use the SmartThing token.
I can connect properly if keep blank the token field. But I need to use SmartThings Keys...

When I try to connect with the TV it ask meif I want grant access to HA, fine. But later HA shows the message "Wrong SmartThings token or TV not registered in SmartThings." and the integration is never done.
But the file token-192.168.0.10.txt are created and have an 8 digits number. I delete this file each time that I try to connect with a new token.

I have my iPhone connected to the TV, so ST works. No?
The TV is registered in Samsung ST. I know it because I can see the events list of my TV in Samsung web (Turned ON at this time, switched to HDMI2...).
I tried deleting and generating new tokens, don't works.
No log to show, home-assistant.log file don't have anything about this connection.

Any ideas?

unable to find device on smartthings during configuration

Hello, I've tried to set up my Samsung TV following your guide, everything went as it was supposed to, but when I try to add the device to my home assistant integrations page, I get the error saying that my device was not found.

One thing I noticed during setup was that the address you provide to list our smartthings devices: https://graph-eu01-euwest1.api.smartthings.com/device/list does not list devices, and this one: https://graph-na04-useast2.api.smartthings.com/device/list does list.

maybe this is just a regionalization thing from smartthings but it is getting in the way of this nice integration to work.

I'm available to help test anything you need.

Thanks in advance

Integration doesn't show up on the new integrations button

Describe the bug
I've trying to install this component on 0.118.5, but the integration is not showing up on new integrations options like described in the readme:

From the Home Assistant front-end, navigate to 'Configuration' then 'Integrations'. Click + button in bottom right corner, search 'SamsungTV Smart', and click 'Configure'.

I can't find SamsungTV Smart, and I already have rebooted.

Expected behavior
To see the integration

Screenshots
image

Environment details:

  • Environment (HASSIO, Raspbian, etc): HASSIO
  • Home Assistant version installed: 0.108.5
  • Component version installed: v0.3.15
  • Last know working version:
  • TV model: 55TU8000

Aditional Info

Already tried to insert it directly on configuration.yaml but none media_player entity was created

samsungtv_smart:
  - host: 192.168.100.xxx
    name: Samsung Series 8
    api_key: XXXXXXXX-xxxx-xxxx-xxxx-XXXXXXXXXXXX

Another unable to connect :(

Hey guys,

So I try to setup the integration (frontend). Put in my Smart Things key and all.
Next page asks which TV (I have 2 connected).
The permission popups up on tv, I immediately select it

The integration says it couldn't connect.
Tried this on both TVs, 1 is RU7100 (65") the other is NU8000 (82")
Tried it with all permitted devices deleted from TV.
When I press allow on the tv, I can see the HA device has been allowed and the unique name that I put into this components setup is there.

The component shows "Unable to connect to this Samsung TV device."
I check the token file and there's nothing inside...
Is there a way to request token manually to see if that helps?

Nothing in HA logs

The TV is on the same subnet and it's not on a separate vlan
Using Unifi gear (if that helps)

The default samsung integration does work for me but as we all know it's very basic and I'd like HA to know when content is "playing" or "idle". That's the main thing for me

Thank you

TV state is regularly changing, even without any actions

Describe the bug
I have NU8042 and I found some weird stuff going on with the state of my TV.
My logs show that every ~25 mins the TV's state changes to "on" and after around 30s back to the "off" state. It happens without any human action, for example during the night.

(Figured this out when I had set an automation to turn off my main light after the TV is turned on - my light was randomly switching off during the day without touching the TV :D)

Expected behavior
TV state should change only when I actually turn on/off my TV.

Screenshots
image

Environment details:

  • Rasbian, Home Assistant as a standalone
  • Home Assistant version installed: 0.109.1
  • Component version installed: v0.3.2 (was happening also before)
  • Last know working version: none
  • TV model: NU8042

Output of HA logs
Check the screen above

My config

samsungtv_smart:
  -  host: 192.168.0.105
     update_method: ping
     source_list: '{"ENTER": "KEY_ENTER", "TV": "KEY_TV", "HDMI": "KEY_HDMI1" }'

Error: Wrong SmartThings token.

Hi. I tried your plugin.
But i get this error (Wrong SmartThings token.)
I have generated several tokens but no one is working.

AppList always updating

The Applist is always updating to all available apps. However, I don't want this behaviour. I want the applist to be empty.
My configuration.yaml:

samsungtv_smart:
  - host: 192.168.253.40 
    source_list: '{"TV":"KEY_EXIT+2000+KEY_TV+1000+KEY_EXIT", "Ambient":"KEY_AMBIENT+5000+KEY_RETURN", "Denon AVR":"KEY_HDMI+1000+KEY_EXIT"}'
    app_list: '{}'
    load_all_apps: false
    show_channel_number: True

By the way, deleting the auto-created applist-192.168.253.40.txt in the samsungtv_smart directory or filling it with an empty applist did not change anything.
The option "load_all_apps" does not change the behavior in any way.

Endless confirmation requests

Hey. Thanks for the cool component and your work! I have a Samsung UE75NU7100U, I connected the component via the web interface. Specified SmartThings token, everything works. Volume control, channels, I can turn it on and off, I also get information about the status. But before almost every action, a permission request appears on the TV. Even if you do nothing, the request appears every 5-7 seconds, as long as HomeAssistant is running. How to solve this problem? I am ready to provide any information.

TV channel names

Hi Ollo69,
Your integration works well but TV channel names doesn’t update. the name of the tv channel that was tuned when I inserted the tv in smarttings always remains. the same problem appears with the samsung tizen integration
My tv is q7fn series 2018. Configuration with token

Unable to Connect

Hello,

I've been trying to get this working with my TV (UN82MU8000FXZA) and no matter what I do I just get "Unable to connect to this Samsung TV device.". I used wscat to get a token manually and added that to text file hoping it would work, but same message. I have also tried it with SmartThings Key, same results. Any help would be appreciated.

Here is the log:

2020-03-31 18:03:51 DEBUG (SyncWorker_2) [custom_components.samsungtv_smart] Try config with port: 8001
2020-03-31 18:03:51 DEBUG (SyncWorker_2) [custom_components.samsungtv_smart.websockets] WS url ws://192.168.0.65:8001/api/v2/channels/samsung.remote.control?name=W0hvbWUgQXNzaXN0YW50XSBMaXZpbmcgUm9vbSBUVg==
2020-03-31 18:03:51 DEBUG (SyncWorker_2) [custom_components.samsungtv_smart.websockets] Connection closed.
2020-03-31 18:03:51 DEBUG (SyncWorker_2) [custom_components.samsungtv_smart] Working but unsupported config on port: 8001
2020-03-31 18:03:51 DEBUG (SyncWorker_2) [custom_components.samsungtv_smart] Try config with port: 8002
2020-03-31 18:03:51 DEBUG (SyncWorker_2) [custom_components.samsungtv_smart.websockets] WS url wss://192.168.0.65:8002/api/v2/channels/samsung.remote.control?name=W0hvbWUgQXNzaXN0YW50XSBMaXZpbmcgUm9vbSBUVg==&token=
2020-03-31 18:03:52 DEBUG (SyncWorker_2) [custom_components.samsungtv_smart.websockets] Connection closed.
2020-03-31 18:03:52 DEBUG (SyncWorker_2) [custom_components.samsungtv_smart] Working but unsupported config on port: 8002
2020-03-31 18:06:50 DEBUG (SyncWorker_11) [custom_components.samsungtv_smart] Try config with port: 8001
2020-03-31 18:06:50 DEBUG (SyncWorker_11) [custom_components.samsungtv_smart.websockets] WS url ws://192.168.0.65:8001/api/v2/channels/samsung.remote.control?name=W0hvbWUgQXNzaXN0YW50XSBMaXZpbmcgUm9vbSBTYW1zdW5nIFRW
2020-03-31 18:06:50 DEBUG (SyncWorker_11) [custom_components.samsungtv_smart.websockets] Connection closed.
2020-03-31 18:06:50 DEBUG (SyncWorker_11) [custom_components.samsungtv_smart] Working but unsupported config on port: 8001
2020-03-31 18:06:50 DEBUG (SyncWorker_11) [custom_components.samsungtv_smart] Try config with port: 8002
2020-03-31 18:06:50 DEBUG (SyncWorker_11) [custom_components.samsungtv_smart.websockets] WS url wss://192.168.0.65:8002/api/v2/channels/samsung.remote.control?name=W0hvbWUgQXNzaXN0YW50XSBMaXZpbmcgUm9vbSBTYW1zdW5nIFRW&token=18159156
2020-03-31 18:06:50 DEBUG (SyncWorker_11) [custom_components.samsungtv_smart.websockets] Connection closed.
2020-03-31 18:06:50 DEBUG (SyncWorker_11) [custom_components.samsungtv_smart] Working but unsupported config on port: 8002
2020-03-31 18:07:38 DEBUG (SyncWorker_59) [custom_components.samsungtv_smart] Try config with port: 8001
2020-03-31 18:07:38 DEBUG (SyncWorker_59) [custom_components.samsungtv_smart.websockets] WS url ws://192.168.0.65:8001/api/v2/channels/samsung.remote.control?name=W0hvbWUgQXNzaXN0YW50XSBMaXZpbmcgUm9vbSBTYW1zdW5nIFRW
2020-03-31 18:07:38 DEBUG (SyncWorker_59) [custom_components.samsungtv_smart.websockets] Connection closed.
2020-03-31 18:07:38 DEBUG (SyncWorker_59) [custom_components.samsungtv_smart] Working but unsupported config on port: 8001
2020-03-31 18:07:38 DEBUG (SyncWorker_59) [custom_components.samsungtv_smart] Try config with port: 8002
2020-03-31 18:07:38 DEBUG (SyncWorker_59) [custom_components.samsungtv_smart.websockets] WS url wss://192.168.0.65:8002/api/v2/channels/samsung.remote.control?name=W0hvbWUgQXNzaXN0YW50XSBMaXZpbmcgUm9vbSBTYW1zdW5nIFRW&token=18159156
2020-03-31 18:07:39 DEBUG (SyncWorker_59) [custom_components.samsungtv_smart.websockets] Connection closed.
2020-03-31 18:07:39 DEBUG (SyncWorker_59) [custom_components.samsungtv_smart] Working but unsupported config on port: 8002

Error in the log: "SamsungTV Smart - Detected fake power on, status not updated"

Describe the bug
Always get this error in the log:

Logger: custom_components.samsungtv_smart.media_player
Source: custom_components/samsungtv_smart/media_player.py:643
Integration: SamsungTV Smart (documentation)
First occurred: 14:11:23 (1 occurrences)
Last logged: 14:11:23

SamsungTV Smart - Detected fake power on, status not updated

Expected behavior
If applicable, a clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment details:

  • Environment (HASSIO, Raspbian, etc): HA in Docker
  • Home Assistant version installed: Latest 0.115.2
  • Component version installed: latest
  • Last know working version: don't know
  • TV model: Samsung Q65

Output of HA logs
Paste the relavant output of the HA log here.

Logger: custom_components.samsungtv_smart.media_player
Source: custom_components/samsungtv_smart/media_player.py:643
Integration: SamsungTV Smart (documentation)
First occurred: 14:11:23 (1 occurrences)
Last logged: 14:11:23

SamsungTV Smart - Detected fake power on, status not updated

Additional context
Add any other context about the problem here.

Before it is working good but the last update after have problem.

The state always switch back on while the tv is turned off.
If I turn off in home assistant about 20 sec after turn back on again automatically. But only the media card and the state show that the TV turned on.
The TV phisically isn't turning on.

`Logger: homeassistant.components.websocket_api.http.connection.139657926660752
Source: custom_components/samsungtv_smart/api/samsungws.py:204
Integration: websocket_api (documentation, issues)
First occurred: 12:02:08 (1 occurrences)
Last logged: 12:02:08

socket is already closed.
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 134, in handle_call_service
connection.context(msg),
File "/usr/src/homeassistant/homeassistant/core.py", line 1232, in async_call
await asyncio.shield(self._execute_service(handler, service_call))
File "/usr/src/homeassistant/homeassistant/core.py", line 1255, in _execute_service
await handler.func(service_call)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service
self._platforms.values(), func, call, required_features
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 412, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 600, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 443, in _handle_entity_call
await result
File "/config/custom_components/samsungtv_smart/media_player.py", line 782, in async_turn_off
await self.async_send_command("KEY_POWER")
File "/config/custom_components/samsungtv_smart/media_player.py", line 621, in async_send_command
self.send_command, payload, command_type, retry_count, key_press_delay
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_smart/media_player.py", line 592, in send_command
self._ws.send_key(payload, key_press_delay)
File "/config/custom_components/samsungtv_smart/api/samsungws.py", line 484, in send_key
key_press_delay,
File "/config/custom_components/samsungtv_smart/api/samsungws.py", line 204, in _ws_send
connection.send(payload)
File "/usr/local/lib/python3.7/site-packages/websocket/_app.py", line 153, in send
if not self.sock or self.sock.send(data, opcode) == 0:
File "/usr/local/lib/python3.7/site-packages/websocket/_core.py", line 253, in send
return self.send_frame(frame)
File "/usr/local/lib/python3.7/site-packages/websocket/_core.py", line 278, in send_frame
l = self._send(data)
File "/usr/local/lib/python3.7/site-packages/websocket/_core.py", line 448, in _send
return send(self.sock, data)
File "/usr/local/lib/python3.7/site-packages/websocket/_socket.py", line 135, in send
raise WebSocketConnectionClosedException("socket is already closed.")
websocket._exceptions.WebSocketConnectionClosedException: socket is already closed.`

My TV keeps asking me to authorize

I love your integration. It works beautifully. However, every time I turn the TV on it asks me to authorize. Is that something to do with the integration, or a TV thing please? I have a UN55MU7100.

TV Control not working UN82MU8000

Hi,

I was able to pair my TV successfully (UN82MU8000), but when I try to control it (Power On/Off, etc.) nothing happens. I've tried removing integration and devices from TV and repairing, but no luck. I do not see anything in the log file, but I'll set to debug and see if there are any clues there.

Thanks,
Cody

compatibile with THE FRAME 2020 QE55LS03TAUXZT

I would integrate HA with THE FRAME 2020 QE55LS03TAUXZT

I would start and stop TV, change channel and volume...

I installed this integration via HACS, but I'm not able to integrate it...

Add any other context or screenshots about the feature request here.

this is already compatibile with THE FRAME 2020 QE55LS03TAUXZT?

can you help me?

Not working for (UE40)MU6000 series: Unable to add

Describe the bug

I can't configure my Smart TV Samsung UE40MU6470.
Trying to add using the web interface I receive the message: "Unknown error occurred"

Environment details:

  • Environment: HASSIO
  • Home Assistant version installed: 0.115.1
  • Component version installed: v0.3.13
  • Last know working version: with another custom_components (I don't remember which one)
  • TV model: UE40MU6470

The IP address inserted in the form was correct (I checked it in the dashboard router).
I repeated to add it with and without "SmartThings token".

Output of HA logs

I enabled the debug log in Home Assistant; here it is:
2020-09-19 18:55:26 DEBUG (MainThread) [custom_components.samsungtv_smart.api.smartthings] SmartThings available devices: {'items': [{'deviceId': 'xxxxx', 'name': "xxx's xxxx", 'label': "xxxx's xxxx", 'manufacturerName': 'SmartThings', 'presentationId': 'SmartThings-smartthings-Mobile_Presence', 'locationId': 'xxxxx', 'ownerId': 'xxxx', 'deviceTypeId': '8a9d4b1e3bfce38a013bfce42d360015', 'deviceTypeName': 'Mobile Presence', 'deviceNetworkType': 'UNKNOWN', 'components': [{'id': 'main', 'capabilities': [{'id': 'presenceSensor', 'version': 1}, {'id': 'sensor', 'version': 1}, {'id': 'occupancySensor', 'version': 1}], 'categories': [{'name': 'MobilePresence'}]}], 'dth': {'deviceTypeId': '8a9d4b1e3bfce38a013bfce42d360015', 'deviceTypeName': 'Mobile Presence', 'deviceNetworkType': 'UNKNOWN', 'completedSetup': False, 'networkSecurityLevel': 'UNKNOWN'}, 'type': 'DTH', 'restrictionTier': 0}, {'deviceId': 'xxxxx', 'name': '[TV] Samsung 6 Series (40)', 'label': '[TV] Samsung 6 Series (40)', 'presentationId': 'VD-STV_2017_K', 'locationId': 'xxxx', 'roomId': 'xxxx', 'components': [{'id': 'main', 'capabilities': [{'id': 'switch', 'version': 1}, {'id': 'audioVolume', 'version': 1}, {'id': 'audioMute', 'version': 1}, {'id': 'tvChannel', 'version': 1}, {'id': 'mediaInputSource', 'version': 1}, {'id': 'mediaPlayback', 'version': 1}, {'id': 'custom.picturemode', 'version': 1}, {'id': 'custom.error', 'version': 1}, {'id': 'custom.soundmode', 'version': 1}, {'id': 'custom.accessibility', 'version': 1}, {'id': 'custom.launchapp', 'version': 1}, {'id': 'custom.recording', 'version': 1}, {'id': 'custom.tvsearch', 'version': 1}, {'id': 'samsungtv.firmwareVersion', 'version': 1}, {'id': 'samsungtv.supportsPowerOnByOcf', 'version': 1}, {'id': 'refresh', 'version': 1}, {'id': 'execute', 'version': 1}, {'id': 'ocf', 'version': 1}, {'id': 'mediaTrackControl', 'version': 1}], 'categories': [{'name': 'Other'}]}], 'profile': {'id': 'xxxxx'}, 'type': 'OCF', 'restrictionTier': 0}], '_links': {}}
2020-09-19 18:55:26 INFO (MainThread) [custom_components.samsungtv_smart.api.smartthings] SmartThings discovered TV devices: {'xxxxxx': {'name': '[TV] Samsung 6 Series (40)', 'label': '[TV] Samsung 6 Series (40)'}}
2020-09-19 18:55:26 DEBUG (SyncWorker_19) [custom_components.samsungtv_smart] Try config with port: 8001
2020-09-19 18:55:26 DEBUG (SyncWorker_19) [custom_components.samsungtv_smart.api.samsungws] WS url ws://192.168.0.6:8001/api/v2/channels/samsung.remote.control?name=W0hvbWUgQXNzaXN0YW50XSBIb21l
2020-09-19 18:56:11 DEBUG (SyncWorker_19) [custom_components.samsungtv_smart] Failing config with port: 8001, error: timed out
2020-09-19 18:56:11 DEBUG (SyncWorker_19) [custom_components.samsungtv_smart] Try config with port: 8002
2020-09-19 18:56:11 DEBUG (SyncWorker_19) [custom_components.samsungtv_smart.api.samsungws] WS url wss://192.168.0.6:8002/api/v2/channels/samsung.remote.control?name=W0hvbWUgQXNzaXN0YW50XSBIb21l
2020-09-19 18:56:22 ERROR (MainThread) [homeassistant.components.ipp] Error fetching ipp data: Invalid response from API: Error occurred while communicating with IPP server.
2020-09-19 18:56:56 DEBUG (SyncWorker_19) [custom_components.samsungtv_smart] Failing config with port: 8002, error: The read operation timed out

state looses sync after turning TV OFF via IR / HDMI CEC (turn on slow to detect also)

version 0.2.1
tv model: UN58NU7100
tv connected to LAN via wifi
smartthings api setup: YES.

When turning on TV via IR remote or HDMI CEC (kodi running on rpi4 connected to TV - wake from screensaver typically when pressing a button) the integration is very slow to react and show state change, typically about a minute or two - is this normal (something like a ping/pull delay)? if so - that is OK.

The more concerning issue is that when TV is turned off via HDMI CEC or by IR the integration seems to will lose sync with the actual TV..... and the TV state will show "on" in HA, but its actually off.

I have tried turning the TV off via HDMI CEC or IR remote and waiting a few minutes but the status never changes - then if i control the TV through HA to turn it "off" even though it's already off, the now TV turns on but the act of turning off in HA now means the integration believes TV is off....

anyone else see this issue?
FYI, My main goal with this integration is not so much to CONTROL the TV from HA - I have HDMI CEC and my own remotes to control the TV.... my goal is to get an accurate STATE of whether the TV is actually on or off, but so far it is not reliable and looking to see if anyone has advice.

Thanks.

Problems turning off the TV

The problem

When I try to switch off my TV from Home Assistant nothing happens on my TV. If I call directly the services media_player.turn_off or media_player.toggle the problem persists, if I send directly the KEY_POWER using the service media_player.play_media it always work perfectly.

Environment

  • Home Assistant Core release: 0.107.7
  • Operating environment: docker
  • SamsungTV Smart Integration release: v0.1.13
  • TV model: KU6500
  • SmartThings integration configured
  • Problem-relevant configuration.yaml:
default_config:

http:
  base_url: http://192.168.1.XXX:8123
  ip_ban_enabled: true
  login_attempts_threshold: 3

wake_on_lan:

samsungtv_smart:
  - host: 192.168.1.YYY
    app_list: '{"Plex": "3201512006963/KIciSQlYEM.Plex", "RaiPlay": "5im3FztIhW.RaiTVtizen", "YouTube": "111299001912/9Ur5IzDKqV.TizenYouTube", "Prime Video": "3201512006785/org.tizen.ignition", "TuneIn": "tisT7SVUug.tunein"}'
    show_channel_number: true

Traceback/Error logs

Calling media_player.turn_off service >> NOT WORKING

2020-04-15 15:57:00 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection.140xxxx6068xxxx] Received {'type': 'call_service', 'domain': 'media_player', 'service': 'turn_off', 'service_data': {'entity_id': 'media_player.tv'}, 'id': 28}
2020-04-15 15:57:00 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=media_player, service=turn_off, service_data=entity_id=media_player.tv>
2020-04-15 15:57:00 DEBUG (SyncWorker_0) [custom_components.samsungtv_smart.api.samsungws] Connection closed.
2020-04-15 15:57:00 DEBUG (SyncWorker_0) [custom_components.samsungtv_smart.api.samsungws] Sending key KEY_POWER
2020-04-15 15:57:00 DEBUG (SyncWorker_0) [custom_components.samsungtv_smart.api.samsungws] WS url ws://192.168.1.ZZZ:8001/api/v2/channels/samsung.remote.control?name=W0hvbWUgQXNxxxxxxxxxxxxxxx==
2020-04-15 15:57:00 DEBUG (SyncWorker_0) [custom_components.samsungtv_smart.api.samsungws] Connection closed.
2020-04-15 15:57:00 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=media_player.tv, old_state=<state media_player.tv=on; source_list=['digitalTv', 'Plex', 'RaiPlay', 'YouTube', 'Prime Video', 'TuneIn'], volume_level=0.0, is_volume_muted=False, media_content_type=channel, media_title=Italia1 HD (506), media_channel=506, app_id=TV/HDMI, source=digitalTv, friendly_name=TV, icon=mdi:television, supported_features=24509, device_class=tv @ 2020-04-15T15:54:44.677218+02:00>, new_state=<state media_player.tv=off; friendly_name=TV, icon=mdi:television, supported_features=24509, device_class=tv @ 2020-04-15T15:57:00.756846+02:00>>
2020-04-15 15:57:00 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection.140xxxx6068xxxx] Sending {'id': 2, 'type': 'event', 'event': <Event state_changed[L]: entity_id=media_player.tv, old_state=<state media_player.tv=on; source_list=['digitalTv', 'Plex', 'RaiPlay', 'YouTube', 'Prime Video', 'TuneIn'], volume_level=0.0, is_volume_muted=False, media_content_type=channel, media_title=Italia1 HD (506), media_channel=506, app_id=TV/HDMI, source=digitalTv, friendly_name=TV, icon=mdi:television, supported_features=24509, device_class=tv @ 2020-04-15T15:54:44.677218+02:00>, new_state=<state media_player.tv=off; friendly_name=TV, icon=mdi:television, supported_features=24509, device_class=tv @ 2020-04-15T15:57:00.756846+02:00>>}
2020-04-15 15:57:00 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection.140xxxx6068xxxx] Sending {'id': 28, 'type': 'result', 'success': True, 'result': {'context': Context(user_id='0df1c041a2e4xxxxxxxxxxxxxxxxxxxx', parent_id=None, id='dbfe1937299dxxxxxxxxxxxxxxxxxxxx')}}

Calling media_player.toggle service >> NOT WORKING

2020-04-15 16:00:06 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection.140xxxx6068xxxx] Received {'type': 'call_service', 'domain': 'media_player', 'service': 'toggle', 'service_data': {'entity_id': 'media_player.tv'}, 'id': 29}
2020-04-15 16:00:06 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=media_player, service=toggle, service_data=entity_id=media_player.tv>
2020-04-15 16:00:06 DEBUG (SyncWorker_13) [custom_components.samsungtv_smart.api.samsungws] Connection closed.
2020-04-15 16:00:06 DEBUG (SyncWorker_13) [custom_components.samsungtv_smart.api.samsungws] Sending key KEY_POWER
2020-04-15 16:00:06 DEBUG (SyncWorker_13) [custom_components.samsungtv_smart.api.samsungws] WS url ws://192.168.1.ZZZ:8001/api/v2/channels/samsung.remote.control?name=W0hvbWUgQXNxxxxxxxxxxxxxxx==
2020-04-15 16:00:06 DEBUG (SyncWorker_13) [custom_components.samsungtv_smart.api.samsungws] Connection closed.
2020-04-15 16:00:06 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=media_player.tv, old_state=<state media_player.tv=on; source_list=['digitalTv', 'Plex', 'RaiPlay', 'YouTube', 'Prime Video', 'TuneIn'], volume_level=0.0, is_volume_muted=False, media_content_type=channel, media_title=Italia1 HD (506), media_channel=506, app_id=TV/HDMI, source=digitalTv, friendly_name=TV, icon=mdi:television, supported_features=24509, device_class=tv @ 2020-04-15T15:57:24.816900+02:00>, new_state=<state media_player.tv=off; friendly_name=TV, icon=mdi:television, supported_features=24509, device_class=tv @ 2020-04-15T16:00:06.918805+02:00>>
2020-04-15 16:00:06 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection.140xxxx6068xxxx] Sending {'id': 2, 'type': 'event', 'event': <Event state_changed[L]: entity_id=media_player.tv, old_state=<state media_player.tv=on; source_list=['digitalTv', 'Plex', 'RaiPlay', 'YouTube', 'Prime Video', 'TuneIn'], volume_level=0.0, is_volume_muted=False, media_content_type=channel, media_title=Italia1 HD (506), media_channel=506, app_id=TV/HDMI, source=digitalTv, friendly_name=TV, icon=mdi:television, supported_features=24509, device_class=tv @ 2020-04-15T15:57:24.816900+02:00>, new_state=<state media_player.tv=off; friendly_name=TV, icon=mdi:television, supported_features=24509, device_class=tv @ 2020-04-15T16:00:06.918805+02:00>>}
2020-04-15 16:00:06 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection.140xxxx6068xxxx] Sending {'id': 29, 'type': 'result', 'success': True, 'result': {'context': Context(user_id='0df1c041a2e4xxxxxxxxxxxxxxxxxxxx', parent_id=None, id='c68629ea24654223b5bfc3f793bc4c6d')}}

Sending KEY_POWER directly >> WORKING

2020-04-15 16:04:20 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection.140xxxx6068xxxx] Received {'type': 'call_service', 'domain': 'media_player', 'service': 'play_media', 'service_data': {'entity_id': 'media_player.tv', 'media_content_type': 'send_key', 'media_content_id': 'KEY_POWER'}, 'id': 34}
2020-04-15 16:04:20 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=media_player, service=play_media, service_data=entity_id=media_player.tv, media_content_type=send_key, media_content_id=KEY_POWER>
2020-04-15 16:04:20 DEBUG (SyncWorker_7) [custom_components.samsungtv_smart.api.samsungws] Connection closed.
2020-04-15 16:04:20 DEBUG (SyncWorker_7) [custom_components.samsungtv_smart.api.samsungws] Sending key KEY_POWER
2020-04-15 16:04:20 DEBUG (SyncWorker_7) [custom_components.samsungtv_smart.api.samsungws] WS url ws://192.168.1.ZZZ:8001/api/v2/channels/samsung.remote.control?name=W0hvbWUgQXNxxxxxxxxxxxxxxx==
2020-04-15 16:04:20 DEBUG (MainThread) [custom_components.samsungtv_smart.media_player] Start getting running app...
2020-04-15 16:04:20 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection.140xxxx6068xxxx] Sending {'id': 34, 'type': 'result', 'success': True, 'result': {'context': Context(user_id='0df1c041a2e4xxxxxxxxxxxxxxxxxxxx', parent_id=None, id='dd4e1cce531049f396c57fd258c70b90')}}
2020-04-15 16:04:20 DEBUG (MainThread) [custom_components.samsungtv_smart.media_player] ... end getting app list - no app found.
2020-04-15 16:04:27 DEBUG (MainThread) [homeassistant.helpers.restore_state] Dumping states
2020-04-15 16:04:27 DEBUG (SyncWorker_18) [homeassistant.helpers.storage] Writing data for core.restore_state

Not cycling on/off or displaying state correctly with "The Frame" TV

Using this with a 2019 QE43LS03, one of the "frame" TVs. These have something Samsung calls art mode (not ambient mode). The power button cycles between normal TV on --> art mode on --> off. Long pressing the power button goes straight from normal to off. There's also a menu option to turn art mode on.

This component seems to be confused by the art mode -- it consistently misreports the state (although it does sometimes display "art mode"), and on/off doesn't have a predictable response, sometimes turning on, sometimes off, sometimes art, etc. I can't seem to see a pattern.

I can't work out if art mode is an app or something else. It has its own power settings etc so seems to be a second power state, but looking at the device events in the SmartThings API, it shows the following:

tv

websocket._exceptions.WebSocketConnectionClosedException: Connection is already closed.

Describe the bug
This is an older (2016) model, and it seems to close the websocket connection when the TV is turned off.

This causes an exception when the TV is turned back on:

Also, the TV is not detected as "on" after this happens:

2020-09-01 20:57:59 WARNING (MainThread) [custom_components.samsungtv_smart.media_player] SamsungTV Smart - Detected fake power on, status not updated                                        

I lowered the "Delay power on" to 0 seconds, to see if that helps.

Expected behavior

On and off state should be detected without exceptions

Screenshots
If applicable, add screenshots to help explain your problem.

Environment details:

  • Environment (HASSIO, Raspbian, etc): HA Core
  • Home Assistant version installed: 0.114.4
  • Component version installed: Latest from HACS
  • Last know working version:
  • TV model: UE55KS7005

Output of HA logs
Paste the relavant output of the HA log here.

2020-09-01 20:56:15 ERROR (MainThread) [homeassistant.helpers.entity] Update for media_player.stue_tv fails
Traceback (most recent call last):                                                                                                                                                            
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 263, in async_update_ha_state
    await self.async_device_update()                                                                                                                                                          
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 454, in async_device_update                                                                                             
    await self.async_update()  # type: ignore                                                                                                                                                 
  File "/config/custom_components/samsungtv_smart/media_player.py", line 631, in async_update                                                                                                 
    result = await self.hass.async_add_executor_job(self._ping_device)                                                                                                                        
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run                                                                                                               
    result = self.fn(*self.args, **self.kwargs)                                                                                                                                               
  File "/config/custom_components/samsungtv_smart/media_player.py", line 408, in _ping_device                                                                                                 
    self._ws.get_running_app()                                                                                                                                                                
  File "/config/custom_components/samsungtv_smart/api/samsungws.py", line 672, in get_running_app                                                                                             
    self._get_app_status(app.app_id, app.app_type)                                                                                                                                            
  File "/config/custom_components/samsungtv_smart/api/samsungws.py", line 498, in _get_app_status                                                                                             
    self._ws_send(                                                                                                                                                                            
  File "/config/custom_components/samsungtv_smart/api/samsungws.py", line 256, in _ws_send                                                                                                    
    connection.send(payload)                                                                                                                                                                  
  File "/usr/local/lib/python3.8/site-packages/websocket/_app.py", line 154, in send                                                                                                          
    raise WebSocketConnectionClosedException(                                                                                                                                                 
websocket._exceptions.WebSocketConnectionClosedException: Connection is already closed.           

Additional context
Add any other context about the problem here.

TV state flipping to On every 25 mins even when TV is off

Describe the bug
The state of the tv flips to On and then Off every 25 mins even when TV is off. This is causing issue with automations based on TV state

Expected behavior
I would expect the state of the entity to match the actual TV

Screenshots
https://imgur.com/a/dRvoLB7

Environment details:

  • Environment (HASSIO, Raspbian, etc): hassio
  • Home Assistant version installed: 0.110.4
  • Component version installed: 0.3.4
  • Last know working version:
  • TV model: Samsung Q6 series

Output of HA logs
Paste the relavant output of the HA log here.


Additional context
Add any other context about the problem here.

Failed to call service media_player/turn_on. Incorrect MAC address format

In the latest 2 releases (0.3.7 and 0.3.6, everything works in 0.3.5) whenever I try to turn on my Samsung 2017 Q7F (only this TV, tested others and they work) I get "Failed to call service media_player/turn_on. Incorrect MAC address format" in the bottom left of the screen.
If I manually turn on the TV the status does not update at all from off with this specific TV
Running Latest Home Assistant Core in docker (0.112.4)

Error Log:

Log Details (ERROR)
Logger: homeassistant.components.websocket_api.http.connection.23432547509200
Source: custom_components/samsungtv_smart/media_player.py:821
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 10:06:09 AM (3 occurrences)
Last logged: 10:08:38 AM

Incorrect MAC address format
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 130, in handle_call_service
connection.context(msg),
File "/usr/src/homeassistant/homeassistant/core.py", line 1260, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1295, in _execute_service
await handler.func(service_call)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 209, in handle_service
self._platforms.values(), func, call, required_features
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 454, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 595, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 485, in _handle_entity_call
await result
File "/config/custom_components/samsungtv_smart/media_player.py", line 826, in async_turn_on
await self.hass.async_add_executor_job(self._turn_on)
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_smart/media_player.py", line 821, in _turn_on
send_magic_packet(self._mac)
File "/usr/local/lib/python3.7/site-packages/wakeonlan.py", line 74, in send_magic_packet
packet = create_magic_packet(mac)
File "/usr/local/lib/python3.7/site-packages/wakeonlan.py", line 38, in create_magic_packet
raise ValueError('Incorrect MAC address format')
ValueError: Incorrect MAC address format

send_key not always working

Hi there,
I use your great plugin with smartThings key

From services:
media_player.play_media

entity_id: media_player.tv
media_content_type: "send_key"
media_content_id: KEY_POWER

it works (some times) only if the tv is on. The key KEY_POWERON/KEY_POWEROFF never works

Expected behavior
It always work , I need to switch on the tv with a script

Environment details:

  • Environment (HASSIO)

each action getting error

Hi there, just installed.
every action i make i get this:
Failed to call service media_player/volume_set. can only concatenate str (not "NoneType") to str

also the status is always off.

Is it also possible to get the current channel i Am viewing?
thanks

connect not successful

Hi,
I can't connect the tv.
I try first using the web UI, but the error is the same: not_successful

2020-03-28 09:06:26 ERROR (MainThread) [custom_components.samsungtv_smart.config_flow] Error during setup of host 192.168.1.107 using configuration.yaml info. Reason: not_successful

HA and TV are on different subnets, but there is no firewall between them.
Where do you think the problem may be?
thx

Error in the log

Hi.
I catched some errors in the log.
Maybe it is useful for you?

Logger: homeassistant.core
Source: custom_components/samsungtv_smart/websockets.py:152
First occurred: 6:01:25 (1 occurrences) 
Last logged: 6:01:25

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/core.py", line 1257, 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 599, 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 710, in async_toggle
    await self.async_turn_off()
  File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 526, 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_smart/media_player.py", line 651, in turn_off
    self.send_command("KEY_POWER")
  File "/config/custom_components/samsungtv_smart/media_player.py", line 497, in send_command
    self._ws.send_key(payload, key_press_delay)
  File "/config/custom_components/samsungtv_smart/websockets.py", line 181, in send_key
    key_press_delay
  File "/config/custom_components/samsungtv_smart/websockets.py", line 109, in _ws_send
    self.open()
  File "/config/custom_components/samsungtv_smart/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.
Logger: homeassistant.helpers.entity
Source: custom_components/samsungtv_smart/smartthings.py:216
First occurred: 8:30:06 (1 occurrences) 
Last logged: 8:30:06

Update for media_player.fernseher_wohnzimmer fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 474, in async_device_update
    await self.async_update()
  File "/config/custom_components/samsungtv_smart/media_player.py", line 467, in async_update
    await self._st.async_device_update()
  File "/config/custom_components/samsungtv_smart/smartthings.py", line 216, in async_device_update
    raise_for_status=True,
  File "/usr/local/lib/python3.7/site-packages/aiohttp/client.py", line 1012, in __aenter__
    self._resp = await self._coro
  File "/usr/local/lib/python3.7/site-packages/aiohttp/client.py", line 588, in _request
    resp.raise_for_status()
  File "/usr/local/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 946, in raise_for_status
    headers=self.headers)
aiohttp.client_exceptions.ClientResponseError: 500, message='Internal Server Error', url='https://api.smartthings.com/v1/devices/xxxxxxxxxxxxxxx/states
Logger: custom_components.samsungtv_smart.media_player
Source: custom_components/samsungtv_smart/media_player.py:469
First occurred: 11:28:59 (1 occurrences) 
Last logged: 11:28:59

Samsung TV - Error refreshing from SmartThings
Logger: custom_components.samsungtv_smart.media_player
Source: custom_components/samsungtv_smart/media_player.py:313
First occurred: 6:08:33 (4 occurrences) 
Last logged: 11:48:19

Error getting HTTP info for app: Netflix
Error getting HTTP info for app: AccuWeather
Error getting HTTP info for app: TuneIn

Netflix App Won't Open

Hi there,

I just did a clean install of ha-samsungtv-smart through HACS to my HA to control my Samsung TU8500 TV.
The problem i found is I can't launch Netflix through my source tab in my HA instance.

For additional information, everything else works fine. I configure the app_list manually in my configuration.yaml just like the instructions told me and when I open Netflix manually through my remote, in my HA it would say Netflix, but I'm unable to change source through Netflix through HA. Other apps like YouTube and Spotify that I also configure manually in the app_list works fine.

If there is anything you need, please let me know. I'm sorry for my lack of understanding since I'm pretty new to these things.

[BUG] Mute not honored if done before starting HA

Describe the bug
If TV is switched on and muted before HA starts, the mute status is not synced.

Expected behavior
Sync mute status with SmartThings.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment details:

  • Environment (HASSIO, Raspbian, etc): Docker
  • Home Assistant version installed: 0.133.3
  • Component version installed: v0.3.9
  • Last know working version: -
  • TV model: QE55Q85RATXZT

Output of HA logs
Paste the relevant output of the HA log here.

none

Additional context
Add any other context about the problem here.

Add media playback status

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
There is no way to know if the tv is playing something while in an app or just idle in the app, ex. Am I playing something on netflix, or browsing it?

Describe the solution you'd like
A clear and concise description of what you want to happen.
Adding a playback status to the entity when an app is open, playing, paused, idle, unavailable (while not in an app)

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Error doing job: Task exception was never retrieved - WebSocketProtocolException

With new version 0.1.6 getting this in log when trying to switch off and won;t switch off the TV:

Logger: homeassistant.core
Source: custom_components/samsungtv_smart/websockets.py:152
First occurred: 9:50:11 AM (1 occurrences)
Last logged: 9:50:11 AM

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/core.py", line 1257, 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 599, 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 710, in async_toggle
    await self.async_turn_off()
  File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 526, 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_smart/media_player.py", line 718, in turn_off
    self.send_command("KEY_POWER")
  File "/config/custom_components/samsungtv_smart/media_player.py", line 532, in send_command
    self._ws.send_key(payload, key_press_delay)
  File "/config/custom_components/samsungtv_smart/websockets.py", line 181, in send_key
    key_press_delay
  File "/config/custom_components/samsungtv_smart/websockets.py", line 109, in _ws_send
    self.open()
  File "/config/custom_components/samsungtv_smart/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.

[FR] Use instance name as identification

Describe the bug
Plugin present itself as "HomeAssistant" when asking for connection authorization on the TV.
As I'm running more than 1 instance of HA, I get a lot of extra confirmation on the TV at each HA restart.

Expected behavior
Would be nice if the instance name is used instead of a fixed name.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment details:

  • Environment (HASSIO, Raspbian, etc): Docker
  • Home Assistant version installed: 0.133.3
  • Component version installed: v0.3.9
  • Last know working version: -
  • TV model: QE55Q85RATXZT

Output of HA logs
Paste the relevant output of the HA log here.

none

Additional context
Add any other context about the problem here.

no entity created on first device added

This is my first time reporting something! hope i did it well and thanks for reading me.

Describe the bug
After finishing adding the device trough the ui, the proces is finished and can select “the headline” of my new TV in the integrations panel. However, there is no device and no entity created
Expected behavior
If applicable, a clear and concise description of what you expected to happen.

Environment details:
Environment (HASSIO, Raspbian, etc): Hassio
Home Assistant version installed: 2020.12.1
Component version installed: 0.3.16
TV model: Samsung QE85Q80TATXXC

Output of HA logs
samsungtv_smart: Error on device update!
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 359, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 466, in async_device_update
await task
File "/config/custom_components/samsungtv_smart/media_player.py", line 614, in async_update
await self._st.async_device_update(use_channel_info)
File "/config/custom_components/samsungtv_smart/api/smartthings.py", line 329, in async_device_update
device_all_sources = json.loads(
File "/usr/local/lib/python3.8/json/init.py", line 341, in loads
raise TypeError(f'the JSON object must be str, bytes or bytearray, '
TypeError: the JSON object must be str, bytes or bytearray, not NoneType

When I go to lovelace on the card of mediaplayer I don't see the entity and I don't understand why. Either way I don't see the entity on the entity list.

Thanks for the help

TV name/icon issues on HomeKit

Describe the bug
On iOS13 HomeKit receives the TV icon but the name is set to "Other"
On iOS14 HomeKiti does not get the TV icon and the name is always set to "TV"

Screenshots
iOS13
ios13

iOS14
ios14

Environment details:

  • hassio
  • HassOS 4.13 / Home Assistant 0.115.3
  • Component version installed: v0.3.14
  • Last know working version: ...
  • TV model: UE55MU6172 / UE43RU7102KXXH

Icons for channels

installed, and works perfectly .. Can change my channels, change volume, TV turns on / off .. However, what doesn't work are the channel icons ..

Strange what I see that it is on RTL4 via SmartThings, (app & HA)

Do I miss something?

No entity created on adding device

Describe the bug
After finishing adding the device trough the ui, the proces is finished and can select “the headline” of my new TV in the integrations panel. However, there is no device and no entity created
Expected behavior
If applicable, a clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment details:

  • Environment (HASSIO, Raspbian, etc): Hassio
  • Home Assistant version installed: 0.118.3
  • Component version installed: 0.3.14
  • Last know working version:
  • TV model: Samsung Q60T

Output of HA logs

Logger: homeassistant.components.media_player
Source: custom_components/samsungtv_smart/api/smartthings.py:329
Integration: Mediaspeler (documentation, issues)
First occurred: 20:33:44 (4 occurrences)
Last logged: 20:38:49

samsungtv_smart: Error on device update!
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 359, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 466, in async_device_update
await task
File "/config/custom_components/samsungtv_smart/media_player.py", line 617, in async_update
await self._st.async_device_update(use_channel_info)
File "/config/custom_components/samsungtv_smart/api/smartthings.py", line 329, in async_device_update
device_all_sources = json.loads(
File "/usr/local/lib/python3.8/json/init.py", line 341, in loads
raise TypeError(f'the JSON object must be str, bytes or bytearray, '
TypeError: the JSON object must be str, bytes or bytearray, not NoneType

Additional context
Add any other context about the problem here.

App list not being generated and apps not showing in sources

Clean install of SamsungTV_Smart on Home assistant.

Added the hacs repository, added the integration.
Set up the integration using the UI.
Pop up appeared on TV asking to give Home Assistant access
Restarted HA.

Integration shows media_player.lounge_tv having been created. File in custom components folder are:

.translations
init.py
api (folder)
config_flow.py
const.py
manifest.json
media_player.py
token-192.168.1.138.txt
translations (folder)

Sources available to select are: TV, Hdmi1, Hdmi2, Hdmi3, Hdmi4

No apps are listed anywhere or available for selection

TV model is 2020 QE55Q70TATXXU
HA Core version 0.110.4

Capture

UE48JU7500

is it compatible with this model UE48JU7500?
I see only the on and off state.
i cannot send command and see other state
there is an application myTifi remote on ios that work for the model.
is it possible study this app how work and implement this?

Unsupported _ST source. You must configure SmartThings

Describe the bug
Hi
I've configured the Samsung TVSmart in respecting the processes.
I've defined the host+source_list
I've created the api_key token in the website : https://account.smartthings.com/tokens/new
next I've taken my device id from the smartthings website :

mnsl: http://www.samsung.com/sec/tv/overview/
dmv: res.1.1.0,sh.1.1.0
di: 5bca4702-a71a-44b3-a04f-xxxxxxxxx
mnmo: UE43RU7105KXXC
mnmn: Samsung Electronics
mnos: 4.1.10
mnpv: Tizen 5.0 

and finally add in my config :

`samsungtv_smart:

  • host: 192.168.1.29
    name: Télévision SAMSUNG
    source_list: '{"WDTV": "ST_HDMI1", "PS4": "ST_HDMI2", "TELE": "ST_HDMI3"}'
    api_key: 1b050e01-c71b-4cde-ab1d-xxxxxxxx
    device_id: 5bca4702-a71a-44b3-a04f-xxxxxxxx`

Expected behavior
But when I select in lovelace the WDTV or PS4 or TELE, nothing happened.
Checking the log :

2020-09-21 23:39:49 ERROR (MainThread) [custom_components.samsungtv_smart.media_player] Unsupported _ST source. You must configure SmartThings

Environment details:

  • Environment (HASSIO, Raspbian, etc):
arch armv7l
chassis embedded
dev false
docker true
docker_version 19.03.11
hassio true
host_os HassOS 4.13
installation_type Home Assistant OS
os_name Linux
os_version 4.19.127-v7
python_version 3.8.5
supervisor 245
timezone Europe/Paris
version 0.115.2
virtualenv false
  • Home Assistant version installed: Home Assistant 0.115.2
  • Component version installed: the last !
  • Last know working version: -
  • TV model:UE43RU7105KXXC

I don't understand why this issue because api_key + device_id are defined... Why ST_ couldn't work ?
Thanks for your help !

Incorrect MAC address format

Describe the bug
When trying to turn the TV on I get incorrect MAC address format. I have a The Frame TV 43.

I have tried with and without mac in configuration. I have tried writing the mac as "xx:xx:xx:xx:xx:xx" and "XX:XX:XX:XX:XX:XX" and also with dashes like "XX-XX-XX-XX-XX-XX".

In core.device_registry the mac is set to "None" by the integration, like:

"connections": [
  [
    "mac",
    "None"
  ]
]

Tried changing it to the mac address, like (sot sure if that is correct):

"connections": [
  [
    "mac",
    "address"
  ]
]

Got it to work once, but some upgrades and reboots later I can't get it to work like that either. Not sure which version I got working.

Expected behavior
That it is turned on.

Output of HA logs

Incorrect MAC address format
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 130, in handle_call_service
    connection.context(msg),
  File "/usr/src/homeassistant/homeassistant/core.py", line 1253, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1288, in _execute_service
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service
    self._platforms.values(), func, call, required_features
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 454, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 597, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 485, in _handle_entity_call
    await result
  File "/config/custom_components/samsungtv_smart/media_player.py", line 826, in async_turn_on
    await self.hass.async_add_executor_job(self._turn_on)
  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_smart/media_player.py", line 821, in _turn_on
    send_magic_packet(self._mac)
  File "/usr/local/lib/python3.7/site-packages/wakeonlan.py", line 74, in send_magic_packet
    packet = create_magic_packet(mac)
  File "/usr/local/lib/python3.7/site-packages/wakeonlan.py", line 38, in create_magic_packet
    raise ValueError('Incorrect MAC address format')
ValueError: Incorrect MAC address format

Media Player turns off repeatedly

Works great on a Samsung 6 Series, but if I add another TV, a Samsung Q7 Series, the Q7 turns off repeatedly. If I switch it back on with media_player it works for a short while (10s or so) then turns off.

I've added the Smartthings API token and both TVs are detected and media_players are created in HA

Using the configuration.yaml method to allow me to customise sources and apps.

2020-03-27 13:03:00 INFO (MainThread) [custom_components.samsungtv_smart.media_player] Samsung TV 192.168.1.4:8002 added as 'Bens TV'
2020-03-27 13:03:08 INFO (MainThread) [custom_components.samsungtv_smart.smartthings] SmartThings discovered TV devices: {'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx': {'name': '[TV] Samsung 6 Series (40)', 'label': "Ben's TV"}, 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx': {'name': '[TV] Samsung Q7 Series (65)', 'label': 'TV'}}
2020-03-27 13:03:08 INFO (MainThread) [custom_components.samsungtv_smart.config_flow] Configured new entity TV (SmartThings) with host 192.168.1.22
2020-03-27 13:03:08 INFO (MainThread) [homeassistant.components.media_player] Setting up media_player.samsungtv_smart
2020-03-27 13:03:08 INFO (MainThread) [custom_components.samsungtv_smart.media_player] Samsung TV 192.168.1.22:8002 added as 'TV'
2020-03-27 13:03:08 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new media_player.samsungtv_smart entity: media_player.tv

Homekit Exposition

Hi you did a great JOB !!!! Thanks

Now it's working again (jaruba discontinued ?)

Small issue there, the channels are not exposed anymore to homekit, only tv and HDMI.

Do i have to do something ?

Thanks :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.