Rhasspy offline voice assistant toolkit

Rhasspy profiles are in the share folder, you can acces that with the Samba Addon.
Then, navigate to /share/rhasspy/profiles/<yourlanguage>/slot_programs.
Add a folder hass and add that script in there

1 Like

The use of templates is key here I guess :slight_smile:
Did you use them?

Ah, thanks for that. Unfortunately I’m still getting an error

CalledProcessError: Command '['/share/rhasspy/profiles/en/slot_programs/hass/entities', 'light']' returned non-zero exit status 12

Seems it can’t find the file? I’ll note that the slot_programs folder did not exist.

I don’t honestly remember. I do recall something about intents, but not sure about templates.
I’ll probably try again this winter as I have more time inside then and I’ll try to look for some docs on templates. Thanks for the tip!

What do your sentences look like?

Personally I use events, that is because you can use them in automations very easily.
If you use intents (and intent_script in configuration.yaml) you always need to restart HA

This is my automation to switch lights (all lights known in Rhasspy sentences)

- id: '1581372525473'
  alias: EventLampen
  trigger:
  - event_data: {}
    event_type: rhasspy_Lights
    platform: event
  condition: []
  action:
  - data_template:
      entity_id: light.{{ trigger.event.data.location }}
    service_template: light.turn_{{ trigger.event.data.action }}
  - service: mqtt.publish
    data:
      topic: hermes/dialogueManager/endSession
      payload_template: '{"sessionId": "{{trigger.event.data._intent.sessionId}}",
        "text": "Okee, {{ trigger.event.data.location }} {% if trigger.event.data.action
        == "on" %}aan{% else %}uit{%  endif %}"}'
  mode: single

I’ve started with adding just one entry for HASS beyond the defaults.

[GetTime]
what time is it
tell me the time

[GetTemperature]
whats the temperature
how (hot | cold) is it

[GetGarageState]
is the garage door (open | closed)

[ChangeLightState]
light_name = ((living room lamp | garage light) {name}) | <ChangeLightColor.light_name>
light_state = (on | off) {state}

turn <light_state> [the] <light_name>
turn [the] <light_name> <light_state>

[ChangeLightColor]
light_name = (bedroom light) {name}
color = (red | green | blue) {color}


set [the] <light_name> [to] <color>
make [the] <light_name> <color>

[HassTurnOn]
lights = $hass/entities,light
switches = $hass/entities,switch
entities = <lights> | <switches>
turn on [the] (<entities>){name}

look ok, have you set the token and url in Rhasspy settings?
I think the script needs it

url="$(jq --raw-output .home_assistant.url < "${profile}")"
token="$(jq --raw-output .home_assistant.access_token < "${profile}")"

I have done, yes. Though I understand that because I’m using the add-on the token should be autofilled.

Normally yes, but the script would not work without it for me.
The script was not actually written for the Addon, that is probably the reason.

I do not know why that error occurs sadly, but exit code 12 is something about memory

The end was cut off, the error is 127 not 12.
Thanks for your help.

Ah ok, sorry about that. Can you post a screenshot of the location?

I deleted and recreated the file and the 127 error is gone. I suspect I’d done it wrong, maybe having done it with samba.

I have a new error, however.

TrainingFailedException: Command '['fstcompile', '--isymbols=/share/rhasspy/profiles/en/kaldi/model/data/lang/words.txt', '--osymbols=/share/rhasspy/profiles/en/kaldi/model/data/lang/words.txt', '--keep_isymbols=false', '--keep_osymbols=false', '/share/rhasspy/profiles/en/kaldi/language_model.txt', '/share/rhasspy/profiles/en/kaldi/model/data/lang/G.fst']' returned non-zero exit status 1.

Maybe you are better off here for that :slight_smile:

2 Likes

I am so tired and need an assist if possible. I want to use my computer headset on macos to trigger the wake word. How would this best be accomplished. I have node red w/home assistant, I have rhasspy in a docker, I’ve explored hermesmqtt etc. Any ideas would be greatly appreciated.

One way is by running gstreamer as the mic input for Rhasspy, and then streaming audio from your desktop into it via UDP.

I need help
Try to train Rhasspy and have an error.
I use this youtube channel for help and files: Local Voice Control With Home Assistant Just Got Easier! - YouTube
and this is what I got



Please let me know what I am doing wrong and if I have to reinstall my profile , how to do this?
TY

The three red lines of the second screenshot look like it should be

mkdir -p /share/rhasspy/profiles/en/slot_programs/hass/

TY
I will try. I pause playing with Rhasspy for now, have othe project to finish.
Will come back to this after I will be done. Thank you again

8 Likes