diff --git a/source/getting-started/automation.markdown b/source/getting-started/automation.markdown index 57932a8c383..024912d4b0d 100644 --- a/source/getting-started/automation.markdown +++ b/source/getting-started/automation.markdown @@ -3,33 +3,38 @@ title: "Automating Home Assistant" description: "A quick intro on getting your first automation going." --- -Once your {% term devices %} are set up, it's time to put the cherry on the pie: {% term automation %}. In this guide we're going to create a simple automation rule to turn on the lights when the sun sets. Of course, this assumes that you have set up an integration that provides a light at this point. +Once your {% term devices %} are set up, it's time to put the cherry on the pie: {% term automation %}. We're going to create a simple automation to turn on the lights when the sun sets. Of course, this assumes that you have set up an integration that provides a light at this point. -In the user interface in the sidebar, click **{% my automations title="Settings > Automations & Scenes" %}**. You will now see the automation screen from which you can manage all the automations in Home Assistant. +## Automatically turn on the lights before sunset -![The automation editor.](/images/getting-started/automation-editor.png) +1. Go to {% my automations title="**Settings** > **Automations & scenes**" %} and in the lower right corner, select the **Create Automation** button. -Click the blue button at the bottom right to create a new automation. A dialog will appear. Choose **Create new automation**. You are presented with a blank automation screen. + ![The automation editor.](/images/getting-started/automation-editor.png) -![The start of a new automation.](/images/getting-started/new-automation.png) + - You are presented with a blank automation screen. -The first thing we will do is set a name. Enter "Turn Lights On at Sunset". + ![The start of a new automation.](/images/getting-started/new-automation.png) -The second step is defining what should {% term 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. +2. The first step is defining what should {% term trigger %} the automation to run. + - In this case, we want to use the event of the sun setting to trigger our automation. + - Select **Add trigger**, type `Sun` and select it. + ![Use the sun as trigger.](/images/getting-started/sun-trigger.png) +3. Select **Sunset**. + - We want the automation to be triggered a little before that, so let's add `-00:30` as the offset. This indicates that the automation will be triggered 30 minutes before sunset. Neat! -In the trigger section, click on the dropdown menu and change the trigger type to **Sun**. It allows us to choose sunrise or sunset, so 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 `-00:30` as the offset. This indicates that the automation will be triggered 30 minutes before the sun actually sets. Neat! + ![A new automation with a sun trigger filled in.](/images/getting-started/new-trigger.png) -![A new automation with a sun trigger filled in.](/images/getting-started/new-trigger.png) +4. Once we have defined our trigger, we need to define what should happen. + - Select **Add action**. + - Type `Ser` and select **Call service** +5. Select **Light** > **Turn on** or directly enter `light.turn_on`. + - For this automation, we're going to turn on all lights in the living room, so let's select the **Area**. + - This only works if your lights are assigned to an {% term area %}. -Once we have defined our trigger, scroll down to the action section. Make sure the action 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: + ![A new automation with the action set up to turn on the lights in the living room.](/images/getting-started/action.png) -```yaml -entity_id: all -``` - -![A new automation with the action set up to turn on the lights.](/images/getting-started/action.png) - -Click the orange button to save the automation. Now wait till it's 30 minutes until the sun sets and see your automation magic! +6. To save the automation, select **Save**, give the automation a name and **Save** again. + - Now wait till it's 30 minutes until the sun sets and see your automation magic! {% include getting-started/next_step.html step="Presence detection" link="/getting-started/presence-detection/" %} diff --git a/source/images/getting-started/action.png b/source/images/getting-started/action.png index 9dc4b11ddf4..1b60ff40515 100644 Binary files a/source/images/getting-started/action.png and b/source/images/getting-started/action.png differ diff --git a/source/images/getting-started/automation-editor.png b/source/images/getting-started/automation-editor.png index 21ab66254f8..42d96b12e29 100644 Binary files a/source/images/getting-started/automation-editor.png and b/source/images/getting-started/automation-editor.png differ diff --git a/source/images/getting-started/new-automation.png b/source/images/getting-started/new-automation.png index fd6e901be44..edb7f08acc1 100644 Binary files a/source/images/getting-started/new-automation.png and b/source/images/getting-started/new-automation.png differ diff --git a/source/images/getting-started/new-trigger.png b/source/images/getting-started/new-trigger.png index 6ca2801b6ef..70020113029 100644 Binary files a/source/images/getting-started/new-trigger.png and b/source/images/getting-started/new-trigger.png differ diff --git a/source/images/getting-started/sun-trigger.png b/source/images/getting-started/sun-trigger.png new file mode 100644 index 00000000000..20026f11221 Binary files /dev/null and b/source/images/getting-started/sun-trigger.png differ