hass-music-assistant icon indicating copy to clipboard operation
hass-music-assistant copied to clipboard

TTS to sonos group fails.

Open HA-TB303 opened this issue 4 months ago • 8 comments

What version of Music Assistant has the issue?

2.0.0b136

What version of the Home Assistant Integration have you got installed?

2024.4.3

Have you tried everything in the Troubleshooting FAQ and reviewed the Open and Closed Issues and Discussions to resolve this yourself?

  • [X] Yes

The problem

When casting to a Sonos group created in MASS tts fails.

How to reproduce

  1. Create a Sonos group: CleanShot 2024-04-14 at 14 54 07

  2. Verify if it exists: CleanShot 2024-04-14 at 14 54 55

  3. Verify if music can be played to it: CleanShot 2024-04-14 at 14 55 29

This works...

  1. Verify if I can tts to it: CleanShot 2024-04-14 at 14 56 42

This fails..

Music Providers

n/a

Player Providers

Sonos

Full log output

Logger: homeassistant.components.websocket_api.http.connection
Bron: custom_components/mass/media_player.py:485
integratie: Home Assistant WebSocket API (documentatie, problemen)
Eerst voorgekomen: 14:43:37 (3 gebeurtenissen)
Laatst gelogd: 14:56:43

[139944312487744] Error handling message: Unknown error (unknown_error) Michel from 192.168.207.5 (Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 Edg/122.0.0.0)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 27, in _handle_async_response
    await func(hass, connection, msg)
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 794, in handle_execute_script
    script_result = await script_obj.async_run(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1713, in async_run
    return await asyncio.shield(create_eager_task(run.async_run()))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 457, in async_run
    await self._async_step(log_exceptions=False)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 509, in _async_step
    self._handle_exception(
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 539, in _handle_exception
    raise exception
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 507, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 736, in _async_call_service_step
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 699, in _async_run_long_action
    return await long_task
           ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2543, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2580, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/tts/legacy.py", line 159, in async_say_handle
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 2543, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2580, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 971, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1043, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/config/custom_components/mass/media_player.py", line 438, in async_play_media
    await self._async_play_media_advanced(
  File "/config/custom_components/mass/media_player.py", line 485, in _async_play_media_advanced
    await self.mass.players.play_announcement(
  File "/usr/local/lib/python3.12/site-packages/music_assistant/client/players.py", line 132, in play_announcement
    await self.client.send_command(
  File "/usr/local/lib/python3.12/site-packages/music_assistant/client/client.py", line 174, in send_command
    return await future
           ^^^^^^^^^^^^
music_assistant.common.models.errors.MusicAssistantError: unhandled errors in a TaskGroup (1 sub-exception)

Full mass log:

2024-04-14 15:05:14.185 INFO (MainThread) [music_assistant] Starting Music Assistant Server (97c669c8181e403e8354929b295df38f) version 2.0.0b136 - HA add-on: True
2024-04-14 15:05:14.190 INFO (MainThread) [music_assistant.cache] Initializing cache controller...
2024-04-14 15:05:14.195 INFO (MainThread) [music_assistant.webserver] Starting server on  0.0.0.0:8095 - base url: http://192.168.207.101:8095
2024-04-14 15:05:14.211 INFO (MainThread) [music_assistant.music] Using a sync interval of 77 minutes.
2024-04-14 15:05:14.376 INFO (MainThread) [music_assistant.streams] Detected ffmpeg version 6.0.1 with libsoxr support
2024-04-14 15:05:14.376 INFO (MainThread) [music_assistant.streams] Starting server on  0.0.0.0:8098 - base url: http://192.168.207.101:8098
2024-04-14 15:05:14.662 INFO (MainThread) [music_assistant] Loaded metadata provider TheAudioDB Metadata provider
2024-04-14 15:05:14.662 INFO (MainThread) [music_assistant] Loaded metadata provider fanart.tv Metadata provider
2024-04-14 15:05:14.662 INFO (MainThread) [music_assistant] Loaded metadata provider MusicBrainz Metadata provider
2024-04-14 15:05:14.662 INFO (MainThread) [music_assistant] Loaded music provider URL
2024-04-14 15:05:14.662 INFO (MainThread) [music_assistant.music] Sync task for URL completed
2024-04-14 15:05:14.709 INFO (MainThread) [music_assistant] Loaded player provider SONOS
2024-04-14 15:05:14.713 INFO (MainThread) [music_assistant] Loaded plugin provider Home Assistant
2024-04-14 15:05:14.872 INFO (MainThread) [music_assistant] Loaded music provider RadioBrowser
2024-04-14 15:05:14.873 INFO (MainThread) [music_assistant.music] Sync task for RadioBrowser completed
2024-04-14 15:05:15.359 INFO (MainThread) [music_assistant.providers.spotify] Successfully logged in to Spotify as xxxxx
2024-04-14 15:05:15.359 INFO (MainThread) [music_assistant] Loaded music provider Spotify xxxxxxx
2024-04-14 15:05:18.016 INFO (MainThread) [music_assistant.players] Player registered: RINCON_C4387502BEAA01400/Keuken
2024-04-14 15:05:18.017 INFO (MainThread) [music_assistant.players] Player registered: syncgroup_myqrjkxc/Groep - beneden
2024-04-14 15:05:18.019 WARNING (MainThread) [soco.events_asyncio] Could not bind to 192.168.207.101:1400: [Errno 98] Address already in use
2024-04-14 15:05:18.127 INFO (MainThread) [music_assistant.players] Player registered: RINCON_C43875E1AE2401400/Kantoor
2024-04-14 15:05:18.195 INFO (MainThread) [music_assistant.players] Player registered: RINCON_38420B4BEB0901400/Woonkamer
2024-04-14 15:05:18.256 INFO (MainThread) [music_assistant.providers.spotify] Successfully logged in to Spotify as xxxxxxxx
2024-04-14 15:05:18.256 INFO (MainThread) [music_assistant] Loaded music provider Spotify xxxxx
2024-04-14 15:05:19.259 INFO (MainThread) [music_assistant.providers.spotify] Successfully logged in to Spotify as xxxxxxxx
2024-04-14 15:05:19.259 INFO (MainThread) [music_assistant] Loaded music provider Spotify xxxxxx
2024-04-14 15:05:21.411 INFO (MainThread) [music_assistant.music] Sync task for Spotify xxxxxxx completed
2024-04-14 15:05:41.551 INFO (MainThread) [music_assistant.music] Sync task for Spotify xxxxxx completed
2024-04-14 15:05:45.999 WARNING (MainThread) [music_assistant.music] Sync task for Spotify xxxxx completed with errors
2024-04-14 15:06:00.031 WARNING (MainThread) [music_assistant.players] Detected announcement request to an inactive playergroup, while one or more individual players are playing. This announcement will be redirected to the individual players.
2024-04-14 15:06:00.031 INFO (MainThread) [music_assistant.players] Playback announcement to player Woonkamer (with pre-announce: False): http://192.168.207.101:8123/api/tts_proxy/afa6c8b3a2fae95785dc7d9685a57835d703ac88_nl-nl_6e8b81ac47_cloud.mp3
2024-04-14 15:06:00.031 INFO (MainThread) [music_assistant.players] Playback announcement to player Keuken (with pre-announce: False): http://192.168.207.101:8123/api/tts_proxy/afa6c8b3a2fae95785dc7d9685a57835d703ac88_nl-nl_6e8b81ac47_cloud.mp3
2024-04-14 15:06:00.031 INFO (MainThread) [music_assistant.players] Playback announcement to player Kantoor (with pre-announce: False): http://192.168.207.101:8123/api/tts_proxy/afa6c8b3a2fae95785dc7d9685a57835d703ac88_nl-nl_6e8b81ac47_cloud.mp3
2024-04-14 15:06:00.032 ERROR (MainThread) [music_assistant.webserver] Error handling message: players/cmd/play_announcement: unhandled errors in a TaskGroup (1 sub-exception)

Additional information

Tried other tts servies, same result...

What version of Home Assistant Core are your running

2024.4.3

What type of installation are you running?

Home Assistant OS

On what type of hardware are you running?

Generic x86-64 (e.g. Intel NUC)

HA-TB303 avatar Apr 14 '24 12:04 HA-TB303