esphome / feature-requests

ESPHome Feature Request Tracker
https://esphome.io/
411 stars 26 forks source link

Mute action for microphone component (voice assistant context) #2584

Open Littleislandbrewing opened 7 months ago

Littleislandbrewing commented 7 months ago

Describe the problem you have/What new integration you would like Is it possible to create a mute action for the microphone component pls?

Please describe your use case for this integration and alternatives you've tried: Im trying to make a voice assistant that uses my whole house speaker system for audio prompts and want the sonos to say "Yes" on wake word detection - Problem is that the pipeline has already started and the VA detects the word "Yes" and fails the intent.

What would be handy is when the wakeword is detected the mic has the ability to mute for a second and then re-enable, the automation would look something like this:

  on_wake_word_detected:
    - microphone.mute
         id: microphone
    - homeassistant.service:
        service: tts.speak
        data:
          media_player_entity_id: media_player.whole_house
          message: Yes?
          entity_id: tts.piper    
    - delay: 2s
    - microphone.unmute
         id: microphone
...

Additional context Voice Command: "Hey Jarvis" Sonos TTS reply: "Yes?" Command: "Turn off The lights" Sonos TTS reply" Sorry I couldnt understand that"

This is obviously because "Yes turn off the lights" is not an intent HA can understand. Muting the Mic during the reply would help

The ESP log:


[10:57:33][D][voice_assistant:410]: State changed from STOPPING_MICROPHONE to AWAITING_RESPONSE
[10:57:33][D][voice_assistant:517]: Event Type: 4
[10:57:33][D][voice_assistant:545]: Speech recognised as: "Yes, turn on the lights."
[10:57:33][D][voice_assistant:517]: Event Type: 5
[10:57:33][D][voice_assistant:550]: Intent started
[10:57:33][D][voice_assistant:517]: Event Type: 6
[10:57:33][D][voice_assistant:517]: Event Type: 7
[10:57:33][D][voice_assistant:573]: Response: "Sorry, I couldn't understand that"
'''

<!-- LEAVE THIS LINE AS-IS AND DON'T DELETE IT, OTHERWISE THE FEATURE REQUEST WILL BE CLOSED AUTOMATICALLY. -->
Aepx commented 4 months ago

I'll second this one. No one else sees this as a necessity??

Hedda commented 3 weeks ago

FYI, esphome developers are experimenting with software mute switch and much more in the related experimental voice-kit repo: