Rhasspy offline voice assistant toolkit

The /api/listen-for-command endpoint is probably the best way to achieve this. If you POST to this endpoint, Rhasspy will begin listening for a command (no beep), and automatically handle the command given (you’ll also get back the JSON).

I’ve just added a few options to listen-for-command to help you out:

  • /api/listen-for-command?timeout=5 will time out after 5 seconds
  • /api/listen-for-command?entity=my-entity&value=my-value will set the slot my-entity to my-value in the recognized intent

You can use the second option to pass some event id into HA. It will come in as a property of the HA event from Rhasspy.

The only thing missing here is the ability to select which intents Rhasspy will listen for. The infrastructure to do this in present, but I haven’t decided yet on how to optimally expose it. So, for now, Rhasspy will always listen for all possible intents.

I got that error too, restarting home assistant resolved it.
I hope that helps.

Thank you Michael for the fast implementation. This will be enough for my first trys to set something up.
Will try it when there is an updated docker image.

Great to hear the specific intent idea might be possible in the future

1 Like

Thanks for the pointers.
I am using Node-Red for automations.
I was thinking I would use a web-socket connection to send the TTS message, but I think that Rhasspy is not setup to allow messages, only to broadcast (I know next to nothing about web-sockets).

Anyway, I found the POST in the http request node - and it worked on the first try!

… and a few minutes later I have my first Rhasspy response working!

Web-socket listener node - Listener for Rhasspy intents
Switch node - filters for only the designated intent
HA Current State node - get the sensor value (in this case outside temperature)
Template node - write the text payload “Current Temperature outside is {{payload}}
HTTP Request node - send payload back to Rhasspy TTS.

Cheers!
DeadEnd

2 Likes

I’m not sure if the Zero will run armhf programs. I may need to compile a special version just for ARMv6.

I have a x86 ubuntu server with hassio + rhasspy addon, but i cant get it to work with a remote mic. I am having no luck with hermes audio recorder.

A pi zero w + ReSpeaker 2 mic as clients with rhasspy on it would be a easier solution.

Could you be more specific about what is going wrong? Maybe we can help then.

I just did a very similar setup just yersterday.

X86_64 Debian Server with rhasspy-server (2.3) and mosquitto mqtt server (without TLS) as docker containers.
Pi Zero W (Raspbian Buster Lite. up to date) + ReSpeaker Head as Satellite using hermes-audio-server (0.2.0).

Were did you had your problems? I only had issues with the default alsa config made by the respeaker drivers. For some reason hermes-audio-server was not happy with it and i hat to modify it a bit otherwise hermes would crash with incoming audio.

Hi can you help me on how to use this in nodered?
I got it working with curl -post but the same url wont work in nodered, rhasspy listens but the custom settings wont.

If you look above I have an example of a simple flow that listens to the web socket, processing a response, and sends back a POST for TTS.

See if that example helps.

Cheers!
DeadEnd

Also had this issue.
I did a complete fresh install of the latest docker image and had to manually copy a few files as described here: https://github.com/synesthesiam/rhasspy/issues/44

I was talking about using this custom settings. Rhasspy activates but timeout or the entitity option wont work if i send this using a simple http post note.

Using curl from the shell works fine tho so it is a problem with how i setup the node, i justed pasted the whole url with the optionts (?timeout=5&entity…) but this wont work.

Just pushed an update that should address this. Rhasspy was returning the right stuff in the POST response, but any intents coming out of the websocket weren’t properly updated. The timeout also wasn’t being honored in some circumstances.

Hopes this helps!

The services seams to be running with no errors.
It connects with my mqt server, and the mic is found.

But when i talk in the mic i dont see anything apear in the mqt topic of hermes/# .

Have you tried starting both services with the -v option for verbose output? And the value for the microphone volume is set high enough in the ALSA settings?

i reduced my /etc/asound.conf to this:

pcm.!default {
	type asym
	playback.pcm "playback"
	capture.pcm "capture"
}

pcm.playback {
	type plug
	slave.pcm "hw:1,0"
}

pcm.capture {
	type plug
	slave.pcm "hw:1,0"
}

So i removed all the dmix stuff, since hermes is only thing running on this right now it should not be a problem, but if you want more services to use the audio devices this might not work for you.

Thanks, it is working now, but it seems the timeout is still limited to 2-3 seconds. But this is not an issue with my current usecase.

btw if someone is intrested i can post some examples of what im doing.
I have setup my system to sound like an english butler and created a funny command for my girlfriend.

You can tell rhasspy that you would like to take a bath soon, then it checks the temperature in the bathroom and if its below a certain threshold it will ask you if it should turn on the radiator first. if you anser with yes it will check if the window is open and turn on the radiator, if the window is open it will report that back and wont turn on the radiator.

im using a simple yes or no intent for the answer to rhasspys question but since i set a special entity for this it can see that this is the response for the questions it just asked.

1 Like

Yes please! :slight_smile:

This is cool :slight_smile: If you’re willing to share, this might be a neat example to include with Rhasspy or in the docs.

So I am a snips refugee and Rhasspy looks like the most promising tool to replace it (this new Almond development is interesting but lacks documentation).

This thread is quite large… as a newbie to Rhasspy what’s the recommended set of servicoto use? I definitely need something flexible that hab handle words not explicitly in the sentences. Training time and CPU isn’t an issue, but privacy is, I’d rather nothing go to the cloud. Hosting extra services is fine.

Also is there any sort of shared repo of Rhasspy sentences/intents? Seeing real world examples is super helpful I find.

Edit: reading back over the last few weeks of posts, I see that Rhasspy despite being modular in so many ways, hadn’t quite reached modularity when it comes to what other services call apps or skills.

Assume I want some intents executed against HA and some to just execute a python script (to fetch the weather for example), is that possible now with Rhasspy?