Rhasspy offline voice assistant toolkit

Great,
thank you. I can confirm I can start add-on without any issue.

Problem with downloading ANY files on Rpi 3via webconsole is confirmed by synesthesiam himself: https://github.com/synesthesiam/rhasspy/issues/208

I am having an issue where I am trying to use a server/client setup, not to dissimilar from the above issue. But I am not running the add-on but through docker. When I try and use the remote STT, recognition is very bad, but when I run on-device (Pi3B+) it works approx 95% of the time. The remote server I am trying to use is an Intel NUC. Both are on the latest stable release, and are using Kaldi. Mic is a Matrix Voice. Has anyone experienced similar?

Hi, Just come across this great project. Unfortunately it all looks a bit too hard and fiddly for me at the moment. We probably need to collectively work on making the setup and productionizing a bit easier :slight_smile:

My setup here is a Proxmox VE Virtual Machine running HASS with a bunch of other gear in a Rack cabinet in my home. I canā€™t see myself adding an external Microphone/Speakers to the Hypervisor nodes just to make this work.

I need to figure out how I can have ā€œNetworkā€(ed) Mics/Speakers in the house which Rhasspy seems to support but I guess itā€™ll take ma a while to figure this out given the documentation so far.

Keep up the great work!

This is (btw) the type of voice-assistant I really want, Almond is great but it still uses a cloud service for the NLU part. And Ada doesnā€™t/wonā€™t work for me at all due to my setup and need to have ā€œnetworkā€(ed) mic/speaker(s).

Maybe this tutorial can help:
Tutorials - Rhasspy.

But 2.5 will be out soon, so I suggest checking the community as well:

Iā€™ve read through this a few times but its not super clear to me how I would apply this type of setup to my virtual environment here. I run Proxmox VE on a 3x-node Cluster. HASS just so happens to be one of the VMs I run. Iā€™m not at all sure how I get for example something like what you describe there as a ā€œSeed Arrayā€? I kind of need to look into some kind of TCP remote Mic/Speaker setup (if thatā€™s even possible).

Iā€™d suggest creating a new VM, and install Rhasppy on there.
You can install the current version:
https://rhasspy.readthedocs.io/en/latest/installation/

Or you can also install the 2.5 prerelease, depending on how comfortabel you are with beta stuff:

For a microphone/speaker, you can use a Pi for that for example. The Pi does not have to have the micarray mentioned, but it needs a microphone. A ps3eye is mentioned as well in various posts

Rhasspy 2.4.20.3 addon, HA image 0.109.6 on RPi 3 B+ with USB Logitech webcam mic.

Now that after 2 days I have a successful trigger by voice interaction outside Web UI, let me share the path:

  1. Web UI error at the Speech tab on getUserMedia - Chrome blocked the mic on http://homeassistant.local:12101/ as insecure.
    Fixed by enabling chrome://flags/#unsafely-treat-insecure-origin-as-secure with this URL.

  2. In Web UI Settings tab, the Hass URL was different from the default one you get after flashing Hassio image.
    Fixed by setting it to http://homeassistant.local:8123/

  3. In Web UI, intent was recognized correctly and resulted in the error 401 Unauthorized during POST to HASS.
    Fixed by generating a Long-lived token at the bottom of the Hassio profile http://homeassistant.local:8123/profile
    and setting it in Web UI Settings ā†’ Access Token (automatically filled in HassIO) - didnā€™t happen.

  4. In Web UI Speech tab, intent was sent successfully to Hassio and registered in http://homeassistant.local:8123/developer-tools/event
    (Listen to events: rhasspy_GetTime)
    Worked for both local and RPi microphone!

  • So I tried to achieve the same from voice input: no effect due to Settings ā†’ Wake word: ā€œNo wake word on this deviceā€.
  1. Switched wake word to Pocketsphinx:
    ā€œOkey Rhasspy! [high-pitch sound] [another high-pitch sound] [error sound]ā€¦ā€
  • no effect, and after some time the Web UI was becoming unresponsive, requiring a restart.
  1. Found the info about Snowboy wake word option being more reliable, switched to it.
    It downloaded the default file snowboy.umdl automatically!
    Found out the default wake word for Snowboy is ā€œsnowboyā€.
    After restart, got the error in Web UI: Snowboy model could not be loaded from profiles/ru/snowboy.umdl
    Fixed by changing in Settings the snowboy.umdl to snowboy/snowboy.umdl

And voila, the automation triggered!

- Snowboy!
- [high-pitch sound]
- What time is it?
- [another high-pitch sound] Time is 14:38
# Canā€™t tell you how happy I was.

Learned a bit of JS, Python and other HA newbie things in the process :slightly_smiling_face:

It would be nice to fix these issues to simplify the entry for new users. I really like the experience when everything started working, hope not all features will be so challenging.

Hi,

I currently have HA installed on my RPi. Iā€™ve got a Respeaker 2-mic which I would like to use with Rhasspy, but I understand ther is no driver for it in native HA, so Iā€™d better install Debian or Raspbian (which is best choice?) on the RPi and then Docker then Hassio and Rhasspy. Am I right?

Thanks for your help.

I cant imagine youā€™ll be able to run Rhasspy AND HA on a pi without impacting either system in terms of performance.

you can install the drivers on either Rapbian, or inside the docker, or create a separate docker. check out the wiki for the repseaker

Hi ! So I have started using HomeAssistant on a Pi 4 a few days ago, and added Rhasspy on it.
It works great, I can switch off my lights by voice, pretty, pretty, pretty cool !

I am now looking for a way to :

  • Tell Rhasspy to add some movies / tv shows to Ombi (with Ombi integration on HA) ;
  • Tell Rhasspy to play some movies / tv shows to Plex / Kodi (with Plex integration on HA) ;

So telling to Rhasspy to send ā€œname: beverly hills copā€ on the ā€œombi.submit_movie_requestā€ service.

Iā€™m also trying to using this kind of sentences/slots with HA.:

(allumer | allume | met) (la | le | l) (lumiĆØre | ampoule | spot) (du | de | de la | des | dans l| dans la | dans le)($Room) (en | de la couleur) ($Color) (Ć ) (1ā€¦100) (pourcent | pourcents)

Is there a way to set it up with variables ? I would like to say ā€œchange light to greenā€ or ā€œchange light to redā€ with one Rhasspy Intent, and one HA automation as well.

in Rhasspy you could define like

[BulbControl]
change (red|green|blue) {color}

in HA intent sciprts

  BulbControl:
    speech:
      text: Bulb Control
    action:
      - service: notify.telenotify
        data_template:
          message: color is {{ color }}

The above is an example to get a notification and display the color information sent from Rhasspy.

Rhasspy can also send a event directly, if you configure the " Send events to Home Assistant (/api/events)" . in HA automation, you just need to define the event type as rhasspy_<Intent_Name>. So in above example it would be event_type: rhasspy_ BulbControl

Each approach have their advantages, since i use both HA internal intent and rhasspy, I tend to prefer send the intent directly from Rhasspy to HA

Hi, thanks for the reply :wink:

For now Iā€™m gonna focus on the Events aspects in Rhasspy and HA, triyng to understand the automations.yaml configuration file.

After a look to this documentation (https://www.home-assistant.io/integrations/plex/), Iā€™ve made this sentence in Rhasspy :

[PlexMovieRequest]
( mets | lance |  joue | lis ) [(la | le | l)] film ($Films){video_name}

Itā€™s supposed to say to HA to tell Plex to play a movie.
Iā€™v already set a slot file (named Films) with all my movies.

Rhasspy can find the movie properly, the name of the movie is linked to the tag ā€œvideo_nameā€ :

1

But I donā€™t know how to set the automations.yaml file to link the ā€œmovie_nameā€ variable to the name of the movie.

My automation currently looks like this :

- id: '1592172342812'
  alias: '[PLEX]PlexMovieRequest'
  description: ''
  trigger:
  - event_data: {}
    event_type: rhasspy_PlexMovieRequest
    platform: event
  condition: []
  action:
    service: media_player.play_media
    data:
      entity_id: media_player.plex_plex_for_kodi_kodi_add_on_kodi
      media_content_id:
        \ā€œlibrary_name\ā€: \ā€œFilms\ā€
        \ā€œvideo_name\ā€: \ā€œvideo_name\ā€
      media_content_type: VIDEO

Iā€™v tried to set the ā€œevent_dataā€ like this, :

 - event_data: {video_name}

but it doesnā€™t work :


[PLEX]PlexMovieRequest: Error executing script. Invalid data for call_service at pos 1: value should be a string for dictionary value @ data['media_content_id']

How can I tell to HomeAssistant to consider a variable in Rhasspy as a correct data ?

I am using Node-Red, however the variable I have to use there are called slots.whatever (slots.video_name in your case). Maybe try that in HA, too.

Looking at your previous post it might also be event_data.video_name . Iā€™m not sure, just guessing as I use Node-Red like I said. But the principle should be the name, the variable is a property (donā€™t know i my terminus is correct) of event_name / slots.

I am also not sure if you include the variable correctly in the script. Looking at my old Snips intent scripts, I used to include variables like this (changed it to fit a little to your example and still think you MIGHT need slots. or event_data. prior to video_name):

      media_content_id:
        \ā€œlibrary_name\ā€: \ā€œFilms\ā€
        \ā€œvideo_name\ā€: '{{ video_name }}'

Thanks for your suggestions :wink:

Since this morning I have made some changes in the " media_content_id" (seems like the exact synthax in this recent documentation : https://www.home-assistant.io/integrations/plex/). So I donā€™t have any longer the "value should be a string for dictionary value " error.

I have tried a bunch of combinaison, but none of them makes any difference :

      media_content_id: '{ "library_name": "Films", "video_name": event_data.{{ video_name }} }'
      media_content_id: '{ "library_name": "Films", "video_name": "event_data.{{ video_name }}" }'
      media_content_id: '{ "library_name": "Films", "video_name": "event_data.video_name" }'
      media_content_id: '{ "library_name": "Films", "video_name": event_data.video_name }'
	  	  
      media_content_id: '{ "library_name": "Films", "video_name": slots_data.{{ video_name }} }'
      media_content_id: '{ "library_name": "Films", "video_name": "slots_data.{{ video_name }}" }'
      media_content_id: '{ "library_name": "Films", "video_name": slots_data.video_name }'
      media_content_id: '{ "library_name": "Films", "video_name": "slots_data.video_name" }'
	  
      media_content_id: '{ "library_name": "Films", "video_name": {{ video_name }} }'
      media_content_id: '{ "library_name": "Films", "video_name": "{{ video_name }}" }'
      media_content_id: '{ "library_name": "Films", "video_name": video_name }'
      media_content_id: '{ "library_name": "Films", "video_name": "video_name" }'
	  
      media_content_id: '{ "library_name": "Films", "video_name": trigger.event_data.{{ video_name }} }'
      media_content_id: '{ "library_name": "Films", "video_name": "trigger.event_data.{{ video_name }}" }'
      media_content_id: '{ "library_name": "Films", "video_name": trigger.event_data.video_name }'
      media_content_id: '{ "library_name": "Films", "video_name": "trigger.event_data.video_name" }'

I think the problem is for now related to Plex. I canā€™t call properly the service with a specific value :

entity_id: media_player.plex_plex_for_kodi_kodi
media_content_id: '{ "playlist_name": "Synth", "shuffle": "1" }'
media_content_type: PLAYLIST

Plex donā€™t react at all. I also see that my ā€œmedia.controlā€ cards donā€™t have any buttons to control Plex. I can only see what is currently playing :

3

Tested on different client (Plexamp, Plex for Android, Plex Extension for Kodi, Plex on Firefox), most of them locally. HomeAssistant is listed on the Plex ā€œAuthorized deviceā€, but is not visible on the logs (same for the local IP).

But if this is a Plex issue, iā€™m gonna look in a different topic, and came later once this is fixed.

Sorry I am out here as I donā€™t use Plex :slight_smile: No idea how to talk to it.

Did you try to control Plex from the developer tools -> services menu (donā€™t know if thats the exact names in english UI) in the Home Assistant UI to verify it is working from there? Then you would know if you have a problem in your scripts or with Plex / HA in general.

I was wrong, I can see the Play button for the Plex Android client :

But in Developer Tools -> Services , if I test the service like this :

entity_id: media_player.plex_plex_for_android_mobile_xz2_compact
media_content_id: '{ "playlist_name": "Synth", "shuffle": "1" }'
media_content_type: PLAYLIST

It doesnā€™t work, even with the Plex Android client. Iā€™m gonna try to find some other media player to try this service.

Iā€™ve got the same ā€œvariablesā€ issues with Ombi.

The sentence in Rhasspy :

[OmbiMovieRequest]
Ajoute le film ($Films){name}

The query :

If I test the service ā€œombi.submit_movie_requestā€ from Developer Tools -> Services, it work :

6

But no way to got it to work with automation.yaml, iā€™v tried again a lot of combinaison :

  name: '{ event_data.{{ name }} }'
  name: '{ "event_data.{{ name }}" }'
  name: '{ "event_data.name" }'
  name: '{ event_data.name }'

  name: '{ slots_data.{{ name }} }'
  name: '{ "slots_data.{{ name }}" }'
  name: '{ slots_data.name }'
  name: '{ "slots_data.name" }'

  name: '{ {{ name }} }'
  name: '{ "{{ name }}" }'
  name: '{ name }'
  name: '{ name }'

  name: '{ trigger.event_data.{{ name }} }'
  name: '{ "trigger.event_data.{{ name }}" }'
  name: '{ trigger.event_data.name }'
  name: '{ "trigger.event_data.name" }'

Try:

{{ trigger.event.data.name }}

I am using this in my automation:

- id: '1581372525473'
  alias: EventLampen
  trigger:
  - event_data: {}
    event_type: rhasspy_Lights
    platform: event
  condition: []
  action:
  - data_template:
      payload: OK, {{ trigger.event.data.location }} {% if trigger.event.data.action
        == "on" %}aan{% else %}uit{%  endif %}
    service: rest_command.rhasspy_speak
  - data_template:
      entity_id: light.{{ trigger.event.data.location }}
    service_template: light.turn_{{ trigger.event.data.action }}

Also check if Rhasspy is sending events and not intents

Hi ! Thanks, it finally worked, after some trying ! The final automation :

- id: '1592172281599'
  alias: '[OMBI]OmbiMovieRequest'
  trigger:
    event_data: {}
    platform: event
    event_type: rhasspy_OmbiMovieRequest
  action:
    service: ombi.submit_movie_request
    data_template:
      name: "{{ trigger.event.data.name }}"

Iā€™m gonna try this synthax for Plex, if I found a workaround for the issue with it

Sorry, I forgotā€¦ I have choose Ombi to find the right synthax to use for Plex, but I donā€™t have a slot file for Ombi, only for Plex.

Plex can choose a movie to play from the ā€œFilmsā€ slot file, but Ombi is a service who add movies to Plex.

So I have to set Rhasspy and Home Assistant to recognize a word who is not in the sentences/slots.

For exemple :

Ajoute le film ($){name}

Where ($) is the unknown variables.

Is it something possible to set ?

In the worst case, I think I could make a slot file with thousands of names of movies and TV Shows, but Iā€™s gonna take for ever to Rhasspy to train with all this data.