Rhasspy dialogue manager and back-and-forth dialogue

Hello,

I have a rhasspy satellite, a rhasspy base station, an MQTT broker, and home assistant running.
I am able to activate the satellite with the wakeword, issue a command, have the intent recognized on the base station and handled via home assistant using events. However, I would like rhasspy to return a voice message as a response to the command. Currently I have this in HA automations and it works:

automation:
  - alias: "Start vacuuming the house"
    trigger:
      platform: event
      event_type: rhasspy_StartVacuum
    action:
      - service: mqtt.publish 
        data:
        # jinja templating           
        payload_template: '{"siteId": "{{trigger.event.data._intent.siteId}}", "text": "Starting to vacuum the  house"}'
        topic: hermes/tts/say

Here I am publishing a mqtt message directly to hermes/tts/say.

However, I thought I had to use the dialogue manager for this, in particular publish to hermes/dialogueManager/continueSession with a payload containing the session id and the text to be spoken, as per the reference here. This does not work, however. Am I misunderstanding the role of the dialogue manager?

Secondly, suppose I want rhasspy to receive a command, ask a question in response to a recognized intent, and wait for a response to the question (a back-and-forth scenario). How would I achieve this? Again, my assumption here was that I would have to use the dialogue manager continueSession topic, having e.g. custom code publish to that topic in response to a recognized intent from the first command, and that the base station’s dialogue manager would then take care of doing tts and triggering the satellite to start listening again. Is this an accurate model of how this could work?

1 Like

btw this question is essentially the same but no answer there as yet.

R.

Another funny thing related to this. If I send a message to hermes/dialogueManager/startSession with:

{
  "init": {
    "type": "notification",
    "text": "Starting Session"
  },
  "siteId": "satellite-study"
}

The satellite is activated and it speaks the message. But if I send as a message:

{
  "init": {
    "type": "action",
    "text": "Starting Session"
  },
  "siteId": "satellite-study"
}

It looks like a response at hermes/dialogueManager/startSession is sent, but the message is not spoken, which it should be according to this. Weird. Not sure I understand the dialogue manager at all here.

Thanks! This appears to a bug, actually. I was not properly cleaning up the session on end, so the text would only be spoken for the very first session.

This will be fixed in the next version :+1:

1 Like

Ah! That makes me feel good, being of help to such an awesome project as rhasspy.
Btw I opened an issue on github on this, see https://github.com/rhasspy/rhasspy/issues/186. @synesthesiam you can close it adding whatever appropriate comments.

I am going to keep testing the dialogue manager for a project I am building with rhasspy, let’s see if I can find more bugs :smiley:

R.

1 Like