Plex Media player

I’ve tried configuring plex numerous times and i don’t see any errors, but it never shows up in states or set state list of devices. I’ve tried adding it manually in the devices section of my configuration.yaml file as well as with and without the token in the plex.conf file. I’ve also tried watching plex online by using the local ip/web as well as plex.tv/web but nothing is causing plex to show up. Any help would be greatly appreciated as i’ve been trying for a couple weeks now and have searched for answers online, but have been unable to find a solution.

My logs are below:

16-03-20 22:39:33 homeassistant.components.discovery: Found new service: plex_mediaserver ('PLEX MEDIA', 'https://192.168.1.14:32400')
16-03-20 22:39:33 homeassistant.core: Bus:Handling <Event platform_discovered[L]: discovered=('PLEX MEDIA', https://192.168.1.14:32400'), service=plex_mediaserver>
16-03-20 22:39:33 homeassistant.loader: Loaded media_player.plex from homeassistant.components.media_player.plex
16-03-20 22:39:33 plexapi: GET [192.168.1.14:32400/?X-Plex-Token=](http://192.168.1.14:32400/?X-Plex-Token=)<redacted>
16-03-20 22:39:33 plexapi: GET [192.168.1.14:32400/clients?X-Plex-Token=](http://192.168.1.14:32400/clients?X-Plex-Token=)<redacted>
16-03-20 22:39:33 plexapi: GET [192.168.1.14:32400/status/sessions?X-Plex-Token=](http://192.168.1.14:32400/status/sessions?X-Plex-Token=)<redacted>

I am in the same boat as you. If plex is not configured, the site will find the server and ask me to configure. Once it is configured it rolls through with the logs just fine it seems, but nothing is ever shown on the frontend page, I don’t see any plex related items on the Set State/Call Service or the History page.

I can run the curl command from the HA server and get a response from the plex api:$ curl http://192.168.55.23:32400/status/sessions?X-Plex-Token=<redacted> So I don’t think anything is blocked.

However curling the /clients never results in anything except an empty response from the server[code]$ curl http://192.168.55.23:32400/clients?X-Plex-Token=

<?xml version="1.0" encoding="UTF-8"?> [/code]Does HA require a different response from /clients to pop on the frontend?

Plex is also hit and miss on my HA. Sometimes, it appears on the home screen. sometimes, it won’t.

There is a bug in the current version of the Plex Media Player component.
You need to have an active client connected to Plex when you start HA, otherwise the clients will never show up.

I have fixed this issue in this PR: https://github.com/balloob/home-assistant/pull/1605

1 Like

Thanks for that update. By active client do you mean someone just needs to be watching off your server while starting HA? If so, that isn’t working for me. I will just wait for your fix to be merged.

After the 0.18.2 HA update. Getting Plex to show in HA is still a problem for me. I am assuming this may have something to do with myplex user authentication? Any ideas?

Thanks

16-04-21 09:02:26 plexapi: GET http://192.168.1.106:32400/?X-Plex-Token=
16-04-21 09:02:26 requests.packages.urllib3.connectionpool: Starting new HTTP connection (1): 192.168.1.106
16-04-21 09:02:26 homeassistant.components.media_player.plex: Connected to: http://192.168.1.106:32400
16-04-21 09:02:26 plexapi: GET http://192.168.1.106:32400/clients?X-Plex-Token=
16-04-21 09:02:26 requests.packages.urllib3.connectionpool: Starting new HTTP connection (1): 192.168.1.106
16-04-21 09:02:26 plexapi: GET http://192.168.1.106:32400/status/sessions?X-Plex-Token=
16-04-21 09:02:26 requests.packages.urllib3.connectionpool: Starting new HTTP connection (1): 192.168.1.106
16-04-21 09:02:30 plexapi: GET http://192.168.1.106:32400/clients?X-Plex-Token=

Last night i updated my plex.py file with the updated code posted here:

i was able to view the plex clients on my HA.

Today after I updated to 0.18.2, it stopped working again and i believe it’s because this update doesn’t have the new code yet. So i basically copied and pasted the code from above to my plex.py file and it was up and running again.

The current release has a fix for clients that will work. Once you use the client ONCE it will appear in the list from that moment moving forward. It has been in place in the 18.0 and newer release.

The issue boiled down to HA not scanning for plex at any time other then startup. Now it will scan every minute to see if any new plex clients are up. (web clients are ignored by default)

That’s weird. When I updated this morning I ended up having to update several components because they didn’t update properly. And I played several plex clients and none showed up. When I compared the plex.py files it showed that I was reverted back to the old plex.py file.

Look for track_utc_time_change(hass, lambda now: update_devices(), second=30) on line 117. Is that what you currently have? from the current release?

Wouldn’t be able to tell you unfortunately because I already overwrote the code. However I can tell you that when I tried to search for list_sessions in the code it was not found so that’s why I re-added the code from above.

I am able to detect Plex Home Theatre on my Windows 10 PC but not my Nvidia Shield Plex. My Plex Home Theatre on Windows 10 only showed up when i started playing a video. I tried to start a video on the shield but the shield plex client did not show up on HA. Any settings i am missing? Thanks

Hey I am getting the same.

Plex shows up on the main screen from any wired device. Like Windows, PS3 etc. any mobile device, iPad and iPhone so far have no joy.

I started another thread for my specific issue because I didn’t see you here hopefully someone has some insights.

Does your play/ff/rewind buttons work? Mine don’t.

Plex clients will only show up after you start it playing at least once. (since the last hass restart) For mobile/other devices track via plex sessions which we don’t currently support.

I wish this was included in the documentation but here is what I’ve found. The component I believe does a curl GET client status. Plex server will only give info when a client is directly connected on the local LAN and not using myPlex. On my OSX plex app I had to sign out of Myplex in order for it to show up while playing on the local LAN (Same with my Roku).

If you do a curl GET session status command on the server though (http://plex:32400/status/sessions?X-Plex-Token=xxxxx) you can get info about what any client, even what myPlex clients are watching. It would be fantastic if they would do what Plex.py and others are doing. https://forums.plex.tv/discussion/169591/plexpy-another-plex-monitoring-program AND
https://m.reddit.com/r/homelab/comments/434eii/grafana_dashboards_networkpoweresxi/?ref=readnext_6
AND
https://www.domoticz.com/forum/viewtopic.php?t=7953

Maybe over time this could be included for monitoring what’s playing on our servers.