Skip to content

Commit

Permalink
Simplify getting started (home-assistant#9258)
Browse files Browse the repository at this point in the history
* Simplify getting started

* Update automation.markdown

* Update automation.markdown

* Updates

* Tweak
  • Loading branch information
balloob authored Apr 21, 2019
1 parent 7d4d6bc commit 7c7b9bd
Show file tree
Hide file tree
Showing 13 changed files with 166 additions and 259 deletions.
12 changes: 6 additions & 6 deletions source/_includes/asides/getting_started_navigation.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
{% include edit_github.html %}

<div class='section'>
<h1 class="title delta">Getting Started Guide</h1>
<h1 class="title delta">Getting Started</h1>
<ul class='divided sidebar-menu'>
<li>{% active_link /getting-started/ Installation %}
<li>{% active_link /getting-started/configuration/ Configuration %}</li>
<li>{% active_link /getting-started/automation/ Automation %}</li>
<li>{% active_link /getting-started/automation-2/ Automation 2 %}</li>
<li>{% active_link /getting-started/presence-detection/ Presence detection %}</li>
<li>{% active_link /getting-started/use/ Use it! %}</li>
<li>{% active_link /getting-started/onboarding/ Onboarding %}</li>
<li>{% active_link /getting-started/automation/ Automation %}</li>
<li>{% active_link /getting-started/presence-detection/ Presence detection %}</li>
<li>{% active_link /getting-started/join-the-community/ Join the community %}</li>
<li>{% active_link /getting-started/configuration/ Advanced Configuration %}</li>
</ul>
</div>
</section>
108 changes: 0 additions & 108 deletions source/getting-started/automation-2.markdown

This file was deleted.

57 changes: 39 additions & 18 deletions source/getting-started/automation.markdown
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 &raquo;](/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 &raquo;](/getting-started/presence-detection/)
90 changes: 24 additions & 66 deletions source/getting-started/configuration.markdown
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: page
title: "Configure Home Assistant"
title: "Advanced Configuration"
description: "Instructions to get Home Assistant configured."
date: 2016-09-26 21:00
sidebar: true
Expand All @@ -9,85 +9,43 @@ sharing: true
footer: true
---

<p class='Note'>
This guide applies only if you've installed Home Assistant via Hass.io. If you've used any other install method then [see here](/docs/configuration/) instead.
</p>

If you made it here, awesome! That means that you got Home Assistant up and running. It might have already found some of your networked devices. This is going to be fun!

Home Assistant stores its configuration in a file called `configuration.yaml`. A default one is created when Home Assistant is started for the first time. Some of the things in the configuration file can be edited via the user interface, other parts require you to edit the configuration file directly.

There are two common approaches to edit your configuration: via Samba/Windows Networking and via the HASS Configurator. Both of these are [official add-ons for Hass.io](/addons/).

## {% linkable_title Installing Hass.io add-ons %}

Hass.io add-ons are installed from the add-on store embedded in the Hass.io panel:
Until now we have been able to configure Home Assistant purely via the user interface. However, not all options are accessible via the user interface. The other options are accessible via the Home Assistant configuration file called `configuration.yaml`. A default one is created when Home Assistant started for the first time.

- Open Home Assistant by navigating to [http://hassio.local:8123][local].
- Click on the menu icon in the top left and select Hass.io in the sidebar.
- The Hass.io panel opens, now open the add-on store by clicking the shopping bag.
<p class='note'>
This final step of the getting started only applies if you've installed Home Assistant via Hass.io. If you've used another installation method, [see here](/docs/configuration/).
</p>

[local]: http://hassio.local:8123
We are going to help you make your first changes to `configuration.yaml`. To do this, we are going to install an add-on from the Hass.io add-on store: the HASS Configurator. To get to the add-on store, click on the menu icon in the top left, then click on Hass.io. On the new page, open the add-on store tab.

<p class='img'>
<img src='/images/hassio/screenshots/main_panel_addon_store.png' />
From the Hass.io main panel open the add-on store.
From the Hass.io main panel, open the add-on store.
</p>

### {% linkable_title Editing config via HASS Configurator %}

The first add-on we should install is the HASS Configurator. With the HASS Configurator, you'll be able to edit your Home Assistant configuration from the web interface.

Go to the add-on store (see the previous step), click on Configurator and click on "INSTALL". When installation is complete, the UI will go to the add-on details page for the configurator. Here you will be able to change settings, start and stop the add-on. Follow the steps below to setup the add-on.
Under the "Core" section you will find HASS Configurator.

- "START" the add-on
- You will be able to click the "OPEN WEB UI" link to open the Web UI on a new window
- Type your username and password that you recently saved
- Click on Configurator and click on INSTALL. When installation is complete, the UI will go to the add-on details page for the configurator.
- Now start the add-on by clicking on START.
- Open the user interface by clcking on OPEN WEB UI.

Time for the first practice with the configurator. We're going to add the Configurator to the main Home Assistant sidebar:
Now let's make a small change using the configurator: we are going to change the name and location of your Home Assistant installation.

- Click the folder icon in the top left of the configurator window to open the file browser sidebar.
- Click the folder icon in the top left of the configurator window to open the file browser sidebar.
- Click the `configuration.yaml` file (in the `/config/` folder) to load it into the main Configurator edit window.
- Copy and paste the following to the end of the `configuration.yaml` file:

```yaml
panel_custom:
- name: hassio-main
sidebar_title: Configurator
sidebar_icon: hass:settings
js_url: /api/hassio/app/entrypoint.js
url_path: configurator
embed_iframe: true
require_admin: true
config:
ingress: core_configurator
```
- Find the `homeassistant:` configuration block, which should be the first thing in `configuration.yaml`. In this block, update `name`, `latitude`, `longitude`, `unit_system` and `time_zone` to match yours.
- Click the save icon in the top right to commit changes.
- Verify the configuration by going to the config panel (Configuration in the sidebar) -> General -> Click the "Check Config" button and you should get "Configuration valid!"
- Now Restart Home Assistant using the "restart" in the Server management section.
- Most changes in `configuration.yaml` require Home Assistant to be restarted to see the changes. You can verify that your changes are acceptable by running a config check. Do this by clicking on Configuration in the sidebar, click on General and click on the "Check Config" button. When it's valid, it will show the text "Configuration valid!".
- Now Restart Home Assistant using the "restart" in the Server management section on the same page.

### {% linkable_title Editing config via Samba/Windows Networking %}
Maybe you are not a big fan of our web editor and want to use a text editor on your computer instead. This is possible by sharing the configuration over the network using the Samba add-on, which can be installed from the Hass.io add-on store.
After you have installed it, click on START. Hass.io should now be available in the networking tab on your computer. Use a text editor like the free [Visual Studio Code](https://code.visualstudio.com/) to edit `configuration.yaml`.

## {% linkable_title Configuring integrations %}

Now that you are able to edit the configuration, it's time to set up some of your devices and services. Each service and device will have its own instructions on how to be integrated. Find your devices and services on the [components overview page](/components/).

<p class='note'>YAML can be a little daunting at first. A lot is possible! [Here is some more info.](/docs/configuration/devices/)</p>

For your first integration, you'll create a virtual sensor that generates a random integer value between 0 and 20 every 30 seconds.
<p class='img'>
<img src='/images/screenshots/configuration-validation.png' />
Screenshot of the "General" page in the configuration panel.
</p>

To create this random value sensor [random values](/components/sensor.random/), enter the following to the bottom of your `configuration.yaml` file, and restart Home Assistant (remember it may take up to a minute for the service to restart):
### {% linkable_title Editing config via Samba/Windows Networking %}

```yaml
sensor:
- platform: random
```
Maybe you are not a big fan of our web editor and want to use a text editor on your computer instead. This is possible by sharing the configuration over the network using the Samba add-on, which can also be installed from the Hass.io add-on store. This will make your configuration accessible via the network tab on your computer.

You'll know it worked when you see the new random sensor in your overview page. On the next page, we'll create an automation that uses this sensor to take an action.
Go to the add-on store and look for Samba in the core section. After you have installed the add-on, click on START. Hass.io should now be available in the networking tab on your computer.

### [Next step: Automate Home Assistant &raquo;](/getting-started/automation/)
We suggest that to edit `configuration.yaml`, you use the free text editor [Visual Studio Code](https://code.visualstudio.com/) in combination with the [Home Assistant Config Helper extension](https://marketplace.visualstudio.com/items?itemName=keesschollaart.vscode-home-assistant).
Loading

0 comments on commit 7c7b9bd

Please sign in to comment.