Year Of The Voice Question

With all the amazing Year Of The Voice announcements this year it has been difficult to keep up so I have a question.

Would it be possible to set up the voice assistant so that rather than responding to a voice command with speech it toggles another entity in Home Assistant? For example flash a light entity green when it has heard the command and orange when the command has been actioned.

If your voice assistant is a esphome device that should definitely work out.

1 Like

Thanks for that.

Are you wanting to do another action within Home Assistant; or for the satellite to provide non-audio status feedback ?

I have just set up a Raspberry Pi as a Voice Assistant using the new wyoming-satellite mentioned in Chapter 5, and there are a lot of options available on the satellite device, including:

  --awake-wav AWAKE_WAV
                        WAV file to play when wake word is detected
  --done-wav DONE_WAV   WAV file to play when voice command is done

  --detect-command DETECT_COMMAND
                        Command to run when wake word detection starts
  --detection-command DETECTION_COMMAND
                        Command to run when wake word is detected
  --transcript-command TRANSCRIPT_COMMAND
                        Command to run when speech to text transcript is returned
  --stt-start-command STT_START_COMMAND
                        Command to run when the user starts speaking
  --stt-stop-command STT_STOP_COMMAND
                        Command to run when the user stops speaking
  --synthesize-command SYNTHESIZE_COMMAND
                        Command to run when text to speech text is returned
  --tts-start-command TTS_START_COMMAND
                        Command to run when text to speech response starts
  --tts-stop-command TTS_STOP_COMMAND
                        Command to run when text to speech response stops
  --streaming-start-command STREAMING_START_COMMAND
                        Command to run when audio streaming starts
  --streaming-stop-command STREAMING_STOP_COMMAND
                        Command to run when audio streaming stops
  --error-command ERROR_COMMAND
                        Command to run when an error occurs

Hi Don,

Thats really interesting, thanks. I could use this to get Home Assistant to provide non audio feedback. Out of interest, what speaker and mic did you use?

Glyn

I used a RasPi 3B with a USB mic and headphone.

However Mike has done a tutorial to build a satellite using a Raspberry Pi Zero 2 W and a ReSpeaker 2Mic HAT … including providing the python code for a service running on the satellite to provide visual feedback using the 3 LEDs on the reSpeaker board.

I have a spare Pi 3B so I will have to give it a try.

In ESPHome, you don’t have to set a speaker or media_player in the voice_assistant configuration (both are optional), and you have a whole lot of triggers (all the on_xyz, see link from indeeed) that can do whatever you want with home assistant (see link):

  on_stt_vad_start:
    - homeassistant.service:
        service: input_text.set_value
        data:
          value: media_player.voice_box_player
          entity_id: input_text.last_voice_box_triggered
  on_tts_start:
    - homeassistant.service:
        service: script.esphome_notify
        data:
          target: media_player.voice_box_player
        data_template:
          message: "{{ msg }}"
        variables:
          msg: return x;

or with the ESPHome device directly:

  on_wake_word_detected:
    - light.turn_on:
        id: onboard_led
        blue: 65%
        red: 100%
        green: 0%
        brightness: 75%