music-assistant / hass-music-assistant

Turn your Home Assistant instance into a jukebox, hassle free streaming of your favorite media to Home Assistant media players.
Apache License 2.0
1.4k stars 51 forks source link

Voice commands hang the voice satellite the request is being made on #3218

Closed nikito closed 1 day ago

nikito commented 2 days ago

What version of Music Assistant has the issue?

2.4.0b7

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

2024.11.5

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

The problem

When issuing a voice command to play media such as "Play the artist x", the command succeeds but the voice satellite is then stuck in a thinking state. This appears to be due to MA not sending any kind of reply back once the action is complete. There are no errors in MA logs, and the only thing I can see in HA logs is this:

Logger: homeassistant.helpers.service
Source: helpers/service.py:302
First occurred: November 22, 2024 at 4:15:13 PM (28 occurrences)
Last logged: 3:29:09 PM

Referenced entities media_player.workshop_hub are missing or not currently available
Referenced entities media_player.workshop_tv_chromecast are missing or not currently available
Referenced entities media_player.workshop_tv are missing or not currently available
Referenced entities light.left_tree, light.porch_holiday_lights, light.right_tree are missing or not currently available

How to reproduce

Issue any voice command, such as "Play the artist x"

Music Providers

SiriusXM, Spotify

Player Providers

Chromecast

Full log output

music-assistant.log

Additional information

No response

What version of Home Assistant Core are your running

2024.11.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)

OzGav commented 1 day ago

What satellite are you using. I just tried this and it works fine.

nikito commented 1 day ago

The esp32-s3-box-3, running the esphome firmware from https://github.com/esphome/wake-word-voice-assistants/tree/main/esp32-s3-box-3

OzGav commented 1 day ago

Why do you say

This appears to be due to MA not sending any kind of reply back once the action is complete.

nikito commented 1 day ago

When i check the assist pipeline trace, there's no reply, so it seems the satellite is stuck awaiting something to say as part of the pipeline. I've noticed this when creating intents for other things, if my action doesn't have something like "done" as a speech response the satellite doesn't seem to move to the next phase. I also just tried it from the assist box typing in the command in the HA app and it made the app close itself 😯

nikito commented 1 day ago

I just tried adding this to the music_assist_PlayMediaAssist.yaml:

responses:
  intents:
    MassPlayMediaAssist:
      default: "Done."

With this added it no longer hangs the voice satellite or makes the app close.

OzGav commented 1 day ago

Interesting. I just tried with an M3 echo, a Raspberry Pi Wyoming Satellite and another device and had no problems. So I am wondering if this is actually a firmware problem on your device which may be getting highlighted by this as I thought specfying responses just overrode the default response...but I could be mistaken...

You say the problem occurs with any voice command. Is that actually true? If you type Play the artist on <your device friendly name> what happens? Do you also use the MA Specific Conversation Agent? If so, can you try that intent by typing "Play artist on "

The app closing sounds like an app problem. I just tried it as well and if I use the MassPlayMediaOnMediaPlayerintent it works ok but if I use the MassPlayMediaAssist intent then it works but the app crashes.

nikito commented 1 day ago

I noticed the same problem requesting a radio station for instance. When i type it i get the crash as you noted, but the command works. I do have the MA conversation agent set up and configure on the integration, and that is all working well. I didn't notice that for that setup there is a different custom sentences file to use however, maybe that is part of my problem. I'll replace what i have with that and see if the issue goes away!

OzGav commented 1 day ago

You need both custom sentence files as you have the conversation agent as well. One file is for that and one is for HA assist

nikito commented 1 day ago

Instructions at https://music-assistant.io/integration/voice/ for that setup just mention copying the one file, https://github.com/music-assistant/intents/blob/main/custom_sentences/en/music_assistant_PlayMediaOnMediaPlayer.yaml I actually put just this one in and removed the other, reloaded conversation and intents in HA, and now everything is working perfectly. 😅 Seems maybe on the config that makes use of the MA specific conversation agent only the PlayMediaOnMediaPlayer may be needed?

OzGav commented 1 day ago

If you are using the Assist option then the instructions tell you to load one file. https://github.com/music-assistant/intents/blob/main/custom_sentences/en/music_assistant_PlayMediaAssist.yaml

If you are using the MA Specific Conversation Agent the instructions tell you to load a different file. https://github.com/music-assistant/intents/blob/main/custom_sentences/en/music_assistant_PlayMediaOnMediaPlayer.yaml

You can use any combination of the voice control options but you must use the instructions for each.

nikito commented 1 day ago

Yup, I missed that part in the instructions so that's on me 😅 once i put the right intents in place for the ma agent setup per the doc it's working fine now. I'll close this issue, thanks for your help!