Site updated at 2017-04-08 23:38:08 UTC
This commit is contained in:
parent
0b450989d5
commit
b671c3bdf9
536 changed files with 6498 additions and 1728 deletions
|
@ -70,6 +70,7 @@
|
|||
<p>Triggers are what starts the processing of an automation rule. It is possible to specify multiple triggers for the same rule. Once a trigger starts, Home Assistant will validate the conditions, if any, and call the action.</p>
|
||||
<h3><a class="title-link" name="event-trigger" href="#event-trigger"></a> Event trigger</h3>
|
||||
<p>Triggers when an event is being processed. Events are the raw building blocks of Home Assistant. You can match events on just the event name or also require specific event data to be present.</p>
|
||||
<p>Events can be fired by components or via the API. There is no limitation to the types. A list of built-in events can be found <a href="/docs/configuration/events/">here</a>.</p>
|
||||
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">automation</span><span class="pi">:</span>
|
||||
<span class="s">trigger</span><span class="pi">:</span>
|
||||
<span class="s">platform</span><span class="pi">:</span> <span class="s">event</span>
|
||||
|
@ -79,7 +80,18 @@
|
|||
<span class="s">mood</span><span class="pi">:</span> <span class="s">happy</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<p>For example, to carry out actions when Home Assistant starts, you can use <code class="highlighter-rouge">event_type: homeassistant_start</code>. See other ‘events’ supported by Home Assistant <a href="https://home-assistant.io/topics/events/">here</a>.</p>
|
||||
<p class="note warning">
|
||||
Starting 0.42, it is no longer possible to listen for event <code class="highlighter-rouge">homeassistant_start</code>. Use the ‘homeassistant’ platform below instead.
|
||||
</p>
|
||||
<h3><a class="title-link" name="home-assistant-trigger" href="#home-assistant-trigger"></a> Home Assistant trigger</h3>
|
||||
<p>Use this platform to trigger when Home Assistant starts up and shuts down.</p>
|
||||
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">automation</span><span class="pi">:</span>
|
||||
<span class="s">trigger</span><span class="pi">:</span>
|
||||
<span class="s">platform</span><span class="pi">:</span> <span class="s">homeassistant</span>
|
||||
<span class="c1"># Event can also be 'shutdown'</span>
|
||||
<span class="s">event</span><span class="pi">:</span> <span class="s">start</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<h3><a class="title-link" name="mqtt-trigger" href="#mqtt-trigger"></a> MQTT trigger</h3>
|
||||
<p>Triggers when a specific message is received on given topic. Optionally can match on the payload being sent over the topic.</p>
|
||||
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">automation</span><span class="pi">:</span>
|
||||
|
@ -109,7 +121,7 @@
|
|||
<span class="s">trigger</span><span class="pi">:</span>
|
||||
<span class="s">platform</span><span class="pi">:</span> <span class="s">state</span>
|
||||
<span class="s">entity_id</span><span class="pi">:</span> <span class="s">device_tracker.paulus, device_tracker.anne_therese</span>
|
||||
<span class="c1"># Optional </span>
|
||||
<span class="c1"># Optional</span>
|
||||
<span class="s">from</span><span class="pi">:</span> <span class="s1">'</span><span class="s">not_home'</span>
|
||||
<span class="s">to</span><span class="pi">:</span> <span class="s1">'</span><span class="s">home'</span>
|
||||
|
||||
|
@ -138,7 +150,7 @@
|
|||
</code></pre>
|
||||
</div>
|
||||
<h3><a class="title-link" name="template-trigger" href="#template-trigger"></a> Template trigger</h3>
|
||||
<p>Template triggers work by evaluating a [template] on each state change. The trigger will fire if the state change caused the template to render ‘true’. This is achieved by having the template result in a true boolean expression (<code class="highlighter-rouge"><span class="p">{</span><span class="err">{</span><span class="w"> </span><span class="err">is_state('device_tracker.paulus',</span><span class="w"> </span><span class="err">'home')</span><span class="w"> </span><span class="p">}</span><span class="err">}</span></code>) or by having the template render ‘true’ (example below).
|
||||
<p>Template triggers work by evaluating a <a href="/docs/configuration/templating/">template</a> on each state change. The trigger will fire if the state change caused the template to render ‘true’. This is achieved by having the template result in a true boolean expression (<code class="highlighter-rouge"><span class="p">{</span><span class="err">{</span><span class="w"> </span><span class="err">is_state('device_tracker.paulus',</span><span class="w"> </span><span class="err">'home')</span><span class="w"> </span><span class="p">}</span><span class="err">}</span></code>) or by having the template render ‘true’ (example below).
|
||||
With template triggers you can also evaluate attribute changes by using is_state_attr (<code class="highlighter-rouge"><span class="p">{</span><span class="err">{</span><span class="w"> </span><span class="err">is_state_attr('climate.living_room',</span><span class="w"> </span><span class="err">'away_mode',</span><span class="w"> </span><span class="err">'off')</span><span class="w"> </span><span class="p">}</span><span class="err">}</span></code>)</p>
|
||||
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">automation</span><span class="pi">:</span>
|
||||
<span class="s">trigger</span><span class="pi">:</span>
|
||||
|
@ -244,9 +256,14 @@ With template triggers you can also evaluate attribute changes by using is_state
|
|||
<li><a href='/docs/configuration/secrets/'>Storing Secrets </a></li>
|
||||
<li><a href='/docs/configuration/templating/'>Templating </a></li>
|
||||
<li><a href='/docs/configuration/group_visibility/'>Group Visibility </a></li>
|
||||
<li><a href='/docs/configuration/platform_options/'>Entity component platform options </a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
Core objects
|
||||
<ul>
|
||||
<li><a href='/docs/configuration/events/'>Events </a></li>
|
||||
<li><a href='/docs/configuration/state_object/'>State Objects </a></li>
|
||||
<li><a href='/docs/configuration/platform_options/'>Entity component platform options </a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
|
@ -393,6 +410,7 @@ With template triggers you can also evaluate attribute changes by using is_state
|
|||
<ul>
|
||||
<li><a href='/docs/ecosystem/certificates/tls_self_signed_certificate/'>Self-signed certificate </a></li>
|
||||
<li><a href='/docs/ecosystem/certificates/tls_domain_certificate/'>Certificate domain owners </a></li>
|
||||
<li><a href='/docs/ecosystem/certificates/lets_encrypt/'>Let's Encrypt (detailed) </a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href='/docs/ecosystem/scenegen/'>scenegen </a></li>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue