Can Home Assistant "Assist" be the first to initiate conversation?

Dear HA Community,
Does anyone know, if there is any way to make HA “Assist” initiating the conversation?
One of the scenarios I am thinking of could be:
When I enter the bathroom, Assist asks: “Shall I play the music or the latest news?”, then it is waiting for my reply for 15 seconds and takes appropriate action if it receives reply.
Any hint is welcome, many thanks!

Ooooo, I like this.

Not sure if it is currently possible. But, would be kind of cool.

1 Like

I believe you can do so by using ESPresence or other presence detection methods to detect if someone is in a particular room and sending a voice prompt to the device in that room. Unfortunately, this might require a more complex setup than just an ESPHome based device.

That’s the bit they want help with.

Right, I have no issue with presence detection and generating question with Piper TTS when presence is detected (either using Appdaemon or the automations).

What I am struggling with, is to find out how to trigger Assist to start listening for the answer in described scenario (based on the detected presence, not based on the wakeword).

1 Like

I’m not sure if this works with all ESP32 voice assistants, but if you modify the configuration to create a “listen once” switch, then you can use that switch in an automation.

I don’t really use the initiate function because I have no use for it, but I do have the switch configured in the ESPHome config, like so:

switch:
  - platform: template
      id: listen_once
      name: Listen Once
      optimistic: true
      restore_mode: DISABLED
      on_turn_on:
        - switch.turn_off: use_wake_word
        - delay: 0.5s
        - voice_assistant.start
      on_turn_off:
        - switch.turn_on: use_wake_word

From this a switch is created in HA. This works because it uses ‘voice_assistant.start’ rather than ‘voice_assistant_start_continuous’. So it will listen for a response without needing a wake word. To best make use of an initiate conversation feature it is probably a good idea to create a script for it and then call the script with parameters from an automation. I can’t remember where I got it but I can share if there is interest.

6 Likes

Thank you very much @cnose! Looks to be exactly what I was looking for. I will try to setup the “listen once” switch as per the example you shared.

Did you succeed in this approach?
I’ m looking for same thing, entering a room then have a question posed which can be answered by a yes/no. But then without esp preferably.

I was close to succeed with the implementation of switch “listen_once” (described above) on ESP32-S3-BOX which I am using as voice satellite. I had to rework proposed solution a bit, because on ESP32-S3-BOX there is no switch “use_wake_word” defined. Instead I tried calling micro_wake_word.stop, which worked.
As expected, listening was activated when switch “listen_once” was turned on from HA and then reply from human was correctly processed.
However, for unclear reason I did not achieve activating back wake word detection by turning off “listen once” switch (which is needed in case human does not reply anything after few seconds). I am stuck with it and so far had no time to experiment more.

If someone uses wyoming satellite, then the solution to this problem is in the repository in issue 81. Perhaps in the future this functionality will be added to the main branch.

Could something like this work maybe?

switch:
  - platform: template
      id: listen_once
      name: Listen Once
      optimistic: true
      restore_mode: DISABLED
      on_turn_on:
        - micro_wake_word.stop
        - delay: 0.5s
        - voice_assistant.start
        - delay: 10s
        - switch.turn_off: listen_once
      on_turn_off:
        - micro_wake_word.start

My thinking is that this way it incorporates a timeout in case nothing is said, but it’s a guess.

Unfortunately, when there was no reply from human, “micro_wake_word.start” for some reason does not activate back the wakeword detection…

Hello.

I am using Assist via two methods.

  1. The Assist Microphone add-on and a USB speakerphone
  2. The Assist on Android via the companion app

a) Is there a way that I can trigger listening on these devices via a script or automation?
b) Is there a way to configure the voice assistant to automatically listen after a response and close down after a time out or when I say “goodbye”

I have been using Home Assistant for many years, but I am a middling programmer and need a lot of direction if this is sophisticated.

Thanks!