Hey,
as shown in the Speech-to-Phrase documentation, it is possible to add custom sentences.
The shown example is a perfect fit for what I would like to achieve:
language: "en"
lists:
todo_item:
values:
- "apples" # make sure to use quotes!
- "bananas"
But this snippet is not working when it’s the only code inside config/custom_sentences/en/sentences.yaml
It shows the following error: Missing property “intents”
In my understading, this syntax only works when it’s added via the command shown in the documentation:
But in my case, I’m running speech-to-phrase inside home assistant and can’t simply execute this command.
I want to achieve, whats already said in the documentation:
This would allow you to say “add apples to my shopping list” if you have a todo entity in Home Assistant exposed with the name “shopping list”.
Home Assistant already has a file which contains exactly the intents I’d like to use.
And speech-to-phrase also already has the phrases to add items to lists.
How can I extend these phrases by items (like apples or bananas) in home assistant?
Update:
I have found the sentences.yaml that speech-to-phrase uses when installed as an HA addon: /share/speech-to-phrase/train/{your language}/sentences.yaml
Maybe that’s what HA configures as the /path/to/custom_sentences for speech-to-phrase?
When adding custom todo_item values they don’t get automatically recognized and “trained” by speech-to-phrase. But when restarting the speech-to-phrase addon, the sentences.yaml gets rewritten and the custom values are lost.
My current idea:
Somehow check the docker config of speech-to-phrase and check if the –custom-sentences-dir is already set to /share/speech-to-phrase/train/{your language}/sentences.yaml, or still free to use.
If it’s not set yet, set it to a new yaml file and that might be it