Site updated at 2016-06-18 19:15:24 UTC
This commit is contained in:
parent
cc17cda614
commit
3942a1269a
23 changed files with 178 additions and 25 deletions
2
atom.xml
2
atom.xml
|
@ -4,7 +4,7 @@
|
||||||
<title><![CDATA[Home Assistant]]></title>
|
<title><![CDATA[Home Assistant]]></title>
|
||||||
<link href="https://home-assistant.io/atom.xml" rel="self"/>
|
<link href="https://home-assistant.io/atom.xml" rel="self"/>
|
||||||
<link href="https://home-assistant.io/"/>
|
<link href="https://home-assistant.io/"/>
|
||||||
<updated>2016-06-18T18:50:09+00:00</updated>
|
<updated>2016-06-18T19:14:49+00:00</updated>
|
||||||
<id>https://home-assistant.io/</id>
|
<id>https://home-assistant.io/</id>
|
||||||
<author>
|
<author>
|
||||||
<name><![CDATA[Paulus Schoutsen]]></name>
|
<name><![CDATA[Paulus Schoutsen]]></name>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<title><![CDATA[Category: Community | Home Assistant]]></title>
|
<title><![CDATA[Category: Community | Home Assistant]]></title>
|
||||||
<link href="https://home-assistant.io/blog/categories/community/atom.xml" rel="self"/>
|
<link href="https://home-assistant.io/blog/categories/community/atom.xml" rel="self"/>
|
||||||
<link href="https://home-assistant.io/"/>
|
<link href="https://home-assistant.io/"/>
|
||||||
<updated>2016-06-18T18:50:09+00:00</updated>
|
<updated>2016-06-18T19:14:49+00:00</updated>
|
||||||
<id>https://home-assistant.io/</id>
|
<id>https://home-assistant.io/</id>
|
||||||
<author>
|
<author>
|
||||||
<name><![CDATA[Paulus Schoutsen]]></name>
|
<name><![CDATA[Paulus Schoutsen]]></name>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<title><![CDATA[Category: Device-Tracking | Home Assistant]]></title>
|
<title><![CDATA[Category: Device-Tracking | Home Assistant]]></title>
|
||||||
<link href="https://home-assistant.io/blog/categories/device-tracking/atom.xml" rel="self"/>
|
<link href="https://home-assistant.io/blog/categories/device-tracking/atom.xml" rel="self"/>
|
||||||
<link href="https://home-assistant.io/"/>
|
<link href="https://home-assistant.io/"/>
|
||||||
<updated>2016-06-18T18:50:09+00:00</updated>
|
<updated>2016-06-18T19:14:49+00:00</updated>
|
||||||
<id>https://home-assistant.io/</id>
|
<id>https://home-assistant.io/</id>
|
||||||
<author>
|
<author>
|
||||||
<name><![CDATA[Paulus Schoutsen]]></name>
|
<name><![CDATA[Paulus Schoutsen]]></name>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<title><![CDATA[Category: ESP8266 | Home Assistant]]></title>
|
<title><![CDATA[Category: ESP8266 | Home Assistant]]></title>
|
||||||
<link href="https://home-assistant.io/blog/categories/esp8266/atom.xml" rel="self"/>
|
<link href="https://home-assistant.io/blog/categories/esp8266/atom.xml" rel="self"/>
|
||||||
<link href="https://home-assistant.io/"/>
|
<link href="https://home-assistant.io/"/>
|
||||||
<updated>2016-06-18T18:50:09+00:00</updated>
|
<updated>2016-06-18T19:14:49+00:00</updated>
|
||||||
<id>https://home-assistant.io/</id>
|
<id>https://home-assistant.io/</id>
|
||||||
<author>
|
<author>
|
||||||
<name><![CDATA[Paulus Schoutsen]]></name>
|
<name><![CDATA[Paulus Schoutsen]]></name>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<title><![CDATA[Category: How-To | Home Assistant]]></title>
|
<title><![CDATA[Category: How-To | Home Assistant]]></title>
|
||||||
<link href="https://home-assistant.io/blog/categories/how-to/atom.xml" rel="self"/>
|
<link href="https://home-assistant.io/blog/categories/how-to/atom.xml" rel="self"/>
|
||||||
<link href="https://home-assistant.io/"/>
|
<link href="https://home-assistant.io/"/>
|
||||||
<updated>2016-06-18T18:50:09+00:00</updated>
|
<updated>2016-06-18T19:14:49+00:00</updated>
|
||||||
<id>https://home-assistant.io/</id>
|
<id>https://home-assistant.io/</id>
|
||||||
<author>
|
<author>
|
||||||
<name><![CDATA[Paulus Schoutsen]]></name>
|
<name><![CDATA[Paulus Schoutsen]]></name>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<title><![CDATA[Category: iBeacons | Home Assistant]]></title>
|
<title><![CDATA[Category: iBeacons | Home Assistant]]></title>
|
||||||
<link href="https://home-assistant.io/blog/categories/ibeacons/atom.xml" rel="self"/>
|
<link href="https://home-assistant.io/blog/categories/ibeacons/atom.xml" rel="self"/>
|
||||||
<link href="https://home-assistant.io/"/>
|
<link href="https://home-assistant.io/"/>
|
||||||
<updated>2016-06-18T18:50:09+00:00</updated>
|
<updated>2016-06-18T19:14:49+00:00</updated>
|
||||||
<id>https://home-assistant.io/</id>
|
<id>https://home-assistant.io/</id>
|
||||||
<author>
|
<author>
|
||||||
<name><![CDATA[Paulus Schoutsen]]></name>
|
<name><![CDATA[Paulus Schoutsen]]></name>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<title><![CDATA[Category: Internet-of-Things | Home Assistant]]></title>
|
<title><![CDATA[Category: Internet-of-Things | Home Assistant]]></title>
|
||||||
<link href="https://home-assistant.io/blog/categories/internet-of-things/atom.xml" rel="self"/>
|
<link href="https://home-assistant.io/blog/categories/internet-of-things/atom.xml" rel="self"/>
|
||||||
<link href="https://home-assistant.io/"/>
|
<link href="https://home-assistant.io/"/>
|
||||||
<updated>2016-06-18T18:50:09+00:00</updated>
|
<updated>2016-06-18T19:14:49+00:00</updated>
|
||||||
<id>https://home-assistant.io/</id>
|
<id>https://home-assistant.io/</id>
|
||||||
<author>
|
<author>
|
||||||
<name><![CDATA[Paulus Schoutsen]]></name>
|
<name><![CDATA[Paulus Schoutsen]]></name>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<title><![CDATA[Category: MQTT | Home Assistant]]></title>
|
<title><![CDATA[Category: MQTT | Home Assistant]]></title>
|
||||||
<link href="https://home-assistant.io/blog/categories/mqtt/atom.xml" rel="self"/>
|
<link href="https://home-assistant.io/blog/categories/mqtt/atom.xml" rel="self"/>
|
||||||
<link href="https://home-assistant.io/"/>
|
<link href="https://home-assistant.io/"/>
|
||||||
<updated>2016-06-18T18:50:09+00:00</updated>
|
<updated>2016-06-18T19:14:49+00:00</updated>
|
||||||
<id>https://home-assistant.io/</id>
|
<id>https://home-assistant.io/</id>
|
||||||
<author>
|
<author>
|
||||||
<name><![CDATA[Paulus Schoutsen]]></name>
|
<name><![CDATA[Paulus Schoutsen]]></name>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<title><![CDATA[Category: Organisation | Home Assistant]]></title>
|
<title><![CDATA[Category: Organisation | Home Assistant]]></title>
|
||||||
<link href="https://home-assistant.io/blog/categories/organisation/atom.xml" rel="self"/>
|
<link href="https://home-assistant.io/blog/categories/organisation/atom.xml" rel="self"/>
|
||||||
<link href="https://home-assistant.io/"/>
|
<link href="https://home-assistant.io/"/>
|
||||||
<updated>2016-06-18T18:50:09+00:00</updated>
|
<updated>2016-06-18T19:14:49+00:00</updated>
|
||||||
<id>https://home-assistant.io/</id>
|
<id>https://home-assistant.io/</id>
|
||||||
<author>
|
<author>
|
||||||
<name><![CDATA[Paulus Schoutsen]]></name>
|
<name><![CDATA[Paulus Schoutsen]]></name>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<title><![CDATA[Category: OwnTracks | Home Assistant]]></title>
|
<title><![CDATA[Category: OwnTracks | Home Assistant]]></title>
|
||||||
<link href="https://home-assistant.io/blog/categories/owntracks/atom.xml" rel="self"/>
|
<link href="https://home-assistant.io/blog/categories/owntracks/atom.xml" rel="self"/>
|
||||||
<link href="https://home-assistant.io/"/>
|
<link href="https://home-assistant.io/"/>
|
||||||
<updated>2016-06-18T18:50:09+00:00</updated>
|
<updated>2016-06-18T19:14:49+00:00</updated>
|
||||||
<id>https://home-assistant.io/</id>
|
<id>https://home-assistant.io/</id>
|
||||||
<author>
|
<author>
|
||||||
<name><![CDATA[Paulus Schoutsen]]></name>
|
<name><![CDATA[Paulus Schoutsen]]></name>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<title><![CDATA[Category: Presence-Detection | Home Assistant]]></title>
|
<title><![CDATA[Category: Presence-Detection | Home Assistant]]></title>
|
||||||
<link href="https://home-assistant.io/blog/categories/presence-detection/atom.xml" rel="self"/>
|
<link href="https://home-assistant.io/blog/categories/presence-detection/atom.xml" rel="self"/>
|
||||||
<link href="https://home-assistant.io/"/>
|
<link href="https://home-assistant.io/"/>
|
||||||
<updated>2016-06-18T18:50:09+00:00</updated>
|
<updated>2016-06-18T19:14:49+00:00</updated>
|
||||||
<id>https://home-assistant.io/</id>
|
<id>https://home-assistant.io/</id>
|
||||||
<author>
|
<author>
|
||||||
<name><![CDATA[Paulus Schoutsen]]></name>
|
<name><![CDATA[Paulus Schoutsen]]></name>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<title><![CDATA[Category: Public-Service-Announcement | Home Assistant]]></title>
|
<title><![CDATA[Category: Public-Service-Announcement | Home Assistant]]></title>
|
||||||
<link href="https://home-assistant.io/blog/categories/public-service-announcement/atom.xml" rel="self"/>
|
<link href="https://home-assistant.io/blog/categories/public-service-announcement/atom.xml" rel="self"/>
|
||||||
<link href="https://home-assistant.io/"/>
|
<link href="https://home-assistant.io/"/>
|
||||||
<updated>2016-06-18T18:50:09+00:00</updated>
|
<updated>2016-06-18T19:14:49+00:00</updated>
|
||||||
<id>https://home-assistant.io/</id>
|
<id>https://home-assistant.io/</id>
|
||||||
<author>
|
<author>
|
||||||
<name><![CDATA[Paulus Schoutsen]]></name>
|
<name><![CDATA[Paulus Schoutsen]]></name>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<title><![CDATA[Category: Release-Notes | Home Assistant]]></title>
|
<title><![CDATA[Category: Release-Notes | Home Assistant]]></title>
|
||||||
<link href="https://home-assistant.io/blog/categories/release-notes/atom.xml" rel="self"/>
|
<link href="https://home-assistant.io/blog/categories/release-notes/atom.xml" rel="self"/>
|
||||||
<link href="https://home-assistant.io/"/>
|
<link href="https://home-assistant.io/"/>
|
||||||
<updated>2016-06-18T18:50:09+00:00</updated>
|
<updated>2016-06-18T19:14:49+00:00</updated>
|
||||||
<id>https://home-assistant.io/</id>
|
<id>https://home-assistant.io/</id>
|
||||||
<author>
|
<author>
|
||||||
<name><![CDATA[Paulus Schoutsen]]></name>
|
<name><![CDATA[Paulus Schoutsen]]></name>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<title><![CDATA[Category: Survey | Home Assistant]]></title>
|
<title><![CDATA[Category: Survey | Home Assistant]]></title>
|
||||||
<link href="https://home-assistant.io/blog/categories/survey/atom.xml" rel="self"/>
|
<link href="https://home-assistant.io/blog/categories/survey/atom.xml" rel="self"/>
|
||||||
<link href="https://home-assistant.io/"/>
|
<link href="https://home-assistant.io/"/>
|
||||||
<updated>2016-06-18T18:50:09+00:00</updated>
|
<updated>2016-06-18T19:14:49+00:00</updated>
|
||||||
<id>https://home-assistant.io/</id>
|
<id>https://home-assistant.io/</id>
|
||||||
<author>
|
<author>
|
||||||
<name><![CDATA[Paulus Schoutsen]]></name>
|
<name><![CDATA[Paulus Schoutsen]]></name>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<title><![CDATA[Category: Talks | Home Assistant]]></title>
|
<title><![CDATA[Category: Talks | Home Assistant]]></title>
|
||||||
<link href="https://home-assistant.io/blog/categories/talks/atom.xml" rel="self"/>
|
<link href="https://home-assistant.io/blog/categories/talks/atom.xml" rel="self"/>
|
||||||
<link href="https://home-assistant.io/"/>
|
<link href="https://home-assistant.io/"/>
|
||||||
<updated>2016-06-18T18:50:09+00:00</updated>
|
<updated>2016-06-18T19:14:49+00:00</updated>
|
||||||
<id>https://home-assistant.io/</id>
|
<id>https://home-assistant.io/</id>
|
||||||
<author>
|
<author>
|
||||||
<name><![CDATA[Paulus Schoutsen]]></name>
|
<name><![CDATA[Paulus Schoutsen]]></name>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<title><![CDATA[Category: Technology | Home Assistant]]></title>
|
<title><![CDATA[Category: Technology | Home Assistant]]></title>
|
||||||
<link href="https://home-assistant.io/blog/categories/technology/atom.xml" rel="self"/>
|
<link href="https://home-assistant.io/blog/categories/technology/atom.xml" rel="self"/>
|
||||||
<link href="https://home-assistant.io/"/>
|
<link href="https://home-assistant.io/"/>
|
||||||
<updated>2016-06-18T18:50:09+00:00</updated>
|
<updated>2016-06-18T19:14:49+00:00</updated>
|
||||||
<id>https://home-assistant.io/</id>
|
<id>https://home-assistant.io/</id>
|
||||||
<author>
|
<author>
|
||||||
<name><![CDATA[Paulus Schoutsen]]></name>
|
<name><![CDATA[Paulus Schoutsen]]></name>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<title><![CDATA[Category: User-Stories | Home Assistant]]></title>
|
<title><![CDATA[Category: User-Stories | Home Assistant]]></title>
|
||||||
<link href="https://home-assistant.io/blog/categories/user-stories/atom.xml" rel="self"/>
|
<link href="https://home-assistant.io/blog/categories/user-stories/atom.xml" rel="self"/>
|
||||||
<link href="https://home-assistant.io/"/>
|
<link href="https://home-assistant.io/"/>
|
||||||
<updated>2016-06-18T18:50:09+00:00</updated>
|
<updated>2016-06-18T19:14:49+00:00</updated>
|
||||||
<id>https://home-assistant.io/</id>
|
<id>https://home-assistant.io/</id>
|
||||||
<author>
|
<author>
|
||||||
<name><![CDATA[Paulus Schoutsen]]></name>
|
<name><![CDATA[Paulus Schoutsen]]></name>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<title><![CDATA[Category: Video | Home Assistant]]></title>
|
<title><![CDATA[Category: Video | Home Assistant]]></title>
|
||||||
<link href="https://home-assistant.io/blog/categories/video/atom.xml" rel="self"/>
|
<link href="https://home-assistant.io/blog/categories/video/atom.xml" rel="self"/>
|
||||||
<link href="https://home-assistant.io/"/>
|
<link href="https://home-assistant.io/"/>
|
||||||
<updated>2016-06-18T18:50:09+00:00</updated>
|
<updated>2016-06-18T19:14:49+00:00</updated>
|
||||||
<id>https://home-assistant.io/</id>
|
<id>https://home-assistant.io/</id>
|
||||||
<author>
|
<author>
|
||||||
<name><![CDATA[Paulus Schoutsen]]></name>
|
<name><![CDATA[Paulus Schoutsen]]></name>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<title><![CDATA[Category: Website | Home Assistant]]></title>
|
<title><![CDATA[Category: Website | Home Assistant]]></title>
|
||||||
<link href="https://home-assistant.io/blog/categories/website/atom.xml" rel="self"/>
|
<link href="https://home-assistant.io/blog/categories/website/atom.xml" rel="self"/>
|
||||||
<link href="https://home-assistant.io/"/>
|
<link href="https://home-assistant.io/"/>
|
||||||
<updated>2016-06-18T18:50:09+00:00</updated>
|
<updated>2016-06-18T19:14:49+00:00</updated>
|
||||||
<id>https://home-assistant.io/</id>
|
<id>https://home-assistant.io/</id>
|
||||||
<author>
|
<author>
|
||||||
<name><![CDATA[Paulus Schoutsen]]></name>
|
<name><![CDATA[Paulus Schoutsen]]></name>
|
||||||
|
|
|
@ -253,6 +253,159 @@ WhereAreWeIntent where we are
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<h3><a class="title-link" name="working-with-scenes" href="#working-with-scenes"></a> Working With Scenes</h3>
|
||||||
|
|
||||||
|
<p>One of the more useful applications of Alexa integrations is to call scenes directly. This is easily achieved with some simple setup on the Home Assistant side and by letting Alexa know which scenes you want to run.</p>
|
||||||
|
|
||||||
|
<p>First we will configure Alexa. In the Amazon Interaction module add this to the intent schema:</p>
|
||||||
|
|
||||||
|
<div class="highlighter-coderay"><div class="CodeRay">
|
||||||
|
<div class="code"><pre>{
|
||||||
|
<span class="key"><span class="delimiter">"</span><span class="content">intent</span><span class="delimiter">"</span></span>: <span class="string"><span class="delimiter">"</span><span class="content">ActivateSceneIntent</span><span class="delimiter">"</span></span>,
|
||||||
|
<span class="key"><span class="delimiter">"</span><span class="content">slots</span><span class="delimiter">"</span></span>:
|
||||||
|
[
|
||||||
|
{
|
||||||
|
<span class="key"><span class="delimiter">"</span><span class="content">name</span><span class="delimiter">"</span></span> : <span class="string"><span class="delimiter">"</span><span class="content">Scene</span><span class="delimiter">"</span></span>,
|
||||||
|
<span class="key"><span class="delimiter">"</span><span class="content">type</span><span class="delimiter">"</span></span> : <span class="string"><span class="delimiter">"</span><span class="content">Scenes</span><span class="delimiter">"</span></span>
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
</pre></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p>Then create a custom slot type called <code>Scenes</code> listing every scene you want to control:</p>
|
||||||
|
|
||||||
|
<p class="img">
|
||||||
|
<img src="/images/components/alexa/scene_slot.png" />
|
||||||
|
Custom slot type for scene support.
|
||||||
|
</p>
|
||||||
|
<p>The names must exactly match the scene names (minus underscores - amazon discards them anyway and we later map them back in with the template).</p>
|
||||||
|
|
||||||
|
<p>Add a sample utterance:</p>
|
||||||
|
|
||||||
|
<div class="highlighter-coderay"><div class="CodeRay">
|
||||||
|
<div class="code"><pre>ActivateSceneIntent activate {Scene}
|
||||||
|
</pre></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p>Then add the intent to your Alexa Section in your HA config file:</p>
|
||||||
|
|
||||||
|
<div class="highlighter-coderay"><div class="CodeRay">
|
||||||
|
<div class="code"><pre>
|
||||||
|
<span class="key">ActivateSceneIntent</span>:
|
||||||
|
<span class="key">action</span>:
|
||||||
|
<span class="key">service</span>: <span class="string"><span class="content">scene.turn_on</span></span>
|
||||||
|
<span class="key">data_template</span>:
|
||||||
|
<span class="key">entity_id</span>: <span class="string"><span class="content">scene.{{ Scene | replace(" ", "_") }}</span></span>
|
||||||
|
<span class="key">speech</span>:
|
||||||
|
<span class="key">type</span>: <span class="string"><span class="content">plaintext</span></span>
|
||||||
|
<span class="key">text</span>: <span class="string"><span class="content">OK</span></span>
|
||||||
|
</pre></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p>Here we are using <a href="/topics/templating/">templates</a> to take the name we gave to Alexa e.g. <code>downstairs on</code> and replace the space with an underscore so it becomes <code>downstairs_on</code> as Home Assistant expects.</p>
|
||||||
|
|
||||||
|
<p>Now say <code>Alexa ask homeassistant to activate <some scene></code> and Alexa will activate that scene for you.</p>
|
||||||
|
|
||||||
|
<h3><a class="title-link" name="adding-scripts" href="#adding-scripts"></a> Adding Scripts</h3>
|
||||||
|
|
||||||
|
<p>We can easily extend the above idea to work with scripts as well. As before, add an intent for scripts:</p>
|
||||||
|
|
||||||
|
<div class="highlighter-coderay"><div class="CodeRay">
|
||||||
|
<div class="code"><pre>{
|
||||||
|
<span class="key"><span class="delimiter">"</span><span class="content">intent</span><span class="delimiter">"</span></span>: <span class="string"><span class="delimiter">"</span><span class="content">RunScriptIntent</span><span class="delimiter">"</span></span>,
|
||||||
|
<span class="key"><span class="delimiter">"</span><span class="content">slots</span><span class="delimiter">"</span></span>:
|
||||||
|
[
|
||||||
|
{
|
||||||
|
<span class="key"><span class="delimiter">"</span><span class="content">name</span><span class="delimiter">"</span></span> : <span class="string"><span class="delimiter">"</span><span class="content">Script</span><span class="delimiter">"</span></span>,
|
||||||
|
<span class="key"><span class="delimiter">"</span><span class="content">type</span><span class="delimiter">"</span></span> : <span class="string"><span class="delimiter">"</span><span class="content">Scripts</span><span class="delimiter">"</span></span>
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
</pre></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p>Create a custom slot type called <code>Scripts</code> listing every script you want to run:</p>
|
||||||
|
|
||||||
|
<p class="img">
|
||||||
|
<img src="/images/components/alexa/script_slot.png" />
|
||||||
|
Custom slot type for script support.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>Add a sample utterance:</p>
|
||||||
|
|
||||||
|
<div class="highlighter-coderay"><div class="CodeRay">
|
||||||
|
<div class="code"><pre>RunScriptIntent run {Scene}
|
||||||
|
</pre></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p>Then add the intent to your Alexa Section in your HA config file:</p>
|
||||||
|
|
||||||
|
<div class="highlighter-coderay"><div class="CodeRay">
|
||||||
|
<div class="code"><pre>
|
||||||
|
<span class="key">RunScriptIntent</span>:
|
||||||
|
<span class="key">action</span>:
|
||||||
|
<span class="key">service</span>: <span class="string"><span class="content">script.turn_on</span></span>
|
||||||
|
<span class="key">data_template</span>:
|
||||||
|
<span class="key">entity_id</span>: <span class="string"><span class="content">script.{{ Script | replace(" ", "_") }}</span></span>
|
||||||
|
<span class="key">speech</span>:
|
||||||
|
<span class="key">type</span>: <span class="string"><span class="content">plaintext</span></span>
|
||||||
|
<span class="key">text</span>: <span class="string"><span class="content">OK</span></span>
|
||||||
|
|
||||||
|
</pre></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p>Now say <code>Alexa ask homeassistant to run <some script></code> and Alexa will run that script for you.</p>
|
||||||
|
|
||||||
|
<h3><a class="title-link" name="giving-alexa-some-personality" href="#giving-alexa-some-personality"></a> Giving Alexa Some Personality</h3>
|
||||||
|
|
||||||
|
<p>In the examples above, we told Alexa to say <code>OK</code> when she succesfully completed the task. This is effective but a little dull! We can again use <a href="/topics/templating/">templates</a> to spice things up a little.</p>
|
||||||
|
|
||||||
|
<p>First create a file called <code>alexa_confirm.yaml</code> with something like the following in it (go on, be creative!):</p>
|
||||||
|
|
||||||
|
<div class="highlighter-coderay"><div class="CodeRay">
|
||||||
|
<div class="code"><pre>
|
||||||
|
>
|
||||||
|
{{ [
|
||||||
|
"OK",
|
||||||
|
"Sure",
|
||||||
|
"If you insist",
|
||||||
|
"Done",
|
||||||
|
"No worries",
|
||||||
|
"I can do that",
|
||||||
|
"Leave it to me",
|
||||||
|
"Consider it done",
|
||||||
|
"As you wish",
|
||||||
|
"By your command",
|
||||||
|
"Affirmative",
|
||||||
|
"Yes oh revered one",
|
||||||
|
"I will",
|
||||||
|
"As you decree, so shall it be",
|
||||||
|
"No Problem"
|
||||||
|
] | random }}
|
||||||
|
</pre></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p>Then, wherever you would but some simple text for a response like<code>OK</code>, replace it with a reference to the file so that:</p>
|
||||||
|
|
||||||
|
<pre><code>text: OK
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>becomes:</p>
|
||||||
|
|
||||||
|
<pre><code>text: !include alexa_confirm.yaml
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>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.</p>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
|
|
BIN
images/components/alexa/scene_slot.png
Normal file
BIN
images/components/alexa/scene_slot.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 20 KiB |
BIN
images/components/alexa/script_slot.png
Normal file
BIN
images/components/alexa/script_slot.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 27 KiB |
12
sitemap.xml
12
sitemap.xml
|
@ -1766,26 +1766,26 @@
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://home-assistant.io/demo/frontend.html</loc>
|
<loc>https://home-assistant.io/demo/frontend.html</loc>
|
||||||
<lastmod>2016-06-18T18:49:23+00:00</lastmod>
|
<lastmod>2016-06-18T19:14:12+00:00</lastmod>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://home-assistant.io/demo/index.html</loc>
|
<loc>https://home-assistant.io/demo/index.html</loc>
|
||||||
<lastmod>2016-06-18T18:49:23+00:00</lastmod>
|
<lastmod>2016-06-18T19:14:12+00:00</lastmod>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://home-assistant.io/googlef4f3693c209fe788.html</loc>
|
<loc>https://home-assistant.io/googlef4f3693c209fe788.html</loc>
|
||||||
<lastmod>2016-06-18T18:49:23+00:00</lastmod>
|
<lastmod>2016-06-18T19:14:12+00:00</lastmod>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://home-assistant.io/static/fonts/roboto/DESCRIPTION.en_us.html</loc>
|
<loc>https://home-assistant.io/static/fonts/roboto/DESCRIPTION.en_us.html</loc>
|
||||||
<lastmod>2016-06-18T18:49:23+00:00</lastmod>
|
<lastmod>2016-06-18T19:14:12+00:00</lastmod>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://home-assistant.io/static/fonts/robotomono/DESCRIPTION.en_us.html</loc>
|
<loc>https://home-assistant.io/static/fonts/robotomono/DESCRIPTION.en_us.html</loc>
|
||||||
<lastmod>2016-06-18T18:49:23+00:00</lastmod>
|
<lastmod>2016-06-18T19:14:12+00:00</lastmod>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://home-assistant.io/static/mdi-demo.html</loc>
|
<loc>https://home-assistant.io/static/mdi-demo.html</loc>
|
||||||
<lastmod>2016-06-18T18:49:23+00:00</lastmod>
|
<lastmod>2016-06-18T19:14:12+00:00</lastmod>
|
||||||
</url>
|
</url>
|
||||||
</urlset>
|
</urlset>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue