commit
b497fc4882
62 changed files with 2088 additions and 117 deletions
89
source/_docs/automation/editor.markdown
Normal file
89
source/_docs/automation/editor.markdown
Normal file
|
@ -0,0 +1,89 @@
|
|||
---
|
||||
layout: page
|
||||
title: "Automation Editor"
|
||||
description: "Instructions on how to use the new automation editor."
|
||||
date: 2016-04-24 08:30 +0100
|
||||
sidebar: true
|
||||
comments: false
|
||||
sharing: true
|
||||
footer: true
|
||||
---
|
||||
|
||||
In Home Assistant 0.45 we have introduced the first version of our automation editor. The editor is still in a very early stage and rough around the edges. For now we are only supporting Chrome but better browser support is planned for the future.
|
||||
|
||||
If you just created a new configuration with Home Assistant then you're all set! Go to the UI and enjoy.
|
||||
|
||||
From the UI choose **Automation** which is located in the sidebar. Press the **+** sign in the lower right corner to get started. This example is based on the manual steps described in the [Getting started section](/getting-started/automation/) for a [`random` sensor](/components/sensor.random/).
|
||||
|
||||
Choose a meaningful name for your automation rules.
|
||||
|
||||
<p class='img'>
|
||||
<img src='{{site_root}}/images/docs/automation-editor/new-automation.png' />
|
||||
</p>
|
||||
|
||||
If the value of the is greater than 10 then the automation rule should apply.
|
||||
|
||||
<p class='img'>
|
||||
<img src='{{site_root}}/images/docs/automation-editor/new-trigger.png' />
|
||||
</p>
|
||||
|
||||
Firing a [persistent notification](/components/persistent_notification/) is the result.
|
||||
|
||||
<p class='img'>
|
||||
<img src='{{site_root}}/images/docs/automation-editor/new-action.png' />
|
||||
</p>
|
||||
|
||||
As "Service Data" we want a simple text that is shown as part of the notification.
|
||||
|
||||
```json
|
||||
{
|
||||
"message": "Sensor value greater than 10"
|
||||
}
|
||||
```
|
||||
|
||||
Don't forget to save your new automation rule.
|
||||
|
||||
## {% linkable_title Updating your configuration to use the editor %}
|
||||
|
||||
The automation editor reads and writes to the file `automations.yaml` in your [configuration](/docs/configuration/) folder. Make sure that you have set up the automation component to read from it:
|
||||
|
||||
```yaml
|
||||
# Configuration.yaml example
|
||||
automation: !include automations.yaml
|
||||
```
|
||||
|
||||
If you still want to use your old automation section, add a label to the old entry:
|
||||
|
||||
```yaml
|
||||
automation old:
|
||||
- trigger:
|
||||
platform: ...
|
||||
```
|
||||
|
||||
## {% linkable_title Migrating your automations to `automations.yaml` %}
|
||||
|
||||
If you want to migrate your old automations to use the editor, you'll have to copy them to `automations.yaml`. Make sure that `automations.yaml` remains a list! For each automation that you copy over you'll have to add an `id`. This can be any string as long as it's unique.
|
||||
|
||||
```yaml
|
||||
# Example automations.yaml entry
|
||||
- id: my_unique_id # <-- Required for editor to work.
|
||||
alias: Hello world
|
||||
trigger:
|
||||
- entity_id: sun.sun
|
||||
from: below_horizon
|
||||
platform: state
|
||||
to: above_horizon
|
||||
condition:
|
||||
- above: 17
|
||||
below: 25
|
||||
condition: numeric_state
|
||||
entity_id: sensor.temperature
|
||||
value_template: '{% raw %}{{ float(state.state) + 2 }}{% endraw %}'
|
||||
action:
|
||||
- service: light.turn_on
|
||||
```
|
||||
|
||||
<p class='note'>
|
||||
Any comments in the YAML file will be lost when you update an automation via the editor.
|
||||
</p>
|
||||
|
|
@ -104,30 +104,3 @@ Upgrading Home Assistant is simple, just repeat steps 3, 5 and 6.
|
|||
### {% linkable_title Starting Home Assistant on boot %}
|
||||
|
||||
The [autostart instructions](/getting-started/autostart/) will work just fine, just be sure to replace `/usr/bin/hass` with `/srv/homeassistant/bin/hass` and specify the `homeassistant` user where appropriate.
|
||||
|
||||
### {% linkable_title Installing python-openzwave in a virtualenv %}
|
||||
|
||||
If you want to use Z-Wave devices, you will need to install `python-openzwave` in your virtualenv. This requires a small tweak to the instructions in [the Z-Wave Getting Started documentation](/getting-started/z-wave/)
|
||||
|
||||
Install the dependencies as normal (Note: you will need to do this as your normal user, since `homeassistant` isn't a sudoer).
|
||||
|
||||
```bash
|
||||
$ sudo apt-get install cython3 libudev-dev python3-sphinx python3-setuptools git
|
||||
```
|
||||
|
||||
Then, activate your virtualenv (steps 3 and 5 above) and upgrade cython.
|
||||
|
||||
```bash
|
||||
(homeassistant)$ pip3 install --upgrade cython==0.24.1
|
||||
```
|
||||
|
||||
Finally, get and install `python-openzwave`.
|
||||
|
||||
```bash
|
||||
(homeassistant)$ mkdir /srv/homeassistant/src
|
||||
(homeassistant)$ cd /srv/homeassistant/src
|
||||
(homeassistant)$ git clone https://github.com/OpenZWave/python-openzwave.git
|
||||
(homeassistant)$ cd python-openzwave
|
||||
(homeassistant)$ PYTHON_EXEC=`which python3` make build
|
||||
(homeassistant)$ PYTHON_EXEC=`which python3` make install
|
||||
```
|
||||
|
|
|
@ -14,56 +14,14 @@ redirect_from: /getting-started/z-wave/
|
|||
|
||||
There is currently support for climate, covers, lights, locks, sensors, switches and thermostats. All will be picked up automatically after configuring this platform.
|
||||
|
||||
### {% linkable_title Installation in Virtualenv (python-OpenZWave) %}
|
||||
|
||||
If you installed Home Assistant using a virtual environment then please read the instructions on [Installing python-OpenZWave in a virtualenv](https://home-assistant.io/docs/installation/virtualenv/#installing-python-openzwave-in-a-virtualenv).
|
||||
|
||||
### {% linkable_title Installation %}
|
||||
|
||||
To allow Home Assistant to talk to your Z-Wave USB stick you will have to compile the OpenZWave library and install the related [python-OpenZWave package](https://github.com/OpenZWave/python-openzwave). This can be done as follows. _(Note: The Home Assistant docker image and the All In One installer have support for Z-Wave already built-in!)_
|
||||
As of version 0.45, Home Assistant automatically installs python-openzwave from PyPI as needed.
|
||||
|
||||
Make sure you have the correct dependencies installed before running the script:
|
||||
There is one dependency you will need to have installed ahead of time:
|
||||
|
||||
```bash
|
||||
$ sudo apt-get install cython3 libudev-dev python3-sphinx python3-setuptools git
|
||||
```
|
||||
|
||||
Make sure you have at least version 0.23 and at the most 0.24.1 of cython.
|
||||
|
||||
```bash
|
||||
$ sudo pip3 install --upgrade cython==0.24.1
|
||||
```
|
||||
|
||||
Then get the OpenZWave files:
|
||||
|
||||
<p class='note warning'>Do not use root to build python-openzwave as it will surely fail.</p>
|
||||
|
||||
```bash
|
||||
$ git clone https://github.com/OpenZWave/python-openzwave.git
|
||||
$ cd python-openzwave
|
||||
$ PYTHON_EXEC=$(which python3) make build
|
||||
$ sudo PYTHON_EXEC=$(which python3) make install
|
||||
```
|
||||
|
||||
<p class='note'>
|
||||
Instead of `make install`, you can alternatively build your own python-openzwave package which can be easily uninstalled:
|
||||
</p>
|
||||
|
||||
```bash
|
||||
$ sudo apt-get install -y checkinstall
|
||||
$ sudo PYTHON_EXEC=$(which python3) checkinstall --pkgname python-openzwave --pkgversion 1.0 --provides python-openzwave
|
||||
```
|
||||
|
||||
With this installation, your `config_path` needed below will resemble:
|
||||
|
||||
```bash
|
||||
/usr/local/lib/python3.4/dist-packages/libopenzwave-0.3.0b8-py3.4-linux-x86_64.egg/config
|
||||
```
|
||||
|
||||
If you followed along with setting up a virtual environment, your path will be:
|
||||
|
||||
```bash
|
||||
/srv/homeassistant/src/python-openzwave/openzwave/config
|
||||
$ sudo apt-get install libudev-dev
|
||||
```
|
||||
|
||||
### {% linkable_title Configuration %}
|
||||
|
@ -77,7 +35,7 @@ zwave:
|
|||
Configuration variables:
|
||||
|
||||
- **usb_path** (*Optional*): The port where your device is connected to your Home Assistant host.
|
||||
- **config_path** (*Optional*): The path to the Python OpenZWave configuration files. Defaults to the folder `config` in your Python OpenZWave install directory.
|
||||
- **config_path** (*Optional*): The path to the Python OpenZWave configuration files. Defaults to the 'config' that is installed by python-openzwave
|
||||
- **autoheal** (*Optional*): Allows disabling auto Z-Wave heal at midnight. Defaults to True.
|
||||
- **polling_interval** (*Optional*): The time period in milliseconds between polls of a nodes value. Be careful about using polling values below 30000 (30 seconds) as polling can flood the zwave network and cause problems.
|
||||
- **device_config** (*Optional*): This attribute contains node-specific override values. (For releases prior to 0.39 this variable is called **customize**) See [Customizing devices and services](https://home-assistant.io/getting-started/customizing-devices/) for format:
|
||||
|
@ -116,12 +74,12 @@ $ ls /dev/cu.usbmodem*
|
|||
```
|
||||
|
||||
<p class='note'>
|
||||
Depending on what's plugged into your USB ports, the name found above may change. You can lock in a name, such as `/dev/zwave`, by following [these instructions](http://hintshop.ludvig.co.nz/show/persistent-names-usb-serial-devices/).
|
||||
Depending on what's plugged into your USB ports, the name found above may change. You can lock in a name, such as `/dev/zwave`, by following [these instructions](http://hintshop.ludvig.co.nz/show/persistent-names-usb-serial-devices/).
|
||||
</p>
|
||||
|
||||
### {% linkable_title Adding Devices %}
|
||||
|
||||
To add a Z-Wave device to your system, go to the Services menu and select the `zwave` domain, and select the `add-node` service. Then find your device's add button and press that as well.
|
||||
To add a Z-Wave device to your system, go to the Services menu and select the `zwave` domain, and select the `add-node` service. Then find your device's add button and press that as well.
|
||||
|
||||
### {% linkable_title Adding Security Devices %}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue