Get pre-extracted slots in MQTT packages?

Hi everybody,

so I have gotten Rhasspy functional at last.

I have created a couple of sentences and slots and voice recognition is actually working quite accurately. In my home automation software I’d like to accept commands via MQTT and act on them. For that it would be a lot easier if Rhasspy could already divide the recognized text into different fractions instead of analyzing the whole command myself. I was used to Snips doing it that way.

Let’s use a simplified example:

Sentences (shortened):

set kitchenlight to ($colorName)

Slots (shortened):
"colorName": ["red","blue"]

Now I would expect the MQTT package to contain an array “slots” with the name “colorName” and the value “red”. Slots is there, but it’s empty:

MQTT package:
{"sessionId": "", "siteId": "default", "input": "set kitchenlight to red", "intent": {"intentName": "ChangeLightState", "confidenceScore": 1.0}, "slots": [], "asrTokens": [], "asrConfidence": 1}

I’d think I have sufficiently studied the documentation for this. So am I doing anything wrong or is this simply the current state of development?

You did no define a slot correctly.
If you use set kitchenlight to ($colorName){colorName} it will work as you expect it.
The $colorName just refers to the slot list and you need to add a tag {} in yor sentence for it to get extracted. For more info look in the documentation

https://rhasspy.readthedocs.io/en/latest/training/#tags

You are very right! That did the trick and filled the MQTT message with additional information!

Thanks a lot!