forked from home-assistant/home-assistant.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify getting started (home-assistant#9258)
* Simplify getting started * Update automation.markdown * Update automation.markdown * Updates * Tweak
- Loading branch information
Showing
13 changed files
with
166 additions
and
259 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,52 @@ | ||
--- | ||
layout: page | ||
title: "Automating Home Assistant" | ||
description: "Instructions to get started with Automation using Home Assistant." | ||
date: 2016-09-26 21:00 | ||
description: "A quick intro on getting your first automation going." | ||
date: 2016-04-24 08:30 +0100 | ||
sidebar: true | ||
comments: false | ||
sharing: true | ||
footer: true | ||
redirect_from: | ||
- /getting-started/automation-create-first/ | ||
- /getting-started/automation-2/ | ||
--- | ||
|
||
When your devices are set up, it's time to put the cherry on the pie: **automation**. Home Assistant offers [a few built-in automations](/components/#automation) – but you'll be using the automation component to set up your own rules, for the most part. | ||
When your devices are set up, it's time to put the cherry on the pie: automation. In this guide we're going to create a simple automation rule to **turn on the lights when the sun sets**. | ||
|
||
If you added a random sensor in the previous step then you can use that sensor for your very first automation: | ||
In Home Assistant, open the menu by clicking on the top-left icon and click on configuration. Now click on automations. This is the automation screen from which you can manage all the automations in Home Assistant. | ||
|
||
```yaml | ||
automation: | ||
- alias: Check sensor value and show notification | ||
trigger: | ||
platform: numeric_state | ||
entity_id: sensor.random_sensor | ||
above: 10 | ||
action: | ||
service: persistent_notification.create | ||
data: | ||
message: "Sensor value greater than 10" | ||
``` | ||
Click on the orange button at the bottom right to create a new automation. You are presented with a blank automation screen. | ||
|
||
For further details about automation, please take the next step or the [automation documentation](/docs/automation/). | ||
<p class='img'> | ||
<img src='/images/getting-started/automation-new-blank.png'> | ||
The automation editor. | ||
</p> | ||
|
||
### [Next step: Home Assistant Automation Part 2 »](/getting-started/automation-2/) | ||
The first thing we will do is to set a name. Enter "Turn Lights On at Sunset". | ||
|
||
The second step is defining what should trigger our automation to run. In this case we want to use the event of the sun setting to trigger our automation. However, if we would turn on the lights when the sun actually sets, it would be too late as it already gets quite dark while it's setting. So we're going to add an offset. | ||
|
||
In the trigger section, click on the dropdown and change trigger type to "Sun". It allows us to pick between sunrise and sunset, go ahead and pick sunset. As we discussed, we want our automation to be triggered a little before the sun actually sets, so let's add `-0:30` to the offset. This indicates that we will trigger 30 minutes before the sun actually sets, neat! | ||
|
||
<p class='img'> | ||
<img src='/images/getting-started/automation-new-name-trigger.png'> | ||
A new automation with a sun trigger filled in. | ||
</p> | ||
|
||
Once we have defined our trigger, scroll down to the action section. Make sure trigger type is set to "Call Service" and change the service to `light.turn_on`. For this automation we're going to turn on all lights, so let's change the service data to `{ "entity_id": "all" }`. | ||
|
||
<p class='img'> | ||
<img src='/images/getting-started/automation-new-action.png'> | ||
A new automation with the action set up to turn on the lights. | ||
</p> | ||
|
||
Click the orange button to save the automation. Now wait till it's 30 minutes until the sun sets and see your automation magic! | ||
|
||
Further reading on automations: | ||
|
||
- [Triggers](/docs/automation/trigger/) | ||
- [Conditions](/docs/automation/condition/) | ||
- [Actions](/docs/automation/action/) | ||
|
||
### [Next step: Presence detection »](/getting-started/presence-detection/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.