StreamAssist icon indicating copy to clipboard operation
StreamAssist copied to clipboard

FR: Allow (via automation) to start listening again (without wakeword) after SND

Open tbrasser opened this issue 1 year ago • 13 comments

Currently after SND stage is done, I have to start over by speaking the wakeword, and then there is no context of the previous pipeline run.

Would it be possible to go back to STT after SND. (with a timeout on silence)? Or maybe there is a more elegant/effective way to do this.

tbrasser avatar Feb 17 '24 08:02 tbrasser

There is no more SND stage in v2

AlexxIT avatar Feb 17 '24 10:02 AlexxIT

Sorry, I just meant to look for a way to continue the conversation instead of starting at wakeword again.

tbrasser avatar Feb 17 '24 11:02 tbrasser

Well. How you start first pipeline? Via MIC switch or via service?

AlexxIT avatar Feb 17 '24 11:02 AlexxIT

Ah, I can catch something like a pipeline or conversation id and call the run service with that id with STT as start stage? I'll try some things out. 👍

tbrasser avatar Feb 18 '24 21:02 tbrasser

You not answer on my question

AlexxIT avatar Feb 19 '24 03:02 AlexxIT

I toggle the mic switch via an automation.

tbrasser avatar Feb 19 '24 16:02 tbrasser

Well. If you remove WAKE setting from pipeline config - it will start from STT stage. If you want start from WAKE but continue with STT - you can create two pipelines. Then stop one and start another...

AlexxIT avatar Feb 20 '24 09:02 AlexxIT

Basically I'm looking for an equivalent of this: https://esphome.io/components/voice_assistant.html#voice-assistant-start-continuous

tbrasser avatar Apr 04 '24 14:04 tbrasser

Well. If you remove WAKE setting from pipeline config - it will start from STT stage. If you want start from WAKE but continue with STT - you can create two pipelines. Then stop one and start another...

care to explain more? it is not clear, sorry

IoSonoAndreaZ avatar Jun 27 '24 15:06 IoSonoAndreaZ

@AlexxIT, on this topic, I start my first streamassist (called 'livingroom-tablet') pipeline via mic.

I want to write an automation which will start after the livingroom-tablet streamassist tts ends, and as an action will start the same streamassist from stt so it will listen to my next voice command.

In the automation I can call the stream_assist.run service (as in my example below), but how do I call my livingroom-tablet streamassist and start it from stt?

If the automation starts a new streamassist service, it will not continue to the next cycle as it will not trigger the automation (only sensor.livingroom_tablet_tts triggers it).

If I do what you suggested above - two streamassists, one that starts with mic, the other with stt, how do I start the second one from an automation?

What am I missing?

For reference, this is what I have now, which doesn't work:

- id: stream_assist_livingroom_continuous_conversation
  alias: stream_assist_livingroom_continuous_conversation
  trigger:
  - platform: state
    entity_id: sensor.livingroom_tablet_tts
    from: 'start'
    to: 'end'
  action:
  - service: stream_assist.run
    data:
      stream_source: rtp://192.168.1.71:55555
      player_entity_id: media_player.galaxy_tab_s2
      pipeline_id: 01j2nty2rmw17n7rzfvcvk25x9
      assist:
        start_stage: stt
        end_stage: tts

Thanks

nirnachmani avatar Jul 14 '24 05:07 nirnachmani

the important thing is not just to start again listening, but to keep the same conversation.

IoSonoAndreaZ avatar Jul 25 '24 15:07 IoSonoAndreaZ

@AlexxIT, on this topic, I start my first streamassist (called 'livingroom-tablet') pipeline via mic.

I want to write an automation which will start after the livingroom-tablet streamassist tts ends, and as an action will start the same streamassist from stt so it will listen to my next voice command.

In the automation I can call the stream_assist.run service (as in my example below), but how do I call my livingroom-tablet streamassist and start it from stt?

If the automation starts a new streamassist service, it will not continue to the next cycle as it will not trigger the automation (only sensor.livingroom_tablet_tts triggers it).

If I do what you suggested above - two streamassists, one that starts with mic, the other with stt, how do I start the second one from an automation?

What am I missing?

For reference, this is what I have now, which doesn't work:

- id: stream_assist_livingroom_continuous_conversation
  alias: stream_assist_livingroom_continuous_conversation
  trigger:
  - platform: state
    entity_id: sensor.livingroom_tablet_tts
    from: 'start'
    to: 'end'
  action:
  - service: stream_assist.run
    data:
      stream_source: rtp://192.168.1.71:55555
      player_entity_id: media_player.galaxy_tab_s2
      pipeline_id: 01j2nty2rmw17n7rzfvcvk25x9
      assist:
        start_stage: stt
        end_stage: tts

Thanks

I got it working by removing the end stage: tts.

Edit: I was testing it out and it seems like you can leave _end stage: tts inside the assist settings for the stream_assist.run service

What got the service to work for me was turning off the mic for the stream assist integration I had.

Wall-E183 avatar Jul 25 '24 16:07 Wall-E183

the important thing is not just to start again listening, but to keep the same conversation.

I'm not sure how the voice assistant pipeline would understand where to pick up the conversation from. Maybe by using a conversation_id or by saving the intent attribute as a variable and feeding that to a conversation agent that can understand the continuation like ChatGPT.

Wall-E183 avatar Jul 25 '24 16:07 Wall-E183