core: Plex play_media service does not work
Home Assistant release with the issue:
version | 0.101.3
Last working Home Assistant release (if known): Unknown - I’ve never gotten it to work
Operating environment (Hass.io/Docker/Windows/etc.):
hass.io running on a pi 3b+ Integration:
https://www.home-assistant.io/integrations/plex/
Description of problem: With the updated version of the Plex integration, I can now connect to my Plex server. The plex media players show up and provide the correct information about what is playing, etc. The plex sensor also works correctly.
I’m now trying to start a playlist from the service tool. The error I get in the log is:
2019-11-09 08:56:19 DEBUG (SyncWorker_19) [homeassistant.components.plex.media_player] Using album artist because track artist was not found: Plex (Chrome)
This seems like a different response than what I should get for a playlist (not sure why it’s telling me about a specific track artist?). The service command I’m sending is in the yaml below
Problem-relevant configuration.yaml
entries and (fill out even if it seems unimportant):
entity_id: media_player.plex_chrome
media_content_id: '{ "playlist_name" : "morning music", "shuffle": "1" }'
media_content_type: PLAYLIST
Note: I eliminated the escaped double quotes because those caused JSON decoder errors (the media_content_id JSON is listed first as the example - assuming the error is the first instance of the escaped double quote):
media_content_id: '{ \"playlist_name\" : \"morning music\", \"shuffle\": \"1\" }'
2019-11-09 08:38:35 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.1916672816] Expecting property name enclosed in double quotes: line 1 column 3 (char 2)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 133, in handle_call_service
connection.context(msg),
File "/usr/src/homeassistant/homeassistant/core.py", line 1236, in async_call
await asyncio.shield(self._execute_service(handler, service_call))
File "/usr/src/homeassistant/homeassistant/core.py", line 1261, 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, service_name, required_features
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 348, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 372, in _handle_service_platform_call
await func(entity, data)
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/plex/media_player.py", line 594, in play_media
src = json.loads(media_id)
File "/usr/local/lib/python3.7/json/__init__.py", line 348, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.7/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/lib/python3.7/json/decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 3 (char 2)
Traceback (if applicable):
Not applicable
Additional information: I checked in the Plex logs (which are really hard to read), and it does something - I just can’t figure out what it is doing…
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 27 (16 by maintainers)
That makes sense, @jjlawren, and is what I thought was happening. I’ll update to 0.112 this weekend and see if the new discovery methods make a difference. Thanks!