Update snips.markdown (#5292)

* Update snips.markdown

Updated to reference latest add on.

* Update snips.markdown

* Fix escaping
This commit is contained in:
Tod Schmidt 2018-05-04 03:43:51 -04:00 committed by Fabian Affolter
parent 49c697004a
commit cb8cdf3452

View File

@ -2,7 +2,7 @@
layout: page
title: "Snips.ai"
description: "Enhance your Hass.io installation with a local voice assistant."
date: 2018-03-22 13:28
date: 2018-05-02 13:28
sidebar: true
comments: false
sharing: true
@ -25,42 +25,17 @@ Open garage door
What is on my shopping list
```
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.
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.
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`.
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:
```text
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0
```
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.
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.
Now install and activate the [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.
Now it's time to start Snips for the first time. You can configure the microphone and sound card using the addon gui.
Now start the add-on.
### Add-On configuration
```json
{
"mic": "1,0",
"speaker": "1,0",
"assistant": "assistant.zip",
"mqtt_bridge": {
"active": true,
"host": "172.17.0.1",
@ -68,23 +43,82 @@ Now start the add-on.
"user": "",
"password": ""
},
"assistant": "assistant.zip",
"language": "en",
"custom_tts": false,
"tts_platform": "amazon_polly"
}
```
Configuration variables:
- **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.
- **mic**: This is the hardware address of your microphone. Look at the Snips output if you are using different hardware.
- **assistant** : The name of your custom assistant in /share. If no assistant is found a default assistant will be used.
- **language** : Language. This is used to select the default custom assistant, Currently en, de, and fr are supported.
- **custom_tts** : Whether to use a TTS provider from Home Assistant for a variety of voices
- **tts_platform** : Which tts platform to use.
### {% linkable_title Home Assistant configuration %}
Use the Home Assistant [Snips.ai component][comp] to integrate the add-on into Home Assistant.
A simple configuration just requires this. Consult [Snips.ai component][comp] for more options
```yaml
snips:
```
### {% linkable_title Home Assistant configuration %}
There is an active [discord](https://discordapp.com/invite/3939Kqx) channel for further support.
### Examples
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.
Next create a weather sensor, I happen to use (Dark Sky)[/components/sensor.darksky/] and have my api_key in my secrets file.
```yaml
- platform: darksky
name: "Dark Sky Weather"
api_key: !secret dark_sky_key
update_interval:
minutes: 10
monitored_conditions:
- summary
- hourly_summary
- temperature
- temperature_max
- temperature_min
```
Next add this to your configuration.yaml to reference a new intent_script component.
This is a good practice to split your config files up.
```yaml
intent_script: !include intent_script.yaml
```
Finally, create this intent_script.yaml file in your config directory
{% raw %}
```yaml
searchWeatherForecast:
speech:
type: plain
text: >
The weather is currently
{{ states('sensor.dark_sky_weather_temperature') | round(0) }}
degrees outside and {{ states('sensor.dark_sky_weather_summary') }}.
The high today will be
{{ states('sensor.dark_sky_weather_daily_high_temperature') | round(0)}}
and {{ states('sensor.dark_sky_weather_hourly_summary') }}
```
{% endraw %}
Now just restart HassIO and ask it what the weather is like!
[Snips.ai]: https://snips.ai/
[their tutorial]: https://github.com/snipsco/snips-platform-documentation/wiki/2.-Create-an-assistant-using-an-existing-bundle
[Samba]: /addons/samba/
[comp]: /components/snips/