synesthesiam / hassio-addons

My Hass.IO add-ons
43 stars 18 forks source link

Trying to call slots within slots returns AssertionError: missing slot $slot #28

Open HeofHIShirts opened 3 years ago

HeofHIShirts commented 3 years ago

The built-in shopping list integration for Home Assistant only accepts a string to put on the shopping list. What I would like to do is to be able to get that string as detailed as possible by adding words for numbers and packages or containers as well as the items themselves slots list of my shopping list items. I'm using the Rhasspy example sentence of

add ($shoppinglistitems){item} to my shopping list

to call the shopping list integration and add the item to it.

If I spell out the words and use the parentheses and square brackets on each line of the shoppinglistitems slots file, the sentence works correctly. Rather than write out all the numbers and containers possible, though, I would like to have the numbers and containers in their own slots files and just call them in like any other sentence that uses a slot. Trying to do that, though, results in a Rhasspy error on training that says it can't find the additional slots file, even though the slots file already exists and it in the same directory space as the shopping list items slots file.

So, [ ( one | two ) ] [ bunches of ] bananas

in the shoppinglistitems slots file works fine with the built in shopping list integeration, but

[ ($numberwords){numberwords} ] [ bunches of ] bananas

returns

AssertionError: missing slot $numberwords

when it's inside a slots file, even though the numbers slots file already exists and should be findable and usable.

I may be trying to be too clever by half, or trying to do something that can't be done, but the documentation says that slots are sentence templates in their own right, and that makes it seem like slots should be able to call slots, so long as the slots exist.

Help?