Rhasspy, Respeaker and Openhabian/Home Assistant - Most easy setup?

Hello, I hope you guys are feeling good. I am looking for some beginner advices on getting started with my home automation setup. I am interested in voice communicating with my house. I bought a raspberry pi 4 couples months ago and am trying to push my knowledge in different context and I need some help to get a good core setup for home automation specifically. I do not mind to have openhab or home assistant but I would like to be able to use my Respeaker and have also Rhasspy. I have been able to setup Openhabian and Rhasspy but I didn’t find much information on how to make both instance communicate together. I believe Rhasspy was more developed with Home assistant integration. I tried to install HA os and Rhasspy and it worked, although I can not use my Respeaker because I did not find how to install the drivers… I followed by trying to install raspberry os and HA with docker but ended without add on tab… Lastly, I follow some deprecated tutorial on installing supervised
on raspberry os or Debian 10 buster but never ended with the intended result.

Is there a way to achieve my goal and if yes, can you please give me the direction to follow. Thank you very much, hope you guys have a great one.

Welcome :slight_smile:

Rhasspy is working great with Home Assistant
For Home Assisant, here is a comparison table:

On a raspberry Pi you must either:

  • Install Home Assistant OS, you then have addons but cannot install drivers for the Respeaker
  • Install Docker and Home Assistant Container. No addons, but you can install Rhasppy as a container as well and be able to install drivers for the Respeaker

Thank you very much for your answer. I will try to install Docker HA and docker Rhasspy.
Will they communicate well and easy together just like a regular setup? Will I need to do some twisting to get it to work? Thank you and stay safe.

You need to create a long live token in HA and set that in the intent handling. But that is a simple step :slight_smile:

Thank you for the quick answer. Everything is working fine thank you, this was the solution. I have added my HA localhost ip address and port and also added a access token. My last question is where can I find information on how to program everything? Example: I have the porcupine wake word working with Respeaker and I ask “what is the time” and Rhasspy give a gettime intent. Can I return answers like : It is x o clock? Basically, it checks the time zone of HA and return the time? How will I program everything. There is probably documentation on that but a simple example would help me understand the general functioning. It looks like a very powerful setup. Privacy oriented and open source, you guys rock. Thanks

I use events to send to Home Assistant.
These can be used in automations, the automations can be anything you want :slight_smile:

If you check on my postst, you will probably find some examples whch I have posted here earlier :slight_smile:

Perfect thank you. I will be looking in the documentation and your history to find more example. In automation in HA, I do not see where to call the service current time. Also to send the answer thru the speaker, you have to create an other event to send back a message to Rhasspy. Is that it?

There is no service for current time in Home Assistant, but you can use a data_template or something like that.

No, you can publish a message to MQTT.

This is my lights event (in automations.yaml)

- id: '1581372525473'
  alias: EventLampen
  - event_data: {}
    event_type: rhasspy_Lights
    platform: event
  condition: []
  - data_template:
      entity_id: light.{{ trigger.event.data.location }}
    service_template: light.turn_{{ trigger.event.data.action }}
  - service: mqtt.publish
      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

The automation is triggered by the rhasspy_Lights event and does two things:

  1. turn the light on the location on or off (slots are location and action)
  2. Send a response to Rhasspy via hermes/dialogueManager/endSession

The second action has a sessionID and a text, with which Rhasspy closes the session and does a speech-to-text on the text provided.

1 Like

The easiest method is to use MQTT
and write a script that will react according to the Intents
1 - create a broker with the IP of Rhasspy
2 - create a Bridge with the brocker
3 - create one or more channels
4 - create a link item string which will receive the topic



and finally a rules to process the topic received in the string


Your last image is the same as the one before that.
And yes, your route is also good.

Depends on what your home automation system you want to use I guess.
So I suggest to try both and see what fits you

Thank you very much. I was able to setup my Z-wave stick and have a smart plug and I lamp.
I created an intent “BedroomLamp” in the sentences. I am able to see it on Node red. I have selected Send events to Home Assistant (/api/events) in intent handling with my localhost ip and port to HA. I have also created a Long-Lived Access Tokens and added it in the rhasspy config too. I then created an automation in HA that triggers on rhasspy_BedroomLamp to turn it on. The automation itself is working but I am not able to get the voice command to turn on the lamp even though I see the intent on Node red. Any idea?

Can you post some logfiles from Rhasspy and your automation? There must be a mismatch somewhere.
What do you see in Node Red?

5/6/2021, 4:23:54 PM[node: d7f94fdd.9b5028]( : Object


intent: object

name: "BedroomLamp"

confidence: 1

entities: array[0]

slots: object


text: "turn on the bedroom lamp"

raw_text: "turn on the bedroom lamp"

tokens: array[5]

0: "turn"

1: "on"

2: "the"

3: "bedroom"

4: "lamp"

raw_tokens: array[5]

0: "turn"

1: "on"

2: "the"

3: "bedroom"

4: "lamp"

wakeword_id: "default"

siteId: "default"

sessionId: "default-default-e43b3e7d-c6a2-491c-9922-f68fe3ed615e"

customData: "default"

wakewordId: "default"

lang: null

_session: object

type: "websocket"

id: "edb45b25.695228"

_msgid: "9ed2675c.b5c498"

this is on Node-red

id: '1620213779441'
alias: rhasspy_BedroomLamp
description: ''
  - platform: event
    event_type: rhasspy_BedroomLamp
    context: {}
condition: []
  - type: turn_on
    device_id: 1a1f7a2d0b43cfaad6845786ef34306a
    entity_id: switch.zwave_plug_2_channel_plugin_outlet
    domain: switch
mode: single


I think you send Intents, not Events. Can you post a screenshot of your Rhasspy setting?

1 Like

Thanks for the help.

Looks ok, but I still think there is a connection problem

You can check if an event is fired on the developer tab in Home Assistant:

If you press “START LISTENING”, Home Assistant starts listening. Then try to turn on the lamp and the event should be listed below.
If it is, something might be wrong with the automation, if it is not something is wrong in Rhasspy or in the connection :slight_smile:

Also, create a MQTT in in Node Red with topic hermes/intent/# and let the node flow to a debug output.
Check what’s logged.
The make things easier, you can enter a text in Rhasspy, check “handle” and press “Recognize”"

1 Like

Perfect, I did exactly as you mentioned in the first screenshot. When I fire the event from HA, the lamp opens. It is when I use rhasspy and respeaker that I can not get it to work it seems. I do not know exactly how to create MQTT debug message. Should I import special json from hamburger button like we do to catch intent from rhasspy tutorial?

Thank you for your time.

No, just do this in a Node Red flow:

Connect it to the broker your Rhasspy is connected to.

You said fire the event from HA, do you mean from Rhasspy or HA? My second screenshot is Rhasspy, you should try that to check if events are send from Rhasspy

1 Like

Oh sorry. I though you meant to fire the event directly from the developer tab in HA. This made the lamp open. Although, when I listen to rhasspy_BedroomLamp and use Rhasspy to try to launch that even, it doesn’t work. You say to connect it to a MQTT broker, which instance/port my MQTT broker exactly? I do not know much about all of these tools. Most are things I’ve never used. Sorry x)

I think the issue is the connection between Rhasspy and HA or the fact that HA doesn’t receive the event trigger from Rhasspy.

You used Node Red right? That is wat you have said earlier :slight_smile:
That is why I thought you knew how to use it.

Let’s take it a step back. How did you setup MQTT in Rhasspy?
If internal, you must use the ip of Rhasspy and the internal port (12183 per default)
If external, you the ipaddress and port of that broker.

If you have the addons tab in Home Assistant, I suggest installing the MQTT addon and use that as broker

1 Like