You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are a few ways that you can use Amazon Echo and Home Assistant together.
17
17
18
-
-[Turning devices on and off](#i-just-want-to-turn-devices-on-and-off-using-echo)
19
18
-[Build custom commands to use](#i-want-to-build-custom-commands-to-use-with-echo)
20
19
-[Create a new Flash Briefing source](#flash-briefing-skills)
21
-
22
-
No matter which method(s) you decide to use, please remember that Amazon Echo requires an active Internet connection to function. If your Internet is down or experiencing issues (or Amazon's infrastructure is having issues), none of these methods will work.
20
+
- Alternative: use the [Emulated Hue component][emulated-hue-component] to trick Alexa to thinking Home Assistant is a Philips Hue hub.
23
21
24
22
Amazon has released [Echosim], a website that simulates the Alexa service in your browser. That way it is easy to test your skills without having access to a physical Amazon Echo.
25
23
26
24
[Echosim]: https://echosim.io/
27
25
28
-
## {% linkable_title I just want to turn devices on and off using Echo %}
29
-
30
-
If you just want to be able to turn anything with a switch (like lights, switches, media players, etc) on and off, you should enable the [Emulated Hue][emulated-hue-component] component. It makes your Home Assistant appear as if it were a Phillips Hue bridge, which Echo works with natively.
Enabling the Emulated Hue component means you can turn things on and off by simply saying
35
-
36
-
> Alexa, turn the living room lights on.
37
-
38
-
or
39
-
40
-
> Alexa, set the living room lights to twenty percent.
41
-
42
-
instead of
43
-
44
-
> Alexa, tell Home Assistant to turn the living room lights on.
45
-
46
-
or
47
-
48
-
> Alexa, tell Home Assistant to set the living room lights to twenty percent.
49
-
50
-
In addition, you would need to build custom intents for each device and on/off combination using the below method, whereas everything just works without any extra work by using Emulated Hue.
51
-
52
-
Please note that you can use Emulated Hue and the built-in Alexa component side-by-side without issue if you wish.
53
-
54
26
## {% linkable_title I want to build custom commands to use with Echo %}
55
27
56
28
The built-in Alexa component allows you to integrate Home Assistant into Alexa/Amazon Echo. This component will allow you to query information and call services within Home Assistant by using your voice. Home Assistant offers no built-in sentences but offers a framework for you to define your own.
@@ -121,54 +93,7 @@ This means that we can now ask Alexa things like:
121
93
122
94
## {% linkable_title Configuring Home Assistant %}
123
95
124
-
Out of the box, the component will do nothing. You have to teach it about all intents you want it to answer to. The way it works is that the answer for each intent is based on [templates] that you define. Each template will have access to the existing states via the `states` variable but will also have access to all variables defined in the intent.
125
-
126
-
You can use [templates] for the values of `speech/text`, `card/title` and `card/content`.
127
-
128
-
Actions are using the [Home Assistant Script Syntax] and also have access to the variables from the intent.
Anne Therese is at {{ states("device_tracker.anne_therese") }}
147
-
and Paulus is at {{ states("device_tracker.paulus") }}
148
-
{% endif %}
149
-
150
-
LocateIntent:
151
-
action:
152
-
service: notify.notify
153
-
data_template:
154
-
message: The location of {{ User }} has been queried via Alexa.
155
-
speech:
156
-
type: plaintext
157
-
text: >
158
-
{%- for state in states.device_tracker -%}
159
-
{%- if state.name.lower() == User.lower() -%}
160
-
{{ state.name }} is at {{ state.state }}
161
-
{%- elif loop.last -%}
162
-
I am sorry, I do not know where {{ User }} is.
163
-
{%- endif -%}
164
-
{%- else -%}
165
-
Sorry, I don't have any trackers registered.
166
-
{%- endfor -%}
167
-
card:
168
-
type: simple
169
-
title: Sample title
170
-
content: Some more content{% endraw %}
171
-
```
96
+
When activated, the Alexa component will have Home Assistant's native intent support handle the incoming intents. If you want to run actions based on intents, use the [`intent_script`](/components/intent_script) component.
172
97
173
98
### {% linkable_title Working With Scenes %}
174
99
@@ -203,17 +128,18 @@ Add a sample utterance:
203
128
ActivateSceneIntent activate {Scene}
204
129
```
205
130
206
-
Then add the intent to your Alexa Section in your HA config file:
131
+
Then add the intent to your intent_script section in your HA config file:
207
132
208
133
```yaml
209
-
ActivateSceneIntent:
210
-
action:
211
-
service: scene.turn_on
212
-
data_template:
213
-
entity_id: scene.{% raw %}{{ Scene | replace(" ", "_") }}{% endraw %}
214
-
speech:
215
-
type: plaintext
216
-
text: OK
134
+
intent_script:
135
+
ActivateSceneIntent:
136
+
action:
137
+
service: scene.turn_on
138
+
data_template:
139
+
entity_id: scene.{% raw %}{{ Scene | replace(" ", "_") }}{% endraw %}
140
+
speech:
141
+
type: plain
142
+
text: OK
217
143
```
218
144
219
145
Here we are using [templates] to take the name we gave to Alexa e.g. `downstairs on` and replace the space with an underscore so it becomes `downstairs_on` as Home Assistant expects.
@@ -250,17 +176,18 @@ Add a sample utterance:
250
176
RunScriptIntent run {Script}
251
177
```
252
178
253
-
Then add the intent to your Alexa Section in your HA config file:
179
+
Then add the intent to your intent_script section in your HA config file:
Alexa will now respond with a random phrase each time. You can use the include for as many different intents as you like so you only need to create the list once.
308
235
309
-
<p class='note'>
310
-
As of April 2017, the random filter has been somewhat broken. You'll get a random response the first time this runs, but subsequent commands will reply with the same randomly-chosen phrase. On reboot, Home Assistant will pick a new random choice, but you're stuck with that choice till you reboot. To get around that, use the following code in alexa_confirm.yaml:
As of version [0.31][zero-three-one] Home Assistant supports the new [Alexa Flash Briefing Skills API][flash-briefing-api]. A Flash Briefing Skill adds a new Flash Briefing source that is generated by Home Assistant.
@@ -395,3 +293,4 @@ Please refer to the [Amazon documentation][flash-briefing-api-docs] for more inf
Copy file name to clipboardExpand all lines: source/_components/apiai.markdown
+38-65Lines changed: 38 additions & 65 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,35 +58,7 @@ Take a look to "Integrations", in the left menu, to configure third parties.
58
58
59
59
### {% linkable_title Configuring Home Assistant %}
60
60
61
-
Out of the box, the component will do nothing. You have to teach it about all intents you want it to answer to. The way it works is that the answer for each intent is based on [templates] that you define. Each template will have access to the existing states via the `states` variable but will also have access to all variables defined in the intent.
62
-
63
-
You can use [templates] for setting `speech`.
64
-
65
-
Actions are using the [Home Assistant Script Syntax] and also have access to the variables from the intent.
speech: We have {{ states.sensor.temperature }} degrees
77
-
async_action: False
78
-
action:
79
-
service: notify.notify
80
-
data_template:
81
-
message: Api.ai has send a request
82
-
{% endraw %}
83
-
```
84
-
85
-
Inside an intent we can define this variables:
86
-
-**speech** (*Optional*): Text or template to return to Api.ai
87
-
-**action** (*Optional*): Script definition
88
-
-**async_action** (*Optional*): If Home Assistant should execute the action asynchronously (returning response to Api.ai without waiting the action to finish). Should be set to `True` if Api.ai is returning the "Cannot connect to Home Assistant or it is taking to long" message, but then you will not be able to use values based on the result of the action. Defaults to `False`.
89
-
61
+
When activated, the Alexa component will have Home Assistant's native intent support handle the incoming intents. If you want to run actions based on intents, use the [`intent_script`](/components/intent_script) component.
description: "Instructions on how to setup scripts to run on intents."
5
+
date: 2016-02-10 17:11
6
+
sidebar: true
7
+
comments: false
8
+
sharing: true
9
+
footer: true
10
+
logo: home-assistant.png
11
+
ha_category: Intent
12
+
ha_release: 0.50
13
+
---
14
+
15
+
The intent_script component allows users to configure actions and responses to intents. Intents can be fired by any component that supports it. Examples are Alexa (Amazon Echo), API.ai (Google Assistant) and Snips.
16
+
17
+
```yaml
18
+
{% raw %}# Example configuration.yaml entry
19
+
intent_script:
20
+
GetTemperature: # Intent type
21
+
speech:
22
+
text: We have {{ states.sensor.temperature }} degrees
23
+
action:
24
+
service: notify.notify
25
+
data_template:
26
+
message: Hello from an intent!
27
+
{% endraw %}
28
+
```
29
+
30
+
Inside an intent we can define these variables:
31
+
-**speech** (*Optional*): Text or template to return
32
+
-**action** (*Optional*): [Script syntax]
33
+
-**async_action** (*Optional*): Set to True to have Home Assistant not wait for the script to finish before returning the intent response.
Copy file name to clipboardExpand all lines: source/_components/snips.markdown
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -100,7 +100,7 @@ mqtt:
100
100
```
101
101
### Triggering actions
102
102
103
-
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:
103
+
In Home Assistant, we trigger actions based on intents produced by Snips using the [`intent_script`](/components/intent_script) component. For instance, the following block handles `ActivateLightColors` intents (included in the Snips IoT intent bundle) to change light colors:
0 commit comments