|
2 | 2 | layout: page
|
3 | 3 | title: "Snips.ai"
|
4 | 4 | description: "Enhance your Hass.io installation with a local voice assistant."
|
5 |
| -date: 2018-03-22 13:28 |
| 5 | +date: 2018-05-02 13:28 |
6 | 6 | sidebar: true
|
7 | 7 | comments: false
|
8 | 8 | sharing: true
|
9 | 9 | footer: true
|
10 | 10 | ---
|
11 | 11 |
|
12 |
| -[Snips.ai] is an AI-powered voice assistant that runs on the Raspberry Pi 3 and x86 platforms. It runs on-device and is Private by Design. |
| 12 | +[Snips.ai](https://snips.ai/) is an AI-powered voice assistant that runs on the Raspberry Pi 3 and x86 platforms. It runs on-device and is Private by Design. |
13 | 13 |
|
14 | 14 | The Snips add-on depends on the Mosquitto add on to bridge to Home Assistant, so make sure that is installed.
|
15 | 15 |
|
16 | 16 | HomeAssistant comes with certain Intents builtin to handle common tasks. A complete list of Intents can be found in this wiki [Hass Snips Bundle](https://github.com/tschmidty69/hass-snips-bundle-intents/wiki).
|
17 | 17 |
|
18 | 18 | The Snips addon by default comes with an assistant that allows you to turn on lights or switches, open covers, or add and list items to a shopping list if that component is enabled.
|
19 | 19 |
|
20 |
| -If using a USB microphone and speakers plugged into the raspberry pi output, Snips will work without any change to the configuration. Trying saying things like: |
| 20 | +If using a USB microphone and speakers plugged into the Raspberry Pi output, Snips will work without any change to the configuration. Trying saying things like: |
21 | 21 |
|
22 | 22 | ```
|
23 | 23 | Turn on kitchen light
|
24 | 24 | Open garage door
|
25 | 25 | What is on my shopping list
|
26 | 26 | ```
|
27 | 27 |
|
28 |
| -To get started creating your own configuration, follow [their tutorial](https://github.com/snipsco/snips-platform-documentation/wiki/2.-Create-an-assistant-using-an-existing-bundle) to create an assistant and download the training data. You can add the HomeAssistant bundle to your assistant to enable the built-in intents, and add or create your own intents to do more complex tasks. |
29 |
| - |
30 |
| -Now install and activate the [Samba] add-on so you can upload your training data. Connect to the "share" Samba share and copy your training data over. Name the file `assistant.zip`. |
31 |
| - |
32 |
| -Now it's time to start Snips for the first time. When the Snips add-on starts, it will output your audio devices. If you are using a USB mic and the raspberry pi output, you won't need to change anything: |
33 |
| - |
34 |
| -```text |
35 |
| -**** List of PLAYBACK Hardware Devices **** |
36 |
| -card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA] |
37 |
| - Subdevices: 8/8 |
38 |
| - Subdevice #0: subdevice #0 |
39 |
| - Subdevice #1: subdevice #1 |
40 |
| - Subdevice #2: subdevice #2 |
41 |
| - Subdevice #3: subdevice #3 |
42 |
| - Subdevice #4: subdevice #4 |
43 |
| - Subdevice #5: subdevice #5 |
44 |
| - Subdevice #6: subdevice #6 |
45 |
| - Subdevice #7: subdevice #7 |
46 |
| -card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI] |
47 |
| - Subdevices: 1/1 |
48 |
| - Subdevice #0: subdevice #0 |
49 |
| -``` |
50 |
| - |
51 |
| -You need to use this information to point the add-on at the right speakers and microphone. The information describes different cards and devices. On a Raspberry Pi 3, card 0 - device 0 is the built-in headset port, card 0 - device 1 is the HDMI port. In the example above, the USB microphone showed up as card 1 - device 0. |
| 28 | +To get started creating your own configuration, follow [their tutorial](https://snips.gitbook.io/documentation/console) to create an assistant and download the training data. You can also add the HomeAssistant Skill to your assistant to enable the built-in intents, and add or create your own intents to do more complex tasks. |
52 | 29 |
|
53 |
| -Find the microphone and speakers that you want to use and note down their device and card number. We will need that to configure the add-on options `mic` (microphone to use) and `speaker` (speaker to use). The format for these options is `<card #>,<device #>`. Change the configuration options and click save. |
| 30 | +Now install and activate the [Samba](/addons/samba/) add-on so you can upload your training data. Connect to the "share" Samba share and copy your assistant over. Name the file `assistant.zip` or whatever you have configured in the configuration options. |
54 | 31 |
|
55 |
| -Now start the add-on. |
| 32 | +Now it's time to start Snips for the first time. You can configure the microphone and sound card using the Add-on interface. Now start the add-on. |
56 | 33 |
|
57 |
| -### Add-On configuration |
| 34 | +### {% linkable_title Add-On configuration %} |
58 | 35 |
|
59 | 36 | ```json
|
60 | 37 | {
|
61 |
| - "mic": "1,0", |
62 |
| - "speaker": "1,0", |
63 |
| - "assistant": "assistant.zip", |
64 | 38 | "mqtt_bridge": {
|
65 | 39 | "active": true,
|
66 | 40 | "host": "172.17.0.1",
|
67 | 41 | "port": 1883,
|
68 | 42 | "user": "",
|
69 | 43 | "password": ""
|
70 | 44 | },
|
| 45 | + "assistant": "assistant.zip", |
| 46 | + "language": "en", |
| 47 | + "custom_tts": false, |
| 48 | + "tts_platform": "amazon_polly" |
71 | 49 | }
|
72 | 50 | ```
|
73 | 51 |
|
74 | 52 | Configuration variables:
|
75 | 53 |
|
76 |
| -- **mqtt_bridge** : Snips uses MQTT to communicate and defaults to their own broker. Use this config option to bridge their broker to your the Mosquitto add-on. |
77 |
| -- **mic**: This is the hardware address of your microphone. Look at the Snips output if you are using different hardware. |
| 54 | +- **mqtt_bridge**: Snips uses MQTT to communicate and defaults to their own broker. Use this config option to bridge their broker to your the Mosquitto add-on. |
| 55 | +- **assistant**: The name of your custom assistant in `/share`. If no assistant is found then a default assistant will be used. |
| 56 | +- **language**: Language. This is used to select the default custom assistant, Currently `en`, `de` and `fr` are supported. |
| 57 | +- **custom_tts**: Whether to use a TTS provider from Home Assistant for a variety of voices. |
| 58 | +- **tts_platform**: Which TTS platform to use. |
78 | 59 |
|
79 | 60 | ### {% linkable_title Home Assistant configuration %}
|
80 | 61 |
|
81 |
| -Use the Home Assistant [Snips.ai component][comp] to integrate the add-on into Home Assistant. |
| 62 | +A simple configuration just requires this. Consult [Snips.ai component](/components/snips/) for more options. |
82 | 63 |
|
83 | 64 | ```yaml
|
84 | 65 | snips:
|
85 | 66 | ```
|
86 | 67 |
|
87 |
| -[Snips.ai]: https://snips.ai/ |
| 68 | +### {% linkable_title Home Assistant configuration %} |
| 69 | +
|
| 70 | +There is an active [discord](https://discordapp.com/invite/3939Kqx) channel for further support. |
| 71 | +
|
| 72 | +### {% linkable_title Examples %} |
| 73 | +
|
| 74 | +So now you can turn lights on and off, let's check the weather. Log on to the [console](https://console.snips.ai/). If this is your first time, create a new assistant and add the Home Assistant skill, along with the Weather skill by snips. Download your assistant manually and copy it to the `/share` folder on your HassIO installation using the Samba addon. |
| 75 | + |
| 76 | +Next create a weather sensor, e.g., one for (Dark Sky)[/components/sensor.darksky/] and put the `api_key` in your `secrets.yaml` file. |
| 77 | + |
| 78 | +```yaml |
| 79 | +- platform: darksky |
| 80 | + name: "Dark Sky Weather" |
| 81 | + api_key: !secret dark_sky_key |
| 82 | + update_interval: |
| 83 | + minutes: 10 |
| 84 | + monitored_conditions: |
| 85 | + - summary |
| 86 | + - hourly_summary |
| 87 | + - temperature |
| 88 | + - temperature_max |
| 89 | + - temperature_min |
| 90 | +``` |
| 91 | +Next add this to your `configuration.yaml` file to reference a new `intent_script` component. This is a good practice to [split your configuration files](/docs/configuration/splitting_configuration/) up. |
| 92 | + |
| 93 | +```yaml |
| 94 | +intent_script: !include intent_script.yaml |
| 95 | +``` |
| 96 | + |
| 97 | +Finally, create this `intent_script.yaml` file in your configuration directory. |
| 98 | + |
| 99 | +{% raw %} |
| 100 | +```yaml |
| 101 | +searchWeatherForecast: |
| 102 | + speech: |
| 103 | + type: plain |
| 104 | + text: > |
| 105 | + The weather is currently |
| 106 | + {{ states('sensor.dark_sky_weather_temperature') | round(0) }} |
| 107 | + degrees outside and {{ states('sensor.dark_sky_weather_summary') }}. |
| 108 | + The high today will be |
| 109 | + {{ states('sensor.dark_sky_weather_daily_high_temperature') | round(0)}} |
| 110 | + and {{ states('sensor.dark_sky_weather_hourly_summary') }} |
| 111 | +``` |
| 112 | +{% endraw %} |
| 113 | + |
| 114 | +Now just restart HassIO and ask it what the weather is like. |
| 115 | + |
88 | 116 | [their tutorial]: https://github.com/snipsco/snips-platform-documentation/wiki/2.-Create-an-assistant-using-an-existing-bundle
|
89 |
| -[Samba]: /addons/samba/ |
90 |
| -[comp]: /components/snips/ |
| 117 | + |
0 commit comments