Skip to content

Commit f467c7f

Browse files
authored
Update snips.markdown
1 parent a71cd0b commit f467c7f

File tree

1 file changed

+16
-59
lines changed

1 file changed

+16
-59
lines changed

source/_components/snips.markdown

Lines changed: 16 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
layout: page
33
title: "Snips"
44
description: "Instructions on how to integrate Snips within Home Assistant."
5-
date: 2017-06-22 12:00
5+
date: 2018-03-22 12:00
66
sidebar: true
77
comments: false
88
sharing: true
99
footer: true
1010
logo: snips.png
1111
ha_category: Voice
12-
ha_release: 0.48
12+
ha_release: 0.65
1313
---
1414

1515
The [Snips Voice Platform](https://www.snips.ai) allows users to add powerful voice assistants to their Raspberry Pi devices without compromising on privacy. It runs 100% on-device, and does not require an internet connection. It features Hotword Detection, Automatic Speech Recognition (ASR), Natural Language Understanding (NLU) and Dialog Management.
@@ -27,22 +27,15 @@ Snips takes voice or text as input and produces *intents* as output, which are e
2727

2828
### {% linkable_title Installation %}
2929

30-
The Snips platform can be installed via the Snips APT/Debian repository. If you prefer to install the platform using the Docker distribution, check out our [Docker Installation Guide](https://github.com/snipsco/snips-platform-documentation/wiki/6.--Miscellaneous#using-docker).
30+
All of the Snips installation documentation can be found at [
3131

32-
```bash
33-
$ sudo apt-get update
34-
$ sudo apt-get install -y dirmngr
35-
$ sudo bash -c 'echo "deb https://raspbian.snips.ai/$(lsb_release -cs) stable main" > /etc/apt/sources.list.d/snips.list'
36-
$ sudo apt-key adv --keyserver pgp.mit.edu --recv-keys D4F50CDCA10A2849
37-
$ sudo apt-get update
38-
$ sudo apt-get install -y snips-platform-voice
39-
```
32+
[Raspberry Pi](https://github.com/snipsco/snips-platform-documentation/wiki/1.-Setup-the-Snips-Voice-Platform#1-snips-platform-for-raspberry-pi-3-with-raspbian-stretch)
4033

41-
Note: if the keyserver pgp.mit.edu is down try to use another one in the 4th line , like pgp.surfnet.nl:
34+
Unfortunately, only Debian Jessie is supported at this time.
35+
[Debian/AMD64](https://github.com/snipsco/snips-platform-documentation/wiki/1.-Setup-the-Snips-Voice-Platform#2-snips-platform-installation-on-debianamd64)
4236

43-
```bash
44-
sudo apt-key adv --keyserver pgp.surfnet.nl --recv-keys D4F50CDCA10A2849
45-
```
37+
Docker supports both AMD64 and ARM architechtures
38+
[Docker](https://github.com/snipsco/snips-platform-documentation/wiki/6.--Miscellaneous#using-docker)
4639

4740
### {% linkable_title Creating an assistant %}
4841

@@ -52,31 +45,17 @@ sudo apt-key adv --keyserver pgp.surfnet.nl --recv-keys D4F50CDCA10A2849
5245

5346
Head over to the [Snips Console](https://console.snips.ai) to create your assistant. Launch the training and download by clicking on the "Download Assistant" button.
5447

55-
The next step is to get the assistant to work on your device. Unzip and copy the assistant folder that you downloaded from the web console to the path. Assuming your downloaded assistant folder is on your desktop, just run:
48+
The next step is to get the assistant to work on your device. Assuming your downloaded assistant folder is on your desktop (your assistant name will vary), just run:
5649

5750
```bash
58-
$ scp -r ~/Desktop/assistant pi@<raspi_hostname.local_or_IP>:/home/pi/.
51+
$ scp -r ~/Desktop/assistant.zip pi@<raspi_hostname.local_or_IP>:/home/pi/.
5952
```
6053

6154
Now ssh into your Raspberry Pi:
6255

6356
```bash
6457
$ ssh pi@<raspi_hostname.local_or_IP>
65-
```
66-
67-
By default, this command is `ssh pi@raspberrypi.local`, if you are using the default Raspberry Pi hostname.
68-
69-
Then, move the assistant to the right folder:
70-
71-
```bash
72-
(pi) $ sudo mv /home/pi/assistant /usr/share/snips/assistant
73-
```
74-
75-
Note: if you already have an assistant installed and wish to replace it, start by removing the previous one, and then move the new one in its place:
76-
77-
```bash
78-
(pi) $ sudo rm -r /usr/share/snips/assistant
79-
(pi) $ sudo mv /home/pi/assistant /usr/share/snips/assistant
58+
unzip -o -d /usr/share/snips /home/pi/assistant.zip
8059
```
8160

8261
### {% linkable_title Running Snips %}
@@ -86,7 +65,7 @@ Make sure that a microphone is plugged to the Raspberry Pi. If you are having tr
8665
Start the Snips Voice Platform by starting the `snips-*` services:
8766

8867
```bash
89-
$ sudo systemctl start "snips-*"
68+
$ sudo systemctl start 'snips-*'
9069
```
9170

9271
Snips is now ready to take voice commands from the microphone. To trigger the listening, simply say
@@ -95,7 +74,7 @@ Snips is now ready to take voice commands from the microphone. To trigger the li
9574
9675
followed by a command, e.g.
9776

98-
> Set the lights to green in the living room
77+
> Turn on the living room lights
9978
10079
As the Snips Platform parses this query into an intent, it will be published on MQTT, on the `hermes/intent/<intentName>` topic. The Snips Home Assistant component subscribes to this topic, and handles the intent according to the rules defined in `configuration.yaml`, as explained below.
10180

@@ -115,12 +94,12 @@ mqtt:
11594
port: MQTT_BROKER_PORT
11695
```
11796
118-
By default, Snips runs an MQTT broker on port 9898. So if we wish to use this broker, and if Snips and Home Assistant run on the same device, the entry will look as follows:
97+
By default, Snips runs a mosquitto broker on port 1883. So if we wish to use this broker, and if Snips and Home Assistant run on the same device, the entry will look as follows:
11998
12099
```yaml
121100
mqtt:
122101
broker: 127.0.0.1
123-
port: 9898
102+
port: 1883
124103
```
125104
126105
Alternatively, MQTT can be configured to bridge messages between servers if using a custom MQTT broker such as [mosquitto](https://mosquitto.org/).
@@ -134,38 +113,16 @@ In Home Assistant, we trigger actions based on intents produced by Snips using t
134113
snips:
135114
136115
intent_script:
137-
ActivateLightColor:
116+
TurnOn:
138117
action:
139118
- service: light.turn_on
140119
data_template:
141120
entity_id: light.{{ objectLocation | replace(" ","_") }}
142-
color_name: {{ objectColor }}
143121
```
144122
{% endraw %}
145123

146124
In the `data_template` block, we have access to special variables, corresponding to the slot names for the intent. In the present case, the `ActivateLightColor` has two slots, `objectLocation` and `objectColor`.
147125

148-
### {% linkable_title Special slots %}
149-
150-
In the above example, the slots are plain strings. However, when more complex types are used, such as dates or time ranges, they will be transformed to rich Python objects, for example:
151-
152-
{% raw %}
153-
```yaml
154-
SetTimer:
155-
speech:
156-
type: plain
157-
text: weather
158-
action:
159-
service: script.set_timer
160-
data_template:
161-
name: "{{ timer_name }}"
162-
duration: "{{ timer_duration }}"
163-
seconds: "{{ slots.timer_duration.value.seconds }}"
164-
minutes: "{{ slots.timer_duration.value.minutes }}"
165-
hours: "{{ slots.timer_duration.value.hours }}"
166-
```
167-
{% endraw %}
168-
169126
### Sending TTS Notifications
170127

171128
You can send TTS notifications to Snips using the snips.say and snips.say_action services. Say_action starts a session and waits for user response, "Would you like me to close the garage door?", "Yes, close the garage door".

0 commit comments

Comments
 (0)