Intents for Home Assistant
This repository contains training data for Home Assistant's local voice control.
Repository layout:
parser
- Sentence template parser and intent recognizer
sentences/<language>
- YAML files for
<language>
with the name<domain>_<intent>.yaml
- File format
- YAML files for
responses/<language>
- YAML files for
<language>
with responses for intents - File format
- YAML files for
tests/<language>
- YAML files for
<language>
with test sentences and corresponding intents - File format
- YAML files for
Supported Languages
en
- Englishnl
- Dutch
Intents
See intents.yaml for available intent schemas.
Lists
Home Assistant will automatically generate the following lists during recognition:
{name}
- List of device or entity names
{area}
- List of area names
Development
Checkout the repository and get a development enviornment with script/setup
.
Before developing, always activate your virtual environment with source venv/bin/activate
.
Run tests
Validate the data is correctly formatted.
python3 -m script.intentfest validate
Run the tests. Leave --language
off to run all tests.
pytest tests --language nl
Testing sentences
You can try parsing sentences for a specific language with:
python3 -m script.intentfest parse --language en --sentence 'turn on the lights in the kitchen'
This will print a line of JSON for each --sentence
:
{
"text": "turn on the lights in the kitchen",
"match": true,
"intent": "HassTurnOn",
"slots": {
"area": "kitchen",
"domain": "light"
}
}
Add new language
python3 -m script.intentfest add_language <language>
Before you start on a new language, confirm that no one else is already working on one.