Unexpected error during intent recognition with Music Assistant

I’m trying to enable voice assist for Music Assistant using the guide at Voice Control - Music Assistant but I’m seeing the following error “Unexpected error during intent recognition”

I have added the files to the custom_sentences folder and restarted HA. If I remove the custom sentence files I get a more typical “don’t understand” type response which suggests the files are being loaded. Does anybody have any ideas? Thanks!

It is in the intent. Can you post that too?

Thanks, yes the intents added to custom/sentences/en are from this GitHub repo intents/custom_sentences/en at main · music-assistant/intents · GitHub

Some further info from the log suggests the MassPlayMediaAssist intent can’t be found but I’m not sure why

2025-01-01 22:18:08.272 ERROR (MainThread) [homeassistant.components.assist_pipeline.pipeline] Unexpected error during intent recognition
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/assist_pipeline/pipeline.py", line 1065, in recognize_intent
    intent_response := await conversation.async_handle_intents(
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        self.hass, user_input
        ^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/components/conversation/__init__.py", line 233, in async_handle_intents
    return await default_agent.async_handle_intents(user_input)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/conversation/default_agent.py", line 1351, in async_handle_intents
    conversation_result = await self._async_process_intent_result(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        result, user_input
        ^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/components/conversation/default_agent.py", line 441, in _async_process_intent_result
    intent_response = await intent.async_handle(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<10 lines>...
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/intent.py", line 121, in async_handle
    raise UnknownIntent(f"Unknown intent {intent_type}")
homeassistant.helpers.intent.UnknownIntent: Unknown intent MassPlayMediaAssist

Another update. It looks like the integration is not yet complete.

Might want to check this thread.

In short, but please read through the thread, is you need to
a) add an intent_script block somewhere, e.g. the configuration.yaml
b) you need to add a mapping (lists: block) to the intent to map the area names and player names to actual entities. Areas are not in in the example codes in the mentioned thread, though, as I only have one area, thus can’t test that.

Edit: Ah sorry, you’re already in the other thread. :slight_smile:

1 Like

I had this issue, essentially it was because I had migrated to the new HA core version of Music Assistant which is not yet as feature rich as the HACS version. So the installed custom intents were being called by OpenAI but there was not integration to receive and process the intent