Site updated at 2016-03-28 03:56:49 UTC
This commit is contained in:
parent
0fbe06a0cb
commit
aaafbb1c55
25 changed files with 280 additions and 237 deletions
|
@ -117,6 +117,12 @@
|
|||
|
||||
<p>A configuration section of an automation requires a <code>trigger</code> and an <code>action</code> section. <code>condition</code> and <code>condition_type</code> are optional. To keep this page compact, all following sections will not show the full configuration but only the relevant part.</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="#conditions">Jump to conditions</a></li>
|
||||
<li><a href="#actions">Jump to actions</a></li>
|
||||
<li><a href="#troubleshooting">Jump to troubleshooting</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre><span class="comment"># Example of entry in configuration.yaml</span>
|
||||
<span class="key">automation</span>:
|
||||
|
@ -173,12 +179,6 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li><a href="#conditions">Jump to conditions</a></li>
|
||||
<li><a href="#actions">Jump to actions</a></li>
|
||||
<li><a href="#troubleshooting">Jump to troubleshooting</a></li>
|
||||
</ul>
|
||||
|
||||
<h2><a class="title-link" name="triggers" href="#triggers"></a> Triggers</h2>
|
||||
|
||||
<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>
|
||||
|
@ -329,9 +329,9 @@
|
|||
|
||||
<h2><a class="title-link" name="conditions" href="#conditions"></a> Conditions</h2>
|
||||
|
||||
<p>Conditions are an optional part of an automation rule and be used to prevent an action from happening when triggered. Conditions look very familiar to triggers but are very different. A trigger will look at events happening at the system while a condition only looks at how the system looks right now. A trigger can observe that a switch is being turned on. A condition can only see if a switch is on or off.</p>
|
||||
<p>Conditions are an optional part of an automation rule and be used to prevent an action from happening when triggered. Conditions look very similar to triggers but are very different. A trigger will look at events happening in the system while a condition only looks at how the system looks right now. A trigger can observe that a switch is being turned on. A condition can only see if a switch is currently on or off.</p>
|
||||
|
||||
<p>An automation rule can have mulitiple conditions. By default the action will only fire if all conditions pass. An optional key <code>condition_type: 'or'</code> can be set on the automation rule to fire action if any condition matches. In the example below, the automation would trigger if the time is before 05:00 <em>OR</em> after 20:00.</p>
|
||||
<p>An automation rule can have multiple conditions. By default the action will only fire if all conditions pass. An optional key <code>condition_type: 'or'</code> can be set on the automation rule to fire action if any condition matches. In the example below, the automation would trigger if the time is before 05:00 <em>OR</em> after 20:00.</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre><span class="key">automation</span>:
|
||||
|
@ -356,18 +356,17 @@
|
|||
|
||||
<h4><a class="title-link" name="numeric-state-condition" href="#numeric-state-condition"></a> Numeric state condition</h4>
|
||||
|
||||
<p>Attempts to parse the state of specified entity as a number and triggers if value is above and/or below a threshold.</p>
|
||||
<p>This type of condition attempts to parse the state of specified entity as a number and triggers if the value matches all of the above or below thresholds. <br />
|
||||
Either <code>above</code> or <code>below</code>, or both need to be specified. If both are used, the condition is true when the value is >= <code>before</code> *and** < <code>after</code>. <br />
|
||||
You can optionally use a <code>value_template</code> to make the value of the entity the same type of value as the condition.</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre><span class="key">automation</span>:
|
||||
<span class="key">condition</span>:
|
||||
<span class="key">platform</span>: <span class="string"><span class="content">numeric_state</span></span>
|
||||
<span class="key">entity_id</span>: <span class="string"><span class="content">sensor.temperature</span></span>
|
||||
<span class="comment"># At least one of the following required</span>
|
||||
<span class="key">above</span>: <span class="string"><span class="content">17</span></span>
|
||||
<span class="key">below</span>: <span class="string"><span class="content">25</span></span>
|
||||
<span class="comment"># Optional</span>
|
||||
<span class="key">value_template</span>: <span class="string"><span class="content">'{{ state.attributes.battery }}'</span></span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -387,7 +386,6 @@
|
|||
<span class="key">hours</span>: <span class="string"><span class="content">1</span></span>
|
||||
<span class="key">minutes</span>: <span class="string"><span class="content">10</span></span>
|
||||
<span class="key">seconds</span>: <span class="string"><span class="content">5</span></span>
|
||||
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -409,7 +407,7 @@
|
|||
|
||||
<h4><a class="title-link" name="template-condition" href="#template-condition"></a> Template condition</h4>
|
||||
|
||||
<p>The template condition will test if <a href="/topics/templating/">given template</a> renders a value equal to true. This is achieved by having the template result in a true boolean expression or by having the template render ‘true’.</p>
|
||||
<p>The template condition will test if the <a href="/topics/templating/">given template</a> renders a value equal to true. This is achieved by having the template result in a true boolean expression or by having the template render ‘true’.</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre><span class="key">automation</span>:
|
||||
|
@ -459,7 +457,7 @@
|
|||
|
||||
<h2><a class="title-link" name="actions" href="#actions"></a> Actions</h2>
|
||||
|
||||
<p>When an automation rule fires, it calls a service. For this service you can specify an entity id it should apply to and optional service parameters (to specify for example the brightness).</p>
|
||||
<p>When an automation rule fires, it calls a service. For this service you can specify the entity_id that it should apply to and optional service parameters (to specify for example the brightness).</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre><span class="key">automation</span>:
|
||||
|
@ -487,11 +485,11 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<p>If you want to specify multiple services to be called or include a delay, have a look at the <a href="/components/script/">script component</a>. If you want to describe how certain entities should look, check out the <a href="/components/scene/">scene component</a>.</p>
|
||||
<p>If you want to specify multiple services to be called, or to include a delay, have a look at the <a href="/components/script/">script component</a>. If you want to describe the desired state of certain entities, check out the <a href="/components/scene/">scene component</a>.</p>
|
||||
|
||||
<h2><a class="title-link" name="troubleshooting" href="#troubleshooting"></a> Troubleshooting</h2>
|
||||
|
||||
<p>You can verify that your automation rules are being initialized correctly by watching both the realtime logs and also the logbook. The realtime logs will show the rules being initialized (once for each trigger):</p>
|
||||
<p>You can verify that your automation rules are being initialized correctly by watching both the realtime logs (<code>homeassistant.log</code> in the configuration directory) and also the <a href="/components/logbook/">Logbook</a>. The realtime logs will show the rules being initialized (once for each trigger), example:</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre>INFO [homeassistant.components.automation] Initialized rule Rainy Day
|
||||
|
@ -502,7 +500,7 @@ INFO [homeassistant.components.automation] Initialized rule Rain is over
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<p>The Logbook component will show a line entry when an automation is triggered. You can look at the previous entry to determine which trigger in the rule triggered the event.</p>
|
||||
<p>The Logbook component will show a line entry when an automation is triggered. You can look at the previous entry to determine which trigger in the rule triggered the event.</p>
|
||||
|
||||
<p><img src="/images/components/automation/logbook.png" alt="Logbook example" /></p>
|
||||
|
||||
|
|
|
@ -130,6 +130,10 @@
|
|||
<img src="/images/screenshots/voice-commands.png" />
|
||||
</p>
|
||||
|
||||
<p class="note note">
|
||||
Apple iPhones do not support this feature in any browser.
|
||||
</p>
|
||||
|
||||
|
||||
</article>
|
||||
|
||||
|
|
|
@ -139,11 +139,11 @@
|
|||
|
||||
<p>On top of the <code>http</code> component is a <a href="/developers/rest_api/">REST API</a> and a <a href="/developers/python_api/">Python API</a> available.</p>
|
||||
|
||||
<p>The <code>http</code> platforms are not a real platform within the meaning of the terminology used around Home Assistant. Home Assistant’s <a href="/developers/rest_api/">REST API</a> is consuming and proceeding messages received over HTTP.</p>
|
||||
<p>The <code>http</code> platforms are not real platforms within the meaning of the terminology used around Home Assistant. Home Assistant’s <a href="/developers/rest_api/">REST API</a> sends and receives messages over HTTP.</p>
|
||||
|
||||
<p>To use those kind of sensors in your installation no configuration in Home Assistant is needed. All configuration is done on the devices themselves. This means that you must be able to edit the target URL or endpoint and the payload. The entity will be created after the first message has arrived.</p>
|
||||
|
||||
<p>All <a href="/developers/rest_api/#post-apistatesltentity_id">requests</a> needs to be sent to the endpoint of the device and must be <strong>POST</strong>.</p>
|
||||
<p>All <a href="/developers/rest_api/#post-apistatesltentity_id">requests</a> need to be sent to the endpoint of the device and must be <strong>POST</strong>.</p>
|
||||
|
||||
|
||||
</article>
|
||||
|
|
|
@ -119,7 +119,7 @@
|
|||
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span>
|
||||
<span class="key">input_boolean</span>:
|
||||
<span class="key">notify_home</span>:
|
||||
<span class="key">name</span>: <span class="string"><span class="content">Notify when someome arrives home</span></span>
|
||||
<span class="key">name</span>: <span class="string"><span class="content">Notify when someone arrives home</span></span>
|
||||
<span class="key">initial</span>: <span class="string"><span class="content">off</span></span>
|
||||
<span class="key">icon</span>: <span class="string"><span class="content">mdi:car</span></span>
|
||||
</pre></div>
|
||||
|
@ -137,6 +137,27 @@
|
|||
|
||||
<p>Pick an icon that you can find on <a href="https://materialdesignicons.com/">materialdesignicons.com</a> to use for your input and prefix the name with <code>mdi:</code>. For example <code>mdi:car</code>, <code>mdi:ambulance</code>, or <code>mdi:motorbike</code>.</p>
|
||||
|
||||
<p>Here’s an example of an automation using the above input_boolean. This action will only occur if the switch is on.</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre><span class="key">automation</span>:
|
||||
<span class="key">alias</span>: <span class="string"><span class="content">Arriving home</span></span>
|
||||
<span class="key">trigger</span>:
|
||||
<span class="key">platform</span>: <span class="string"><span class="content">state</span></span>
|
||||
<span class="key">entity_id</span>: <span class="string"><span class="content">binary_sensor.motion_garage</span></span>
|
||||
<span class="key">to</span>: <span class="string"><span class="content">'on'</span></span>
|
||||
<span class="key">condition</span>:
|
||||
<span class="key">platform</span>: <span class="string"><span class="content">state</span></span>
|
||||
<span class="key">entity_id</span>: <span class="string"><span class="content">input_boolean.notify_home</span></span>
|
||||
<span class="key">state</span>: <span class="string"><span class="content">'on'</span></span>
|
||||
<span class="key">action</span>:
|
||||
<span class="key">service</span>: <span class="string"><span class="content">notify.pushbullet</span></span>
|
||||
<span class="key">data</span>:
|
||||
<span class="key">title</span>: <span class="string"><span class="delimiter">"</span><span class="delimiter">"</span></span>
|
||||
<span class="key">message</span>: <span class="string"><span class="delimiter">"</span><span class="content">Honey, I'm home!</span><span class="delimiter">"</span></span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</article>
|
||||
|
|
|
@ -113,11 +113,11 @@
|
|||
<hr class="divider">
|
||||
|
||||
|
||||
<p>The logger component lets one define the level of logging activities in Home Assistant.</p>
|
||||
<p>The logger component lets you define the level of logging activities in Home Assistant.</p>
|
||||
|
||||
<p>To enable the logger in your installation, add the following to your <code>configuration.yaml</code> file:</p>
|
||||
|
||||
<p>By default log all messages and ignore log event lowest than critical for custom omponents.</p>
|
||||
<p>By default log all messages and ignore events lower than critical for specified components.</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span>
|
||||
|
@ -130,7 +130,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<p>By default ignore all messages lowest than critical and log event for custom components.</p>
|
||||
<p>By default ignore all messages lower than critical and log event for specified components.</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span>
|
||||
|
@ -148,7 +148,7 @@
|
|||
<p>Possible log severities are:</p>
|
||||
|
||||
<ul>
|
||||
<li>citical</li>
|
||||
<li>critical</li>
|
||||
<li>fatal</li>
|
||||
<li>error</li>
|
||||
<li>warning</li>
|
||||
|
|
|
@ -113,9 +113,7 @@
|
|||
<hr class="divider">
|
||||
|
||||
|
||||
<p>A user can create scenes that capture the states you want certain entities to be. For example a scene can contain that light A should be turned on and light B should be bright red.</p>
|
||||
|
||||
<p>Scenes can be activated using the service <code>scene.turn_on</code>.</p>
|
||||
<p>You can create scenes that capture the states you want certain entities to be. For example a scene can specify that light A should be turned on and light B should be bright red.</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span>
|
||||
|
@ -138,6 +136,24 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<p>Scenes can be activated using the service <code>scene.turn_on</code> (there is no ‘scene.turn_off’ service).</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre><span class="comment"># Example automation</span>
|
||||
<span class="head"><span class="head">...</span></span>
|
||||
<span class="key">automation</span>:
|
||||
<span class="key">trigger</span>:
|
||||
<span class="key">platform</span>: <span class="string"><span class="content">state</span></span>
|
||||
<span class="key">entity_id</span>: <span class="string"><span class="content">device_tracker.sweetheart</span></span>
|
||||
<span class="key">from</span>: <span class="string"><span class="content">'not_home'</span></span>
|
||||
<span class="key">to</span>: <span class="string"><span class="content">'home'</span></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">entity_id</span>: <span class="string"><span class="content">scene.romantic </span></span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</article>
|
||||
|
||||
|
|
|
@ -179,7 +179,7 @@
|
|||
|
||||
<h3><a class="title-link" name="hddtemp" href="#hddtemp"></a> hddtemp</h3>
|
||||
|
||||
<p>The tool <code>hddtemp</code> collects the temperatur of your harddisks.</p>
|
||||
<p>The tool <code>hddtemp</code> collects the temperature of your harddisks.</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre>$ hddtemp
|
||||
|
|
|
@ -113,9 +113,9 @@
|
|||
<hr class="divider">
|
||||
|
||||
|
||||
<p>The <code>weblinks</code> component allows you to display links in the Home Assistant frontend.</p>
|
||||
<p>The <code>weblink</code> component allows you to display links in the Home Assistant frontend.</p>
|
||||
|
||||
<p>To use this component in your installation, add the following to your <code>configuration.yaml</code> file:</p>
|
||||
<p>To use this component in your installation, add something like the following to your <code>configuration.yaml</code> file:</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre><span class="comment"># Example configuration.yaml entry</span>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue