AlexxIT / StreamAssist

Home Assistant custom component that allows you to turn almost any camera and almost any speaker into a local voice assistant
MIT License
176 stars 14 forks source link

STT Start Media | media_type #37

Closed xvlw closed 1 week ago

xvlw commented 1 week ago

I've been getting this error when trying to set up Stream Assist with Fully Kiosk when sending an .mp3 sound through STT Start Media

Logger: homeassistant.core
Source: core.py:2751
First occurred: 2:14:55 PM (4 occurrences)
Last logged: 2:26:53 PM

    Error executing service: <ServiceCall media_player.play_media (c:01J276FX6EVF355SX82MY2SETE): entity_id=['media_player.lenovots_1'], extra=, media_type=audio, media_id=media-source://media_source/local/system-notification-199277.mp3>
    Error executing service: <ServiceCall media_player.play_media (c:01J276JN7N5CG4F8ZQYM3HP8R0): entity_id=['media_player.lenovots_1'], extra=, media_type=audio, media_id=media-source://media_source/local/system-notification-199277.mp3>
    Error executing service: <ServiceCall media_player.play_media (c:01J276Q38F10M26N8K49EXBPKJ): entity_id=['media_player.lenovots_1'], extra=, media_type=audio, media_id=media-source://media_source/local/system-notification-199277.mp3>
    Error executing service: <ServiceCall media_player.play_media (c:01J2775T601G3N18YH84331DHJ): entity_id=['media_player.lenovots_1'], extra=, media_type=audio, media_id=media-source://media_source/local/system-notification-199277.mp3>

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/core.py", line 2751, in _run_service_call_catch_exceptions
    await coro_or_task
  File "/usr/src/homeassistant/homeassistant/core.py", line 2774, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 999, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1071, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/fully_kiosk/media_player.py", line 75, in async_play_media
    raise HomeAssistantError(f"Unsupported media type {media_type}")
homeassistant.exceptions.HomeAssistantError: Unsupported media type audio

TlHgef1

When trying to replicate the service call that sends the .mp3 file over I notice that I get the same error when the content type is set to "audio".

However if i change it to "music", the error goes away and the .mp3 sound goes through without an issue.

service: media_player.play_media
target:
  entity_id: media_player.<media_player ID>
data:
  media_content_id: media-source://media_source/local/system-notification-199277.mp3
  media_content_type: music

Is there a way to change the Content Type in StreamAssist to send as "music" instead of audio to play nice with Fully Kiosk, or is there a setting im missing in Fully Kiosk that allows this Content Type through?

xvlw commented 1 week ago

Adding some potential background that another user found may be the culprit via the View Assist discord

dFyNN6Y

wZfHYva

AlexxIT commented 1 week ago

I'll leave only #36