Rhsaspy 2.5 with Hassio built in intents

I’m just starting out exploring Rhasspy. I’ve setup Rhasspy 2.5 in a docker container on a Pi4 and a satellite docker container on a PI3. I’m trying to use Hassio’s built in intents just to turn lights on and off.

I think it’s setup right but there’s no change in the lights from Hassio with an intent named HassTurnOn. If I name the intent something Hassio doesn’t recognize or I assign a value that Hassio doesn’t like I get an error in Hassio’s log for intent.py stating that so I know the intent is making it to Hassio. I’ve also tried this with HassSetState and changing the brightness, again no error unless I specify a value that doesn’t make sense like brightness of 150.

I’m testing just typing in text on the Rhasspy server to eliminate as much as I can. I am not using a shared MQTT broker and Rhasspy is set to send intents to Hassio.

Any tips or things I can check?
Thanks!

Here’s the log from Rhasspy

[DEBUG:2020-05-02 16:46:03,536] rhasspyserver_hermes: Publishing 21 bytes(s) to rhasspy/handle/toggleOn
[DEBUG:2020-05-02 16:46:03,535] rhasspyserver_hermes: -> HandleToggleOn(site_id=‘default’)
[DEBUG:2020-05-02 16:46:03,532] rhasspyserver_hermes: Sent 657 char(s) to websocket
[DEBUG:2020-05-02 16:46:03,530] rhasspyserver_hermes: Sent 657 char(s) to websocket
[DEBUG:2020-05-02 16:46:03,528] rhasspyserver_hermes: Sent 657 char(s) to websocket
[DEBUG:2020-05-02 16:46:03,527] rhasspyserver_hermes: Sent 657 char(s) to websocket
[DEBUG:2020-05-02 16:46:03,516] rhasspyserver_hermes: Handling NluIntent (topic=hermes/intent/HassTurnOn, id=f04201d4-b6b4-4ad2-804f-4c2eefa6767f)
[DEBUG:2020-05-02 16:46:03,514] rhasspyserver_hermes: <- NluIntent(input=‘turn on the light.kitchen_lights’, intent=Intent(intent_name=‘HassTurnOn’, confidence_score=1.0), site_id=‘default’, id=‘215e884f-ca31-4ba0-ab14-7b9b06581416’, slots=[Slot(entity=‘Lights’, value={‘kind’: ‘Unknown’, ‘value’: ‘light.kitchen_lights’}, slot_name=‘name’, raw_value=‘kitchen lights’, confidence=1.0, range=SlotRange(start=12, end=32, raw_start=12, raw_end=26))], session_id=‘215e884f-ca31-4ba0-ab14-7b9b06581416’, custom_data=None, asr_tokens=[[AsrToken(value=‘turn’, confidence=1.0, range_start=0, range_end=4, time=None), AsrToken(value=‘on’, confidence=1.0, range_start=5, range_end=7, time=None), AsrToken(value=‘the’, confidence=1.0, range_start=8, range_end=11, time=None), AsrToken(value=‘light.kitchen_lights’, confidence=1.0, range_start=12, range_end=32, time=None)]], asr_confidence=None, raw_input=‘turn on the kitchen lights’, wakeword_id=None)
[DEBUG:2020-05-02 16:46:03,414] rhasspyserver_hermes: Publishing 201 bytes(s) to hermes/nlu/query
[DEBUG:2020-05-02 16:46:03,413] rhasspyserver_hermes: -> NluQuery(input=‘turn on the kitchen lights’, site_id=‘default’, id=‘215e884f-ca31-4ba0-ab14-7b9b06581416’, intent_filter=None, session_id=‘215e884f-ca31-4ba0-ab14-7b9b06581416’, wakeword_id=None)
[DEBUG:2020-05-02 16:46:03,409] rhasspyserver_hermes: Publishing 21 bytes(s) to rhasspy/handle/toggleOff
[DEBUG:2020-05-02 16:46:03,408] rhasspyserver_hermes: -> HandleToggleOff(site_id=‘default’)

In case somebody else runs across this with similar problems I ended up just using an intent script. I do not have audio responses working on a satellite for some reason but voice control does work.

For a really basic setup just to turn lights on and off here’s intent_scripts.yaml taken from this post

ChangeLightState:
speech:
type: plain
text: ‘OK, the light is now {{ state }}.’
action:
- service_template: ‘light.turn_{{ state }}’
data_template:
entity_id: ‘{{ light }}’

Sentences in the Rhasspy web interface

[ChangeLightState]
state = (on | off) {state}
light = ($Lights) {light}
turn [the]
turn [the]

And slots also in the Rhasspy web interface

(kitchen lights):light.kitchen_lights
(living room lights):light.living_room
(dining room lights):light.dining_room

Hi,
I am having exactly the same experience as yourself. I have just (after many days) managed to get the Rhasspy sentences automated to pull entities out of HASSIO, and it is using the HASSIO built in intents (I hope and think).
You seem to be a little better off than me, as you seem to have the entity id properly formed in your response from Rhasspy (light.kitchen_lights), whereas my response lacks what I would have thought was this basic need (for me light.dining) but liberal apearance of the friendly name “Dining lights” is present.
I don’t see any indication that HASSIO has received the message and tried to process it as a “built in” intent. I have though found the Rhasspy intent in MQTT:

If you or anyone has managed to get further then please let me know. Otherwise maybe I’ll have to resort to your workaround, although I don’t as yet understand the ChangeLightState you have suggested… where do the “state” and “light” values come from? and if “state” is the current state how does light.turn_{{ state }} alter anything?

Anyway my MQTT entries are below as mentioned, and if someone notices that these are wrong I’d appreciate some pointers! The ‘few days effort’ needed in my case to achieve this next baby step are under way! Thanks.

Message 13 received on hermes/intent/HassTurnOn at 15:06:

{
“input”: “turn on the Dining lights”,
“intent”: {
“intentName”: “HassTurnOn”,
“confidenceScore”: 1
},
“siteId”: “default”,
“id”: “724807d3-c27d-456a-abc7-b3ef4160dde7”,
“slots”: [
{
“entity”: “hass/entities”,
“value”: {
“kind”: “Unknown”,
“value”: “Dining lights”
},
“slotName”: “name”,
“rawValue”: “Dining lights”,
“confidence”: 1,
“range”: {
“start”: 12,
“end”: 25,
“rawStart”: 12,
“rawEnd”: 25
}
}
],
“sessionId”: “724807d3-c27d-456a-abc7-b3ef4160dde7”,
“customData”: null,
“asrTokens”: [
[
{
“value”: “turn”,
“confidence”: 1,
“rangeStart”: 0,
“rangeEnd”: 4,
“time”: null
},
{
“value”: “on”,
“confidence”: 1,
“rangeStart”: 5,
“rangeEnd”: 7,
“time”: null
},
{
“value”: “the”,
“confidence”: 1,
“rangeStart”: 8,
“rangeEnd”: 11,
“time”: null
},
{
“value”: “Dining”,
“confidence”: 1,
“rangeStart”: 12,
“rangeEnd”: 18,
“time”: null
},
{
“value”: “lights”,
“confidence”: 1,
“rangeStart”: 19,
“rangeEnd”: 25,
“time”: null
}
]
],
“asrConfidence”: null,
“rawInput”: “Turn on the Dining lights”,
“wakewordId”: null,
“lang”: null
}

QoS: 0 - Retain: false
Message 12 received on hermes/nlu/intentParsed at 15:06:

{
“input”: “turn on the Dining lights”,
“intent”: {
“intentName”: “HassTurnOn”,
“confidenceScore”: 1
},
“siteId”: “default”,
“id”: “724807d3-c27d-456a-abc7-b3ef4160dde7”,
“slots”: [
{
“entity”: “hass/entities”,
“value”: {
“kind”: “Unknown”,
“value”: “Dining lights”
},
“slotName”: “name”,
“rawValue”: “Dining lights”,
“confidence”: 1,
“range”: {
“start”: 12,
“end”: 25,
“rawStart”: 12,
“rawEnd”: 25
}
}
],
“sessionId”: “724807d3-c27d-456a-abc7-b3ef4160dde7”
}

QoS: 0 - Retain: false
Message 11 received on hermes/nlu/query at 15:06:

{
“input”: “Turn on the Dining lights”,
“siteId”: “default”,
“id”: “724807d3-c27d-456a-abc7-b3ef4160dde7”,
“intentFilter”: null,
“sessionId”: “724807d3-c27d-456a-abc7-b3ef4160dde7”,
“wakewordId”: null,
“lang”: null
}

QoS: 0 - Retain: false
Message 10 received on rhasspy/handle/toggleOff at 15:06:

{
“siteId”: “default”
}

QoS: 0 - Retain: false

Till now I use Rhasspy with nodered, but I’d like to try hassio.
Hassio could be used on three methods of handling:

  1. intents
  2. events
  3. mqtt (snips modus)

Is one of this the “BEST” way? What are the benefits and disadvantages?

I tried mqtt and could handle the slots as described above ( {{slotName}} ). But I would like to use also the siteID inside the intent handling. (If no room is called, the intent should use the sitIeD instead of).
Which information comes from rhasspy and how can I use them.

I hope you can help

Thanks
Kay Koch

I use events for 1 big reason, you can use them in automations.
When you use intents, you have to restart HA everytime you want to change it.
It might not me that important when you are have finished all your intents and have written them down or whatever.
Whenever you come up with a new idea, just create sentences and build an automation for the event. Reload the automations and your done.