Rhasspy offline voice assistant toolkit

So I have my setup working so far but wanted to ask if anyone else is having issues using PyAudion as the microphone input. When I selected this and used the test button, they all have “error”. If I change it to Arecord (ALSA) it works.

Running from the Rhasspy container - is there anything I need to do to use the PyAudio or is my setup just not happy with it?

Also, is there any benefit of one over the other?

Thanks!
DeadEnd

Are you using Hass.IO?
Maybe if you are it is just hidden in this screen since Hass.IO manages that itself.

I use the HA container (not Hass.IO) and so have the other containers created manually - which requires the token to be manually entered.

DeadEnd

No, I mean in the log from Rhasppy Addon, is there no error?

If not, do you see logging arise when you speak the wakeword?

Yes, I run Hassio on a NUC, but before on a Pi3.

Never ever filled those field in Rhasspy, never had connection issues.

Okay, that must be the case then. It says Hass.IO manages the tokens for add-on’s. I just didn’t know it doesn’t display them… must be handled in the background I guess…

@Donkie - did you install Rhasspy from the add-on store of Hass.IO, or directly in Docker?

DeadEnd

Looks like you’re missing a / before hassio. It should be http:// :slight_smile:

Yep. Hass.IO automatically puts an environment variable named HASSIO_TOKEN in the add-on, which Rhasspy reads and sends along when it’s running in Hass.IO.

Good morning. Http/ was a typo. Corrections did not help.
I installed hass.io from original image. Added the repository and installed the rhasspy assistant add-on. No cli or docker actions.

Last log from rhasspy:

[ERROR:37848527] HomeAssistantIntentHandler: handle_intent
Traceback (most recent call last):
File “/usr/share/rhasspy/rhasspy/intent_handler.py”, line 104, in in_started
intent = self.handle_intent(intent)
File “/usr/share/rhasspy/rhasspy/intent_handler.py”, line 145, in handle_intent
self.forward_intent(event_type, slots)
File “/usr/share/rhasspy/rhasspy/intent_handler.py”, line 159, in forward_intent
response = requests.post(post_url, **kwargs)
File “/usr/local/lib/python3.6/dist-packages/requests/api.py”, line 116, in post
return request(‘post’, url, data=data, json=json, **kwargs)
File “/usr/local/lib/python3.6/dist-packages/requests/api.py”, line 60, in request
return session.request(method=method, url=url, **kwargs)
File “/usr/local/lib/python3.6/dist-packages/requests/sessions.py”, line 519, in request
prep = self.prepare_request(req)
File “/usr/local/lib/python3.6/dist-packages/requests/sessions.py”, line 462, in prepare_request
hooks=merge_hooks(request.hooks, self.hooks),
File “/usr/local/lib/python3.6/dist-packages/requests/models.py”, line 313, in prepare
self.prepare_url(url, params)
File “/usr/local/lib/python3.6/dist-packages/requests/models.py”, line 390, in prepare_url
raise InvalidURL(“Invalid URL %r: No host supplied” % url)
requests.exceptions.InvalidURL: Invalid URL ‘https:/hassio/homeassistant/api/events/rhasspy_GetTime’: No host supplied

Misses a /, should be https://

I ended up restoring a snapshot and reinstalling Rhasspy. And suddenly as you all described it works without any difficulties!!!
Thanks for your support and keep up the good work!!!

2 Likes

I have just updated my repo with resampling code!

This has been tested with 16000/22050/44100 mono and stereo, all should be resampled to 44100 stereo.
I also have fixed the distortion mostly, I get is sometimes stille but the main issue was the audiobuffer being overwritten by the next audio message.

1 Like

I see you are adding Rhasspy as an integration @synesthesiam.

Great!

I am! They’re adding in more things for voice assistants, like a speech to text component and different back-ends for the conversation component. My integration will be able to auto-generate sentences for your devices out of the box, and let you manage most things via HA’s configuration.

Paulus, the HA lead, seems to be focused on Stanford’s Almond for assistant functionality, but he spoke with me about Rhasspy. Almond needs an external cloud service for speech; currently Microsoft’s. I plan to position Rhasspy as a fully private alternative :slight_smile:

I’m making some back-end changes to Rhasspy to support the upcoming integration. While I’m at it, I’m merging in some Kaldi models for English, German, and Dutch. These are more accurate than the Pocketsphinx models, and should still run fine on your NUC.

1 Like

There’s also now a rhasspy-client Python package for interacting with a remote Rhasspy server.

1 Like

Cool! What are the main use cases for this client?

Nice, I’ll have to try the Dutch one!

These won’t run on a Raspberry Pi?

I guess all HA integrations need to talk to services through a client library, so…
But, it is a way to use a Rhasspy server from Python or via the command-line. It lets you do something like this:

$ python3 -m rhasspyclient speech-to-text /path/to/my-wav-file.wav

They will, yes, but might be too slow to use in practice. I’ll push the update soon and you can give it a try :slight_smile:

Can you tell if your issue is resolved. I am also stuck on error connecting to homeassistant. I copied the .pem file in profile folder. Below is the setting i am using -

The profile folder is /share/rhasspy/profiles/<yourlanguage>, not /share/rhasspy/profiles
Did you put in the subfolder of your language?

1 Like

The .pem files are in directly in the folder /share/rhasspy/profiles/en/ . I tried changing the path but still same error "Unable to reach your Home Assistant server at https://10.0.0.211:8123. Is it running? ".