Site updated at 2017-02-23 10:14:06 UTC
This commit is contained in:
parent
f402a25638
commit
ac0a1f4c4f
932 changed files with 1599 additions and 29010 deletions
|
@ -9,7 +9,7 @@
|
|||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<title>Automating Home Assistant - Home Assistant</title>
|
||||
<meta name="author" content="Home Assistant">
|
||||
<meta name="description" content="Steps to help you get automation setup in Home Assistant.">
|
||||
<meta name="description" content="Instructions to get started with Automation using Home Assistant.">
|
||||
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<link rel="canonical" href="https://home-assistant.io/getting-started/automation/">
|
||||
|
@ -19,14 +19,14 @@
|
|||
<meta property="og:site_name" content="Home Assistant">
|
||||
<meta property="og:url" content="https://home-assistant.io/getting-started/automation/">
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:description" content="Steps to help you get automation setup in Home Assistant.">
|
||||
<meta property="og:description" content="Instructions to get started with Automation using Home Assistant.">
|
||||
<meta property="og:image" content="https://home-assistant.io/images/default-social.png">
|
||||
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:site" content="@home_assistant">
|
||||
|
||||
<meta name="twitter:title" content="Automating Home Assistant">
|
||||
<meta name="twitter:description" content="Steps to help you get automation setup in Home Assistant.">
|
||||
<meta name="twitter:description" content="Instructions to get started with Automation using Home Assistant.">
|
||||
<meta name="twitter:image" content="https://home-assistant.io/images/default-social.png">
|
||||
|
||||
<link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet">
|
||||
|
@ -56,7 +56,7 @@
|
|||
|
||||
<li><a href="/getting-started/">Getting started</a></li>
|
||||
<li><a href="/components/">Components</a></li>
|
||||
<li><a href="/ecosystem/">Ecosystem</a></li>
|
||||
<li><a href="/docs/">Docs</a></li>
|
||||
<li><a href="/cookbook/">Examples</a></li>
|
||||
<li><a href="/developers/">Developers</a></li>
|
||||
<li><a href="/blog/">Blog</a></li>
|
||||
|
@ -90,68 +90,26 @@
|
|||
<hr class="divider">
|
||||
|
||||
|
||||
<p>When all your devices are set up, it’s time to put the cherry on the pie: automation. Home Assistant offers <a href="/components/#automation">a few built-in automations</a> – but you’ll be using the automation component to set up your own rules, for the most part.</p>
|
||||
<p>When your devices are set up, it’s time to put the cherry on the pie: <strong>automation</strong>. Home Assistant offers <a href="/components/#automation">a few built-in automations</a> – but you’ll be using the automation component to set up your own rules, for the most part.</p>
|
||||
|
||||
<p>Home Assistant offers a wide range of automation configurations. In the next few pages, we’ll try to guide you through all the different possibilities and options. Besides this documentation, there are also a couple of people who have made their automations <a href="/cookbook/#example-configurationyaml">publicly available</a>.</p>
|
||||
<p>If you added a random sensor in the previous step then you can use that sensor for your very first automation:</p>
|
||||
|
||||
<h3><a class="title-link" name="automation-basics" href="#automation-basics"></a> Automation basics</h3>
|
||||
|
||||
<p>Before you can go ahead and create your own automations, it’s important to learn the basics. To explore these, let’s have a look at the following example home automation rule:</p>
|
||||
|
||||
<div class="language-text highlighter-rouge"><pre class="highlight"><code>(trigger) When Paulus arrives home
|
||||
(condition) and it is after sunset:
|
||||
(action) Turn the lights in the living room on
|
||||
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">automation</span><span class="pi">:</span>
|
||||
<span class="pi">-</span> <span class="s">alias</span><span class="pi">:</span> <span class="s">Check sensor value and show notification</span>
|
||||
<span class="s">trigger</span><span class="pi">:</span>
|
||||
<span class="s">platform</span><span class="pi">:</span> <span class="s">numeric_state</span>
|
||||
<span class="s">entity_id</span><span class="pi">:</span> <span class="s">sensor.random</span>
|
||||
<span class="s">above</span><span class="pi">:</span> <span class="s">10</span>
|
||||
<span class="s">action</span><span class="pi">:</span>
|
||||
<span class="s">service</span><span class="pi">:</span> <span class="s">persistent_notification.create</span>
|
||||
<span class="s">data</span><span class="pi">:</span>
|
||||
<span class="s">message</span><span class="pi">:</span> <span class="s2">"</span><span class="s">Sensor</span><span class="nv"> </span><span class="s">value</span><span class="nv"> </span><span class="s">greater</span><span class="nv"> </span><span class="s">than</span><span class="nv"> </span><span class="s">10"</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
|
||||
<p>The example consists of three different parts: a trigger, a condition and an action.</p>
|
||||
<p>For further details about automation, please take the next step or the <a href="/docs/automation/">automation documentation</a>.</p>
|
||||
|
||||
<p>The first line is the <strong>trigger</strong> of the automation rule. Triggers describe events that should trigger the automation rule. In this case, it is a person arriving home, which can be observed in Home Assistant by observing the state of Paulus changing from ‘not_home’ to ‘home’.</p>
|
||||
|
||||
<p>The second line is the <strong>condition</strong>. Conditions are optional tests that can limit an automation rule to only work in your specific use cases. A condition will test against the current state of the system. This includes the current time, devices, people and other things like the sun. In this case, we only want to act when the sun has set.</p>
|
||||
|
||||
<p>The third part is the <strong>action</strong>, which will be performed when a rule is triggered and all conditions are met. For example, it can turn a light on, set the temperature on your thermostat or activate a scene.</p>
|
||||
|
||||
<p class="note">
|
||||
The difference between a condition and a trigger can be confusing as they are very similar. Triggers look at the actions, while conditions look at the results: turning a light on versus a light being on.
|
||||
</p>
|
||||
|
||||
<h3><a class="title-link" name="exploring-the-internal-state" href="#exploring-the-internal-state"></a> Exploring the internal state</h3>
|
||||
|
||||
<p>Automation rules interact directly with the internal state of Home Assistant, so you’ll need to familiarize yourself with it. Home Assistant exposes its current state via the developer tools. These are available at the bottom of the sidebar in the frontend. The <img src="/images/screenshots/developer-tool-states-icon.png" class="no-shadow" height="38" /> icon will show all currently available states. An entity can be anything. A light, a switch, a person and even the sun. A state consists of the following parts:</p>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Description</th>
|
||||
<th>Example</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Entity ID</td>
|
||||
<td>Unique identifier for the entity.</td>
|
||||
<td><code class="highlighter-rouge">light.kitchen</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>State</td>
|
||||
<td>The current state of the device.</td>
|
||||
<td><code class="highlighter-rouge">home</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Attributes</td>
|
||||
<td>Extra data related to the device and/or current state.</td>
|
||||
<td><code class="highlighter-rouge">brightness</code></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<p>State changes can be used as the source of triggers and the current state can be used in conditions.</p>
|
||||
|
||||
<p>Actions are all about calling services. To explore the available services open the <img src="/images/screenshots/developer-tool-services-icon.png" class="no-shadow" height="38" /> Services developer tool. Services allow to change anything. For example turn on a light, run a script or enable a scene. Each service has a domain and a name. For example the service <code class="highlighter-rouge">light.turn_on</code> is capable of turning on any light in your system. Services can be passed parameters to for example tell which device to turn on or what color to use.</p>
|
||||
|
||||
<h3><a href="/getting-started/automation-create-first/">Next step: Your First Automation »</a></h3>
|
||||
<h3><a href="/getting-started/automation-2/">Next step: Home Assistant Automation Part 2 »</a></h3>
|
||||
|
||||
|
||||
</article>
|
||||
|
@ -169,75 +127,12 @@ The difference between a condition and a trigger can be confusing as they are ve
|
|||
<div class='section'>
|
||||
<h1 class="title delta">Getting Started Guide</h1>
|
||||
<ul class='divided sidebar-menu'>
|
||||
<li>
|
||||
<a href='/getting-started/'>Installation </a>
|
||||
<ul>
|
||||
<li><a href='/getting-started/installation-python/'>Python </a></li>
|
||||
<li><a href='/getting-started/updating/'>Updating </a></li>
|
||||
<li><a href='/getting-started/troubleshooting/'>Troubleshooting </a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href='/getting-started/hassbian/'>Hassbian </a>
|
||||
<ul>
|
||||
<li><a href='/getting-started/hassbian-installation/'>Installation </a></li>
|
||||
<li><a href='/getting-started/hassbian-customization/'>Customization </a></li>
|
||||
<li><a href='/getting-started/hassbian-common-tasks/'>Common tasks </a></li>
|
||||
<li><a href='/getting-started/hassbian-integrations/'>Integrations </a></li>
|
||||
<li><a href='/getting-started/hassbian-upgrading/'>Upgrading </a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href='/getting-started/configuration/'>Configuration </a>
|
||||
<ul>
|
||||
<li><a href='/getting-started/yaml/'>YAML </a></li>
|
||||
<li><a href='/getting-started/basic/'>Basic information </a></li>
|
||||
<li><a href='/getting-started/devices/'>Setting up devices </a></li>
|
||||
<li><a href='/getting-started/customizing-devices/'>Customizing devices and services </a></li>
|
||||
<li><a href='/getting-started/presence-detection/'>Presence Detection </a></li>
|
||||
<li><a href='/getting-started/troubleshooting-configuration/'>Troubleshooting </a></li>
|
||||
<li><a href='/getting-started/securing/'>Security Check Points </a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a class='active' href='/getting-started/automation/'>Automation </a>
|
||||
<ul>
|
||||
<li><a href='/getting-started/automation-create-first/'>Tutorial </a></li>
|
||||
<li><a href='/getting-started/automation-trigger/'>Triggers </a></li>
|
||||
<li><a href='/getting-started/automation-condition/'>Conditions </a></li>
|
||||
<li><a href='/getting-started/automation-action/'>Actions </a></li>
|
||||
<li><a href='/getting-started/automation-templating/'>Templates </a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href='/getting-started/scripts/'>Scripts </a>
|
||||
<ul>
|
||||
<li><a href='/getting-started/scripts-service-calls/'>Service Calls </a></li>
|
||||
<li><a href='/getting-started/scripts-conditions/'>Conditions </a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href='/getting-started/z-wave/'>Z-Wave </a>
|
||||
<ul>
|
||||
<li><a href='/getting-started/z-wave-controllers/'>Controllers </a></li>
|
||||
<li><a href='/getting-started/z-wave-settings/'>Modifying Settings </a></li>
|
||||
<li><a href='/getting-started/z-wave-device-specific/'>Device Specific </a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href='/getting-started/autostart/'>Autostart </a>
|
||||
<ul>
|
||||
<li><a href='/getting-started/autostart-systemd/'>Linux - systemd </a></li>
|
||||
<li><a href='/getting-started/autostart-upstart/'>Linux - Upstart </a></li>
|
||||
<li><a href='/getting-started/autostart-init.d/'>Linux - init.d </a></li>
|
||||
<li><a href='/getting-started/autostart-macos/'>macOS </a></li>
|
||||
<li><a href='/getting-started/autostart-synology/'>Synology NAS </a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href='/topics/'>Advanced Topics </a></li>
|
||||
<li><a href='/details/'>Details </a></li>
|
||||
<li><a href='/getting-started/mobile/'>Add to Android/iOS Homescreen </a></li>
|
||||
<li><a href='/getting-started/browsers/'>Browser Compatibility List </a></li>
|
||||
<li><a href='/getting-started/'>Installation </a>
|
||||
<li><a href='/getting-started/configuration/'>Configuration </a></li>
|
||||
<li><a class='active' href='/getting-started/automation/'>Automation </a></li>
|
||||
<li><a href='/getting-started/automation-2/'>Automation 2 </a></li>
|
||||
<li><a href='/getting-started/presence-detection/'>Presence detection </a></li>
|
||||
<li><a href='/getting-started/use/'>Use it! </a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue