Skip to content

Commit 35e2ff8

Browse files
michaelfesterfabaff
authored andcommitted
Update snips.markdown (home-assistant#2975)
1 parent bbf3112 commit 35e2ff8

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

source/_components/snips.markdown

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,36 @@ followed by a command, e.g.
6969
7070
We should see the transcribed phrase in the logs, as well as a properly parsed intent. The intent is published on MQTT, on the `hermes/nlu/intentParsed` 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.
7171

72+
#### Optional: specifying an external MQTT broker
73+
74+
By default, Snips runs its own MQTT broker. But we can also tell Snips to use an external broker by specifying this when launching Snips. In this case, instead of running the `snips` command above (which assumes we are using the internal MQTT broker), we use the full launch command with explicitly specified parameters (replace `MQTT_BROKER_IP` and `MQTT_BROKER_PORT` with appropriate values):
75+
76+
```sh
77+
$ docker run -t --rm --name snips --log-driver none -v /home/pi/.asoundrc:/root/.asoundrc -v /opt/snips/config:/opt/snips/config --privileged -v /dev/snd:/dev/snd snipsdocker/platform --mqtt MQTT_BROKER_IP:MQTT_BROKER_PORT
78+
```
79+
80+
For more details on launch options, check the documentation on [Snips Platform Commands](https://github.com/snipsco/snips-platform-documentation/wiki/6.--Learn-more:-Platform-Commands#using-a-custom-mqtt-bus).
81+
7282
## Home Assistant configuration
7383

74-
By default, the Snips MQTT broker runs on port 9898. We should tell Home Assistant to use this as a broker, rather than its own, by adding the following section to `configuration.yaml`:
84+
### Specifying the MQTT broker
85+
86+
Messages between Snips and Home Assistant are passed via MQTT. We must tell Home Assistant which MQTT broker to use by adding the following entry to `configuration.yaml`:
87+
88+
```yaml
89+
mqtt:
90+
broker: MQTT_BROKER_IP
91+
port: MQTT_BROKER_PORT
92+
```
93+
94+
As explained above, Snips by default runs an MQTT broker on port 9898. So if we wish to use this broker, the entry will look as follows:
7595
7696
```yaml
7797
mqtt:
7898
broker: 127.0.0.1
7999
port: 9898
80100
```
101+
### Triggering actions
81102
82103
In Home Assistant, we trigger actions based on intents produced by Snips. This is done in `configuration.yaml`. For instance, the following block handles `ActivateLightColors` intents (included in the Snips IoT intent bundle) to change light colors:
83104

0 commit comments

Comments
 (0)