diff --git a/source/getting-started/automation.markdown b/source/getting-started/automation.markdown index eed565a8bc8..2b8c5a96eca 100644 --- a/source/getting-started/automation.markdown +++ b/source/getting-started/automation.markdown @@ -5,15 +5,27 @@ 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 %}. -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. +We're going to create two automations: One, to turn on the lights when the sun sets. And a second one to dim the light at a certain time in the evening before a workday. -## Automatically turn on the lights before sunset +## Turning on the lights before sunset -1. Go to {% my automations title="**Settings** > **Automations & scenes**" %} and in the lower right corner, select the **Create Automation** button. +### Prerequisites + +This tutorial assumes the following: + +- You have [installed Home Assistant](/installation/) +- You have completed the [onboarding steps](/getting-started/onboarding/) +- You have followed the steps on [adding an integration](/getting-started/integration/) +- You have a light that is integrated into Home Assistant + - If you don't have a light yet, and are unsure what to buy, try [Philips Hue](/integrations/hue/), [nanoleaf](/integrations/nanoleaf/), or products supporting [WLED](/integrations/wled/) + +### To automatically turn on the lights before sunset + +1. Go to {% my automations title="**Settings** > **Automations & scenes**" %} and select **Create Automation**. ![The automation editor.](/images/getting-started/automation-editor.png) - - You are presented with a blank automation screen. + - Then, select **Create new automation**. This brings up an empty automation page. ![The start of a new automation.](/images/getting-started/new-automation.png) @@ -28,14 +40,67 @@ We're going to create a simple automation to turn on the lights when the sun set 4. Once we have defined our trigger, we need to define what should happen. - Select **Add action**. -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 under **Targets**, select the **Area**. +5. Type `light` and select **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 %}. + - To learn more about grouping devices in areas, refer to the [area documentation](/docs/organizing/areas/). ![A new automation with the action set up to turn on the lights in the living room.](/images/getting-started/action.png) -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! +6. To save the automation, select **Save**. Give the automation a name and **Save** again. + - Now wait until it's 30 minutes before sunset and see your automation magic! + - Or follow these steps to [test your automation](/docs/automation/troubleshooting/#testing-your-automation) right away. + +## Dimming the lights the night before a workday + +This automation dims the light at a specific time before a workday. + +### Prerequisites + +This tutorial assumes the following: + +- You have [installed Home Assistant](/installation/) +- You have completed the [onboarding steps](/getting-started/onboarding/) +- You have followed the steps on [adding an integration](/getting-started/integration/) +- You have a dimmable light that is integrated into Home Assistant + +### To dim the light the night before a workday + +1. Go to {% my automations title="**Settings** > **Automations & scenes**" %} and select **Create automation**. + + ![The automation editor.](/images/getting-started/automation-editor.png) + + - Then, select **Create new automation**. This brings up an empty automation page. + + ![The start of a new automation.](/images/getting-started/new-automation.png) + +2. We want the light to start dimming at 21:45. This means we want an automation that is triggered by time. + - Select **Add trigger** > **Time and location** > **Time**. + - Select **Fixed time** and enter the time. + + ![A new automation with a fixed time trigger filled in.](/images/getting-started/automation_trigger_fixed_time.png) + +3. We want to do this only if tomorrow is a workday. + - Select **Add condition** > **Entity** > **State**. + - Under **Entity**, enter `workd` and select your workday sensor. + - Under **State**, select **On**. +4. Next, we want to make sure the light is only dimmed when it is actually on. No reason to do this if the light is not on. + - To achieve this, we use an **If-then** action. Select **Add action** > **Building blocks** > **If-then**. + - You now get a block called **Conditionally execute an action**. From the **Entity** list, select your light. + - Under **If**, select **Add condition** > **Entity** > **State**. + - Under **State**, select **On**. + + ![Screenshot showing the if section of an if-then action](/images/getting-started/automation_if-then-action_if.png) + +5. Now we want to define the action that is performed when the condition is true (when the light was on). + - Under **Then**, select **Add action** > **Light turn on**. + - Under **Entity**, select your light. + - Define the light settings, such as brightness, temperature, or color. The available settings depend on your light. + + ![Screenshot showing the then section of an if-then action](/images/getting-started/automation_if-then-action_then.png) + +6. To save the automation, select **Save**. Give the automation a name and **Save** again. +7. [Test your automation](/docs/automation/troubleshooting/#testing-your-automation). {% 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 1b60ff40515..29b8339a2d0 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_if-then-action_if.png b/source/images/getting-started/automation_if-then-action_if.png new file mode 100644 index 00000000000..21dc3a7dba6 Binary files /dev/null and b/source/images/getting-started/automation_if-then-action_if.png differ diff --git a/source/images/getting-started/automation_if-then-action_then.png b/source/images/getting-started/automation_if-then-action_then.png new file mode 100644 index 00000000000..43d8f8a58fb Binary files /dev/null and b/source/images/getting-started/automation_if-then-action_then.png differ diff --git a/source/images/getting-started/automation_trigger_fixed_time.png b/source/images/getting-started/automation_trigger_fixed_time.png new file mode 100644 index 00000000000..e8bccc75d3e Binary files /dev/null and b/source/images/getting-started/automation_trigger_fixed_time.png differ