Jay fa947627cd Update wording and provide new screenshots (#11180)
* Create trash

* Add files via upload

* Delete trash

* Update wording and screenshots

* Update screenshots and wording

Also improve clarity

* Revert improper references to Lovelace.

* "states screen" > "Home Assistant web interface"

* Delete automation-new-action.png

* Delete automation-new-blank.png

* Delete automation-new-name-trigger.png

* Delete integrations.png

* Create trash

* Add new screenshots

* Delete 01 - username.png

* Delete 02 - location.png

* Delete 03 - location.png

* Delete 04 - devices.png

* Delete 05 - lovelace.png

* Delete 06 - config.png

* Delete 07 - integrations.png

* Delete 08 - new integration.png

* Delete 09 - config 2.png

* Delete 10 - automation editor.png

* Delete 11 - new automation.png

* Delete 12 - new trigger.png

* Delete 13 - action.png

* Delete 14 - server control.png

* Delete trash

* Update screenshot paths

* Update onboarding.markdown

* Correct image paths

* Update automation.markdown

* Reword and provide additional information

This information was outdated, especially with the addition of default_config. Hopefully these changes make it clearer for new users who are confused about the missing homeassistant: line in their default configuration (this is something that has been popping up in the forum lately).

I linked to an external source for the time zone names. Perhaps we should add this list to Home Assistant website instead (or if it already exists, my apologies: I can point it to that instead).

* Update configuration.markdown
2019-12-12 17:21:44 +01:00

2.6 KiB

title description redirect_from
Automating Home Assistant A quick intro on getting your first automation going.
/getting-started/automation-create-first/
/getting-started/automation-2/

Once 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.

In the user interface, click Configuration in the sidebar, then click Automation. You will now see the automation screen from which you can manage all the automations in Home Assistant.

The automation editor.

Click the orange button at the bottom right to create a new automation. You are presented with a blank automation screen.

The start of a new automation.

The first thing we will do is 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 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.

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:

entity_id: all

A new automation with the action set up to turn on the lights.

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:

Next step: Presence detection »