This repository has been archived by the owner on May 26, 2022. It is now read-only.
Error when trying to cast music to Sonos Speaker, casting the same music to Chromecast or Tv completes as normal #161
Labels
bug
Something isn't working
Environment:
Error when trying to cast to Sonos Speaker:
2022-02-19 16:49:37 DEBUG (SyncWorker_6) [custom_components.plex_assistant.const] IFTTT Call: play music on kitchen speaker 2022-02-19 16:49:38 DEBUG (SyncWorker_6) [custom_components.plex_assistant.const] Command: play music on kitchen speaker 2022-02-19 16:49:38 DEBUG (SyncWorker_6) [custom_components.plex_assistant.const] Processed Command: {'device': 'kitchen speaker'} 2022-02-19 16:49:38 DEBUG (SyncWorker_6) [custom_components.plex_assistant.const] PA Devices: {'Plex (Plex for Android (Mobile) - TEL ONE TOUCH 4037N)': {'entity_id': 'media_player.plex_plex_for_android_mobile_tel_one_touch_4037n', 'device_type': 'plex'}, 'Bedroom 3 TV': {'entity_id': 'media_player.bedroom_3_tv', 'device_type': 'cast'}, 'Kitchen Speaker': {'entity_id': 'media_player.kitchen_speaker', 'device_type': 'sonos'}} 2022-02-19 16:49:38 DEBUG (SyncWorker_6) [custom_components.plex_assistant.const] Device: Kitchen Speaker 2022-02-19 16:49:41 DEBUG (SyncWorker_6) [custom_components.plex_assistant.const] Media: [<Track:18387:Strangers-by-Nature>, <Track:18388:Easy-on-Me>, <Track:18389:My-Little-Love>, <Track:18390:Cry-Your-Heart-Out>, <Track:18391:Oh-My-God>, <Track:18392:Can-I-Get-It>, <Track:18393:I-Drink-Wine>, <Track:18394:All-Night-Parking-(i>, <Track:18395:Woman-Like-Me>, <Track:18396:Hold-On>, <Track:18397:To-Be-Loved>, <Track:18398:Love-Is-a-Game>, <Track:13523:Walk-This-Way>, <Track:15128:Heaven-Beside-You>, <Track:15125:Rooster>, <Track:15126:Would?>, <Track:15130:Man-in-the-Box>, <Track:15107:Ties-That-Bind>, <Track:15108:Come-to-Life>, <Track:15109:Brand-New-Start>, <Track:15110:Buried-Alive>] 2022-02-19 16:49:41 ERROR (MainThread) [homeassistant.core] Error executing service: <ServiceCall media_player.play_media (c:9b81644649ffae989f6b8f1812d7423c): entity_id=['media_player.kitchen_speaker'], extra=, media_type=video, media_id=plex://{"playqueue_id": 1219, "type": "audio", "plex_server": "PlxSvr_Diaz"}> Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/core.py", line 1648, in catch_exceptions await coro_or_task File "/usr/src/homeassistant/homeassistant/core.py", line 1667, in _execute_service await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)( File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service await self.hass.helpers.service.entity_service_call( File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 668, in entity_service_call future.result() # pop exception if have File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 930, in async_request_call await coro File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 705, in _handle_entity_call await result File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 720, 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 46, in wrapper result = funct(self, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/components/sonos/media_player.py", line 558, in play_media plex_plugin.play_now(media) File "/usr/local/lib/python3.9/site-packages/soco/plugins/plex.py", line 109, in play_now position = self.add_to_queue(plex_media, add_next=True) File "/usr/local/lib/python3.9/site-packages/soco/plugins/plex.py", line 138, in add_to_queue parent_type = PARENT_TYPE[item_type] KeyError: 'playqueue'
Same command but to a Chromecast called 'Bedroom 3 TV':
2022-02-19 16:53:54 DEBUG (SyncWorker_3) [custom_components.plex_assistant.const] IFTTT Call: play music on the bedroom TV 2022-02-19 16:53:54 DEBUG (SyncWorker_0) [custom_components.plex_assistant.const] Command: play music on the bedroom TV 2022-02-19 16:53:54 DEBUG (SyncWorker_0) [custom_components.plex_assistant.const] Processed Command: {'device': 'bedroom tv'} 2022-02-19 16:53:54 DEBUG (SyncWorker_0) [custom_components.plex_assistant.const] PA Devices: {'Plex (Plex for Android (Mobile) - TEL ONE TOUCH 4037N)': {'entity_id': 'media_player.plex_plex_for_android_mobile_tel_one_touch_4037n', 'device_type': 'plex'}, 'Bedroom 3 TV': {'entity_id': 'media_player.bedroom_3_tv', 'device_type': 'cast'}, 'Kitchen Speaker': {'entity_id': 'media_player.kitchen_speaker', 'device_type': 'sonos'}} 2022-02-19 16:53:54 DEBUG (SyncWorker_0) [custom_components.plex_assistant.const] Device: Bedroom 3 TV 2022-02-19 16:53:55 DEBUG (SyncWorker_0) [custom_components.plex_assistant.const] Media: [<Episode:16591:86:-Eighty-Six-s01e01>, <Episode:16592:86:-Eighty-Six-s01e02>, <Episode:16593:86:-Eighty-Six-s01e03>, <Episode:16594:86:-Eighty-Six-s01e04>, <Episode:16595:86:-Eighty-Six-s01e05>, <Episode:16596:86:-Eighty-Six-s01e06>, <Episode:16597:86:-Eighty-Six-s01e07>, <Episode:16598:86:-Eighty-Six-s01e08>, <Episode:16599:86:-Eighty-Six-s01e09>, <Episode:16600:86:-Eighty-Six-s01e10>, <Episode:16601:86:-Eighty-Six-s01e11>, <Episode:17845:86:-Eighty-Six-s01e12>, <Episode:17911:86:-Eighty-Six-s01e13>, <Episode:17935:86:-Eighty-Six-s01e14>, <Episode:18038:86:-Eighty-Six-s01e15>, <Episode:18078:86:-Eighty-Six-s01e16>, <Episode:18158:86:-Eighty-Six-s01e17>, <Episode:18435:86:-Eighty-Six-s01e18>, <Episode:18751:86:-Eighty-Six-s01e19>, <Episode:19111:86:-Eighty-Six-s01e20>, <Episode:19134:86:-Eighty-Six-s01e21>]
Troubleshooting so far:
removed Plex_Assistant integration, deleted /custom_components/plex_assistant, used HAC to re-download, re-added integration
removed Plex_Assistant again the same way and downgraded to 1.1.8, then updated again after that didn't work
removed Sonos, Plex Media Server, and Plex_Assistant, re-added everything
I did noticed that the error is with 'homeassistant.core' when it tries to pass 'media_type=video' to a device that has no video, don't know if this is nothing, thought I mention it
reboot whole HA VM
The issue start after I update HA, HA Core OS, and Plex_Assistant
Using IFTTT to trigger
Used HACS to install
If using the plex_assistant.command service in HA's Developer Tools is working; attempting in Dev Tools same error:
2022-02-22 21:36:48 DEBUG (SyncWorker_2) [custom_components.plex_assistant.const] Command: play music on kitchen speaker 2022-02-22 21:36:48 DEBUG (SyncWorker_2) [custom_components.plex_assistant.const] Processed Command: {'device': 'kitchen speaker'} 2022-02-22 21:36:48 DEBUG (SyncWorker_2) [custom_components.plex_assistant.const] PA Devices: {'Bedroom 3 TV': {'entity_id': 'media_player.bedroom_3_tv', 'device_type': 'cast'}, 'Kitchen Speaker': {'entity_id': 'media_player.kitchen_speaker', 'device_type': 'sonos'}} 2022-02-22 21:36:48 DEBUG (SyncWorker_2) [custom_components.plex_assistant.const] Device: Kitchen Speaker 2022-02-22 21:36:50 DEBUG (SyncWorker_2) [custom_components.plex_assistant.const] Media: [<Track:18387:Strangers-by-Nature>, <Track:18388:Easy-on-Me>, <Track:18389:My-Little-Love>, <Track:18390:Cry-Your-Heart-Out>, <Track:18391:Oh-My-God>, <Track:18392:Can-I-Get-It>, <Track:18393:I-Drink-Wine>, <Track:18394:All-Night-Parking-(i>, <Track:18395:Woman-Like-Me>, <Track:18396:Hold-On>, <Track:18397:To-Be-Loved>, <Track:18398:Love-Is-a-Game>, <Track:13523:Walk-This-Way>, <Track:15128:Heaven-Beside-You>, <Track:15125:Rooster>, <Track:15126:Would?>, <Track:15130:Man-in-the-Box>, <Track:15107:Ties-That-Bind>, <Track:15108:Come-to-Life>, <Track:15109:Brand-New-Start>, <Track:15110:Buried-Alive>] 2022-02-22 21:36:50 ERROR (MainThread) [homeassistant.core] Error executing service: <ServiceCall media_player.play_media (c:7eb8e5fce10334f9a3a3382445f29109): entity_id=['media_player.kitchen_speaker'], extra=, media_type=video, media_id=plex://{"playqueue_id": 1227, "type": "audio", "plex_server": "PlxSvr_Diaz"}> Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/core.py", line 1648, in catch_exceptions await coro_or_task File "/usr/src/homeassistant/homeassistant/core.py", line 1667, in _execute_service await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)( File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service await self.hass.helpers.service.entity_service_call( File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 668, in entity_service_call future.result() # pop exception if have File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 930, in async_request_call await coro File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 705, in _handle_entity_call await result File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 720, 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 46, in wrapper result = funct(self, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/components/sonos/media_player.py", line 558, in play_media plex_plugin.play_now(media) File "/usr/local/lib/python3.9/site-packages/soco/plugins/plex.py", line 109, in play_now position = self.add_to_queue(plex_media, add_next=True) File "/usr/local/lib/python3.9/site-packages/soco/plugins/plex.py", line 138, in add_to_queue parent_type = PARENT_TYPE[item_type] KeyError: 'playqueue'
The text was updated successfully, but these errors were encountered: