Status of Plex component?

I can’t get it to work either through discovery or manual configuration.

It just never asks to configure it in the home page nor does it ever show up if I manual.

My media_players.yaml:

- platform: plex
  name: Plex
  host: 192.168.x.x
  port: 32400
  server: DockerPlex
  include_non_clients: true
  show_all_controls: true
  token: <token>
  use_episode_art: true

plex.conf:

{"192.168.x.x:32400": {"token": <token redacted>, "ssl": true, "verify": false}}

This is what I get in the logs:

2017-10-15 21:00:47 ERROR (MainThread) [homeassistant.components.media_player] Error while setting up 
platform  plex
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/helpers/entity_component.py", line 164, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=self.hass.loop)
  File "/usr/local/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.6/asyncio/futures.py", line 245, in result
    raise self._exception
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/app/homeassistant/components/media_player/plex.py", line 80, in setup_platform
    file_config = config_from_file(hass.config.path(PLEX_CONFIG_FILE))
  File "/usr/src/app/homeassistant/components/media_player/plex.py", line 68, in config_from_file return 
json.loads(fdesc.read())
  File "/usr/local/lib/python3.6/json/__init__.py", line 354, in loads return _default_decoder.decode(s)
  File "/usr/local/lib/python3.6/json/decoder.py", line 339, in decodeobj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.6/json/decoder.py", line 357, in raw_decode raise JSONDecodeError("Expecting value", s, 
err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 35 (char 34)

Think you have misread the setup instructions & also mixed up some bits from the plex activity monitor too.

Try deleting ‘name’ (or try entity_namespace), ‘host’, ‘port’, ‘server’ & ‘token’ from the media_players.yaml

try something like this…

  - platform: plex
    entity_namespace: 'plex'
    include_non_clients: true
    show_all_controls: true
    use_episode_art: true
    scan_interval: 10

Weird, the component setup page doesn’t mention anything about an entity_namespace attribute.

Still getting an error with the below config:

- platform: plex
  entity_namespace: plex
  include_non_clients: true
  show_all_controls: true
  use_episode_art: true

Oh duh…just re-read the dock and you’re right. I was configuring the yaml for stuff that belongs in the conf file.

Ok, this is my new config:

- platform: plex
  include_non_clients: true
  show_all_controls: true
  use_episode_art: true

But still getting:

2017-10-16 12:13:35 ERROR (MainThread) [homeassistant.components.media_player] Error while setting up 
platform plex
Traceback (most recent call last):
 File "/usr/src/app/homeassistant/helpers/entity_component.py", line 164, in _async_setup_platform 
SLOW_SETUP_MAX_WAIT, loop=self.hass.loop)
File "/usr/local/lib/python3.6/asyncio/tasks.py", line 358, in wait_for return fut.result()
File "/usr/local/lib/python3.6/asyncio/futures.py", line 245, in result    raise self._exception
File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run    result = self.fn(*self.args, **self.kwargs)
File "/usr/src/app/homeassistant/components/media_player/plex.py", line 80, in setup_platform file_config = 
config_from_file(hass.config.path(PLEX_CONFIG_FILE))
File "/usr/src/app/homeassistant/components/media_player/plex.py", line 68, in config_from_filereturn 
json.loads(fdesc.read())
File "/usr/local/lib/python3.6/json/__init__.py", line 354, in loads return _default_decoder.decode(s)
File "/usr/local/lib/python3.6/json/decoder.py", line 339, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/lib/python3.6/json/decoder.py", line 357, in raw_decode raise JSONDecodeError("Expecting value", s, 
err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 35 (char 34)

Hokee…

After some more fooling around I figured out that error was being thrown because of a borked plex.conf file. I didn’t have double quotes around my token!

Now HASS no longer throws an error in the log when I try to enable the plex component but it STILL doesn’t show up.

What version of homeassistant are you using?

Try going back to basics & just using…

- platform: plex

Edit: if there are no errors then maybe it has worked - have you looked in the “states” page it will show up as a media_player

No dice.

Weird things happening now.

I had my Plex docker container in bridge mode with all the ports forwarded. As a test I changed it to “host” mode.

Now, with no media player configured and no plex.conf file when I restart HASS a get a new media player show up “Shield Android TV” (media_player.shield_android_tv) which is weird since my Shield is already discovered and showing as a card (media_player.shield). And why would it show up as a Shield TV?

And I DON’T have the Plex server on the Shield TV turned on. And even if I did why would it decide to show up now?

I also get a new plex.conf generated:

{"192.168.x.x:32400": {"token": null, "ssl": false, "verify": true}}

The IP matches the address of the Plex server so it appears that SOMETHING is getting discovered.

If I edit it to add my token it doesn’t change anything.

Only Plex players show up, not servers. So media_player.shield_android_tv will be the Plex player (not the server)

Yeah it does, and adding entity_namespace helps differentiate multiple players on the same box.

If you have Kodi & Plex on the shield they may both show up as media_player.shield1 and media_player.shield2

But using entity namespace you can make that…
media_player.plex_shield
media_player.kodi_shield

The documentation is misleading as hell if that’s the case.

To be clear, you configure all these settings related to your Plex SERVER so in order to be able to control only your Plex CLIENTS? Is that accurate? Just…wierd :stuck_out_tongue:

So basically to control your Plex server you need an always-on Plex Client?

Not sure what you mean by control your server?

Yes I agree the docs don’t fully explain what the component actually achieves - by setting up your Plex server you are actually exposing just your Plex clients into homeassistant in order to control playback, volume or create automation based on playback.

So every time you play Plex from a new client you’d get that client added e.g. media_player.plex_web

Hi was you able to get this working

I’ve added my token to my conf file and plex as a platform. I don’t get any errors but I also don’t see anything in HA

Plex clients will show up under media_players in the <> menu when discovered.

I don’t see anything in regards to plex

What devices do you see listed as media_player ?

I see
Living Room which is the place I run PleX (andriod Sony tv plex app) yet it always says off.

Anything about plex show up in the home-assistant.log ?

here is my log after a reboot

2017-11-11 22:59:27 WARNING (MainThread) [homeassistant.components.sensor.template] Could not render template Current Activity, the state is unknown.
2017-11-11 22:59:36 WARNING (SyncWorker_10) [netdisco.ssdp] Error fetching description at http://192.168.0.14:36277/devdesc.xml
2017-11-11 22:59:36 WARNING (SyncWorker_10) [netdisco.ssdp] Found malformed XML at http://192.168.0.26:49153/description1.xml: 
2017-11-11 22:59:36 WARNING (SyncWorker_10) [netdisco.ssdp] Found malformed XML at http://192.168.0.26:49153/description2.xml: 
2017-11-11 22:59:36 WARNING (SyncWorker_10) [netdisco.ssdp] Found malformed XML at http://192.168.0.26:49153/description3.xml: 
2017-11-11 22:59:36 WARNING (SyncWorker_10) [netdisco.ssdp] Found malformed XML at http://192.168.0.26:49153/description5.xml: 
2017-11-11 22:59:37 WARNING (SyncWorker_10) [netdisco.ssdp] Found malformed XML at http://192.168.0.27:49153/description0.xml: 
2017-11-11 22:59:37 WARNING (SyncWorker_10) [netdisco.ssdp] Found malformed XML at http://192.168.0.27:49153/description1.xml: 
2017-11-11 22:59:51 WARNING (MainThread) [homeassistant.components.media_player] Setup of platform cast is taking over 10 seconds.
2017-11-11 22:59:51 WARNING (MainThread) [homeassistant.components.media_player] Setup of platform cast is taking over 10 seconds.
2017-11-11 22:59:51 WARNING (MainThread) [homeassistant.components.media_player] Setup of platform cast is taking over 10 seconds.
2017-11-11 22:59:51 WARNING (MainThread) [homeassistant.components.media_player] Setup of platform cast is taking over 10 seconds.
2017-11-11 22:59:51 WARNING (MainThread) [homeassistant.components.media_player] Setup of platform cast is taking over 10 seconds.
2017-11-11 22:59:52 WARNING (MainThread) [homeassistant.components.remote] Setup of platform harmony is taking over 10 seconds.

nothing about plex

Check to see if GDM is enabled in your plex server’s config.