8000 Plex on samsung tv, request could not be completed · Issue #47712 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Plex on samsung tv, request could not be completed #47712

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

Closed
pergolafabio opened this issue Mar 10, 2021 · 36 comments · Fixed by #47766
Closed

Plex on samsung tv, request could not be completed #47712

pergolafabio opened this issue Mar 10, 2021 · 36 comments · Fixed by #47766
Assignees

Comments

@pergolafabio
Copy link

The problem

Hi

When i use the play media service to play plex content, i always recieve the error below on my samsung tv
I have 3 samsung tv's, the one running Tizen is ok , the 2 ones running Plex App from Orca , those are giving issues

allthough it worked fine, about a year ago, i also tested the plex, reproted a different issue then , see below
#33523 (comment)

but since, i didnt use plex anymore, and now want to start using it again
the plex app on the samsung tv didnt update

What is version of Home Assistant Core has the issue?

core-2021.3.3

What was the last working version of Home Assistant Core?

107.7 or later

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Plex

Link to integration documentation on our website

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

Example YAML snippet

test_plex:
  alias: 1 TEST Plex
  sequence:
  - service: media_player.play_media
    data:
      entity_id: media_player.plex_plex_for_samsung_tv_ue32h5500
      media_content_type: VIDEO
      media_content_id: "{ \"library_name\": \"Kids\", \"video_name\": \"Cars\" }"

Anything in the logs that might be useful for us?

No errors , even if i enable debug

2021-03-08 20:22:39 DEBUG (SyncWorker_20) [homeassistant.components.plex.media_player] Attempting to play <Movie:4063:Cars> on Plex (Plex for Samsung - TV Samsung)

image

@neil-bh
Copy link
neil-bh commented Mar 10, 2021

Hi,

I am also getting an error on my Samsung TV when I use the media_player.play_media service to play plex content. Although my error message is different, but caused by the same service. The error I receive is: "Playback Error - An error occurred loading items into the play queue". I have shown a picture below.

I have provided information from my setup in addition to @jjlawren 's post is shown below:

What is version of Home Assistant Core has the issue?
core-2021.2.3

What was the last working version of Home Assistant Core?
unknown (I cannot vouch for seeing it work)

What type of installation are you running?
Home Assistant Supervised
(supervisor-2021.03.4)

Integration causing the issue
Plex

Link to integration documentation on our website
https://www.home-assistant.io/integrations/plex/

Example YAML snippet

test_plex_1:
  alias: Test Plex example 1
  sequence:
  - service: media_player.play_media
    data:
      entity_id: media_player.plex_plex_for_samsung_tv_2019
      media_content_type: VIDEO
      media_content_id: "{ \"library_name\": \"Movies\", \"video_name\": \"Cats\" }"

Another YAML example:

test_plex_2:
  alias: Test Plex example 2
  sequence:
  - service: media_player.play_media
    data:
      entity_id: media_player.plex_plex_for_samsung_tv_2019
      media_content_type: EPISODE
      media_content_id: "{ \"library_name\": \"TV Shows\", \"show_name\": \"Spycraft\" }"

Anything in the logs that might be useful for us?
No logs to show

Other Information
My TV is a Samsung 2019 (Tizen 5.0)
Plex App on the TV is version: 5.10.0
Picture of error:
image

@jjlawren
Copy link
Contributor

Both of these are related to the client, which are unfortunately difficult to debug remotely. The Orca client specifically is a 3rd party client which don't believe has been updated in a couple years.

Were both of you able to start playback on these clients previously? Are you able to start playback on these clients using Plex Web?

@wizzkidd you may want to upgrade to 2021.3.X since that uses the latest plexapi release.

We might get lucky by enabling more debug logging and trying again:

logger:
  logs:
    homeassistant.components.plex: debug
    plexapi: debug

@pergolafabio
Copy link
Author

hey @jjlawren , yes it worked fine about less then a year ago, and indeed Orca is 2th party, but that client didnt change also on my tv
i tested before another issue/improvement, so i know it worked then , see :
#33523

@pergolafabio
Copy link
Author
pergolafabio commented Mar 10, 2021

i even tested that "plex assistant", when you started with in in the beginning with dialogflow, it also worked then

@jjlawren
Copy link
Contributor

Does it work now using Plex Web?

@pergolafabio
Copy link
Author

yes, if i use chrome, the movie starts

@maykar
Copy link
maykar commented Mar 10, 2021

Speaking solely on the Plex Assistant side of things, when it was working for you previously with PA it was using pychromecast to initiate the playing of media. It has since changed to just using the HA media player's play_media service.

@jjlawren
Copy link
Contributor

yes, if i use chrome, the movie starts

To be clear, I mean using the Plex Web interface to cast playback to the Samsung TV.

@pergolafabio
Copy link
Author

ah ok :-) i can try that later ... not tried yet indeed
when was pychromecast removed? maybe i can load the plex integration as a custom from a previous release to test also ?

@pergolafabio
Copy link
Author

ok, tested from the plex app on my android, casting to the samsung tv, that works, so the orca client is working
so it must be indeed that pychromecast

@maykar
Copy link
maykar commented Mar 10, 2021

Actually, pychromecast wouldn't be the issue here. Your samsung TV would be a plex client not a chromecast device. Sorry for the confusion.

@jjlawren
Copy link
Contributor

For reference, you can sent Plex media directly to Chromecast players using this method: https://www.home-assistant.io/integrations/cast/#plex.

@pergolafabio
Copy link
Author

yes, but i am using maykar's "Plex Assistant" :)

so what can i do to test, because it worked before , load an older plex integration? or is plexapi causing issues?

@jjlawren
Copy link
Contributor

Were you able to play on this TV using the HA media_player.play_media service call previously? Or was all your testing using PA? If it worked with PA but not HA, then the best guess is this client isn't able to handle Plex playqueues properly. I believe (@maykar please correct me) that PA didn't always use playqueues before. With the 1.0 version it now relies on HA's service call which unconditionally wraps media in a playqueue before starting playback.

@maykar
Copy link
maykar commented Mar 10, 2021

You are correct, but @pergolafabio mentioned on PA's forum thread that the script he posted above that uses media_player.play_media was working previously.

@pergolafabio
Copy link
Author

yes, i am still using the same test scripts as i did before, they worked less then a year ago.... i now tested them again @maykar asked me too, and that script AND PA is giving the same error on my samsung device

test_plex2:
  alias: 2 TEST Plex Onder
  sequence:
  - service: media_player.play_media
    data:
      entity_id: media_player.plex_plex_for_samsung_tv_samsung
      media_content_type: VIDEO
      media_content_id: "{ \"library_name\": \"Kids\", \"video_name\": \"Cars\" }"

@jjlawren
Copy link
Contributor

You tested with some python scripts previously, perhaps you can try that again? I made some guesses on client names and such based on old issues you raised. Give this a shot and report back what happens:

from plexapi.playqueue import PlayQueue
from plexapi.server import PlexServer
import logging

log = logging.getLogger()
log.addHandler(logging.StreamHandler())
log.setLevel(logging.DEBUG)

serverurl = 'http://<SERVER_IP>:32400'
token = '<YOUR_TOKEN_HERE>'

server = PlexServer(baseurl=serverurl, token=token)

movie = server.library.section('Kids').get('Cars')

samsung = server.client("TV Samsung")
samsung.proxyThroughServer()

# Try this first
samsung.playMedia(movie)

# Try this second
#pq = PlayQueue.create(items=movie, server=server)
#samsung.playMedia(pq)

If the first test is successful, comment out the first playMedia command and uncomment the last two lines.

@pergolafabio
Copy link
Author

ok, tested , this one works :
samsung.playMedia(movie)

this one gives indeed the same error message:

pq = PlayQueue.create(items=movie, server=server)
samsung.playMedia(pq)

@jjlawren
Copy link
Contributor

Interesting. Let me think about how to handle this.

@pergolafabio
Copy link
Author

hehe , ok , np :-)

@jjlawren
Copy link
Contributor

@wizzkidd are you able to test this script against your official Plex client?

@neil-bh
Copy link
neil-bh commented Mar 10, 2021

Just to update the thread with my findings...

I have enabled my logging as recommended and updated my HA to core-2021.3.3

I tested by calling the service in the debugging tools:

Test 1:

service: media_player.play_media
data:
  entity_id: media_player.plex_plex_for_samsung_tv_2019
  media_content_id: '{ "library_name": "TV Shows", "show_name": "Spycraft" }'
  media_content_type: EPISODE

Test 2:

service: media_player.play_media
data:
  entity_id: media_player.plex_plex_for_samsung_tv_2019
  media_content_id: '{ "library_name": "Movies", "video_name": "Cats" }'
  media_content_type: VIDEO

But these both throw up the same error screen on the TV.

I've executed the script provide by @jjlawren and unfortunately unlike @pergolafabio both tries throw up the same error screen on the TV.

@jjlawren
Copy link
Contributor

ok, tested , this one works :
samsung.playMedia(movie)

this one gives indeed the same error message:

pq = PlayQueue.create(items=movie, server=server)
samsung.playMedia(pq)

After looking through the code I'm actually not sure why you'd see different behavior between these two. The data sent to the Plex client should be identical and my local tests are confirming that.

@pergolafabio
Copy link
Author

Maybe its related to the client? I do the same test again tomorrow to be 100% sure...

But is there indeed something changed in last months? Because it worked a while ago

@jjlawren
Copy link
Contributor

I've found something that might explain this for Orca, at least based on the description of the problem. Will submit a fix to plexapi shortly.

@jjlawren
Copy link
Contributor

@pergolafabio if you're comfortable testing with a custom library branch, here's the PR: pushingkarmaorg/python-plexapi#692.

@pergolafabio
Copy link
Author

Ok, i can test later today when I am home...

I need to load plex as a custom component, and then change the manifest file to that specific plexapi commit, right?

@pergolafabio
Copy link
Author

Or how can I install that specific version, cause I am running HassOs

@jjlawren
Copy link
Contributor

Just testing the script against the new library would be sufficient.

@pergolafabio
Copy link
Author

Ok, but how can I install that specific library, cause I tested the script on my HassOs system, and did a "pip install plexapi first" through ssh

@pergolafabio
Copy link
Author

ok, tested locally on desktop pc , both PR's are working, the first one and the simpler one

@jjlawren
Copy link
Contributor

Great. I think this upstream change will fix your specific problem with Orca. The other Plex app for newer Samsung TVs still seems to have an unrelated issue.

@pergolafabio
Copy link
Author

perfect!

can i already load it in to HA to test? if i load plex as a custom and then change the manifest file to point to a specific plexapi release? or do i need to wait? :)

@pergolafabio
Copy link
Author

much appreciated!

@jjlawren
Copy link
Contributor

@pergolafabio please confirm that 2021.3.4 fixes your issue when you have a chance. 🤞

@pergolafabio
Copy link
Author

@pergolafabio please confirm that 2021.3.4 fixes your issue when you have a chance. 🤞

yes, working, !! thx for fast support

@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
0