Two days ago I successfully started playing plex content on my sonos via a home assistant automation (triggered by tag reader). This worked fine all yesterday evening to the best of my knowledge (no complaints from children). However today I’m getting the following error in the logs
Logger: homeassistant.components.automation.tag_test_card_1_is_scanned
Source: components/plex/services.py:141
Integration: Automation (documentation, issues)
First occurred: 7:00:25 PM (2 occurrences)
Last logged: 7:00:25 PM
Tag Test Card 1 @ Elizabeth is scanned: Error executing script. Unexpected error for call_service at pos 1: (500) internal_server_error; https://sonos.plex.tv/player/playback/playMedia?address=192-168-1-103.15f405376d5a4a84bf2b0c13d3216d97.plex.direct&commandID=2&containerKey=%2FplayQueues%2F10796%3Fown%3D1&key=None&machineIdentifier=6312ddfcf4f4892e60125ff43eb17397eabe6cf2&offset=0&port=32400&protocol=https&providerIdentifier=com.plexapp.plugins.library&token=transient-22743add-ddf4-4b8b-9243-28daa5c674b0&type=music&X-Plex-Client-Identifier=0x1c697a05b8ff&X-Plex-Target-Client-Identifier=RINCON_5CAAFDB75DB201400%3A1297902357&X-Plex-Token=YGLiPY-cpnojcyxjdw5b Internal Server Error
While executing automation automation.tag_test_card_1_elizabeth_is_scanned
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 371, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 571, in _async_call_service_step
await service_task
File "/usr/src/homeassistant/homeassistant/core.py", line 1491, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1526, in _execute_service
await handler.job.target(service_call)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service
await self.hass.helpers.service.entity_service_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 658, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 811, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 695, in _handle_entity_call
await result
File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 691, in async_play_media
await self.hass.async_add_executor_job(
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/sonos/helpers.py", line 28, in wrapper
return funct(*args, **kwargs)
File "/usr/src/homeassistant/homeassistant/components/sonos/media_player.py", line 530, in play_media
play_on_sonos(self.hass, media_type, media_id, self.name) # type: ignore[no-untyped-call]
File "/usr/src/homeassistant/homeassistant/components/plex/services.py", line 141, in play_on_sonos
sonos_speaker.playMedia(media)
File "/usr/local/lib/python3.9/site-packages/plexapi/sonos.py", line 93, in playMedia
self.sendCommand(
File "/usr/local/lib/python3.9/site-packages/plexapi/client.py", line 231, in sendCommand
return query(key, headers=headers)
File "/usr/local/lib/python3.9/site-packages/plexapi/client.py", line 192, in query
raise BadRequest(message)
plexapi.exceptions.BadRequest: (500) internal_server_error; https://sonos.plex.tv/player/playback/playMedia?address=192-168-1-103.15f405376d5a4a84bf2b0c13d3216d97.plex.direct&commandID=2&containerKey=%2FplayQueues%2F10796%3Fown%3D1&key=None&machineIdentifier=6312ddfcf4f4892e60125ff43eb17397eabe6cf2&offset=0&port=32400&protocol=https&providerIdentifier=com.plexapp.plugins.library&token=transient-22743add-ddf4-4b8b-9243-28daa5c674b0&type=music&X-Plex-Client-Identifier=0x1c697a05b8ff&X-Plex-Target-Client-Identifier=RINCON_5CAAFDB75DB201400%3A1297902357&X-Plex-Token=YGLiPY-cpnojcyxjdw5b Internal Server Error
I get that a 500 error from the sonos.plex.tv
is probably an error on the plex side of things but;
- Has anyone seen this problem before?
- Is there any way to get more information on what happened (perhaps there are more details in the http response)?