Unable to sent events to Home Assistant

Hello!

I have installed Home Assistant as a container to an Intel NUC system (Debian) with IP 192.168.21.90. HA is working properly and I have also configured the MQTT server (Mosquitto) with a user for Rhasspy (username: rhasspy).

I have installed Rhasspy as a container to an Asus tinker board system (Armbian) with IP 192.168.21.93. Mic and speakers are configured. Rhasspy is connected to the external (HA) MQTT, using HA for intent handling and is configured to send events.

While curl -X GET -H “Authorization: Bearer MY_TOKEN” -H “Content-Type: application/json” http://192.168.21.90:8123/api/ returns {“message”: “API running.”}, no event is received by HA.

I try to listen to rhasspy_GetTime with no success. At the same time, if I connect to the HA MQQT server and listen at the topic hermes/intent/GetTime, I get:

{"input": "tell me the time", "intent": {"intentName": "GetTime", "confidenceScore": 1.0}, "siteId": "default", "id": "3b768435-3664-422c-bb76-c63f70976da6", "slots": [], "sessionId": "3b768435-3664-422c-bb76-c63f70976da6", "customData": null, "asrTokens": [[{"value": "tell", "confidence": 1.0, "rangeStart": 0, "rangeEnd": 4, "time": null}, {"value": "me", "confidence": 1.0, "rangeStart": 5, "rangeEnd": 7, "time": null}, {"value": "the", "confidence": 1.0, "rangeStart": 8, "rangeEnd": 11, "time": null}, {"value": "time", "confidence": 1.0, "rangeStart": 12, "rangeEnd": 16, "time": null}]], "asrConfidence": null, "rawInput": "tell me the time", "wakewordId": null, "lang": null}

My Rhasspy profile is the following:

{
    "dialogue": {
        "system": "rhasspy"
    },
    "handle": {
        "system": "hass"
    },
    "home_assistant": {
        "access_token": "MY_TOKEN",
        "handle_type": "event",
        "url": "http://192.168.21.90:8123"
    },
    "intent": {
        "system": "fsticuffs"
    },
    "microphone": {
        "arecord": {
            "device": "default:CARD=CameraB409241"
        },
        "system": "arecord"
    },
    "mqtt": {
        "enabled": "true",
        "host": "192.168.21.90",
        "password": "MY_PASSWD",
        "username": "rhasspy"
    },
    "sounds": {
        "aplay": {
            "device": "plughw:CARD=OnBoard,DEV=2"
        },
        "system": "aplay"
    },
    "speech_to_text": {
        "system": "kaldi"
    },
    "text_to_speech": {
        "larynx": {
            "default_voice": "southern_english_male",
            "vocoder": "vctk_medium"
        },
        "system": "larynx"
    },
    "wake": {
        "porcupine": {
            "keyword_path": "jarvis_raspberry-pi.ppn"
        },
        "system": "porcupine"
    }
}

Any ideas?

I gothrog,

You have Rhasspy running on your NUC (base station) and Rhasspy running on your tinker board (satellite) - therefore you have TWO Rhasspy profiles which must talk to each other.

Is the Rhasspy profile you included above, from your NUC (base station) or your Tinker board (satellite) ? I see Speech_to_text, intent, and text_to_speech are all running locally, so I assume this is from your NUC (base station).

You mentioned using External MQTT … in which case you need to fill in the “Satellite IDs” fields at your Base station. The documentation says

Under each service (including Dialogue Management), add the site id of each of your satellites to the “Satellite siteIds” text box (separated by commas). This will cause that particular service to response to MQTT messages coming from that satellite.

I think this is the problem, but if not please post the profile from your Satellite as well.

Donburch, thank you for your reply!

I do not use a satellite, just one (base) Rhasspy instance having the mic and speakers.
I have setup the MQTT for the rhasspy to received responses from HA and close the session.

The problem is that although tthe wake word is recognized by rhasspy and the intent is
understood no event is sent to HA…

[UPDATE]:

Issuing (by hand):

curl -X POST -H "Authorization: Bearer MY_TOKEN" -H "Content-Type: application/json" http://192.168.21.90:8123/api/events/rhasspy_GetTime

the HA receives the event both from the system and from inside the rhasspy container:

gothrog@tinker:~$ curl -X POST -H "Authorization: Bearer MY_TOKEN" -H "Content-Type: application/json" http://192.168.21.90:8123/api/events/rhasspy_GetTime
{"message": "Event rhasspy_GetTime fired."}
gothrog@tinker:~$ docker exec -it rhasspy  /bin/bash                              
root@6a76867:/# curl -X POST -H "Authorization: Bearer MY_TOKEN" -H "Content-Type: application/json" http://192.168.21.90:8123/api/events/rhasspy_GetTime
{"message": "Event rhasspy_GetTime fired."}

And when listening to the rhasspy_GetTime event at the HA, I get:

{
    "event_type": "rhasspy_GetTime",
    "data": {},
    "origin": "REMOTE",
    "time_fired": "2022-02-12T13:33:27.400574+00:00",
    "context": {
        "id": "c0f........",
        "parent_id": null,
        "user_id": "b6........"
    }
}

It seems that the problem is at the Rhasspy side! Possible profile problem? I cannot tell :frowning:

Any ideas???

[UPDATE #2]:

I correctly receive the events (using ws) to the Node-Red add-on inside the HA:

Now, I am even more perplexed…

Out of frustration I recreated the Rhasspy container and upgraded to version 2.5.11.
Now the events are correctly received by HA!!!

Apologies for posting multiple messages to the same topic!

1 Like

My apologies. I was confused by your original post starting by describing two systems with two IP addresses.

I am pleased that you got it worked out :slight_smile:

1 Like

Hello, I think the easiest way to talk to Hassio or Homeassistant from Rhasspy is to use the topic: hermes/intent/whatever … Rhasspy will always send this when it detects an intent. In Homeassistant you can then make an automation like this:

automation:

  • alias: bonjour
    trigger:
    • platform: mqtt
      topic: hermes/intent/bonjour
      action:
    • service: mqtt.publish
      data:
      topic: hermes/tts/say
      payload: “{“text”:” bonjour mon cher maître, hé tous ceux qui vous accompagne ! “,“siteId”:”{{ trigger.payload_json[‘siteId’] }}"}"

have fun !
jrb