Merge remote-tracking branch 'origin/current' into next

This commit is contained in:
Paulus Schoutsen 2017-11-16 22:15:30 -08:00
commit 5ab2ca280b
47 changed files with 469 additions and 157 deletions

View file

@ -62,6 +62,8 @@ automation old:
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.
For example, the below automation will be triggered when the sun goes from below the horizon to above the horizon. Then, if the temperature is between 17 and 25 degrees, a light will be turned on.
```yaml
# Example automations.yaml entry
- id: my_unique_id # <-- Required for editor to work.

View file

@ -63,7 +63,7 @@ homeassistant:
| `homebridge_hidden` | Set to `true` to hide the entity from `HomeBridge`.
| `emulated_hue_hidden` | Set to `true` to hide the entity from `emulated_hue`.
| `entity_picture` | Url to use as picture for entity.
| `icon` | Any icon from [MaterialDesignIcons.com](http://MaterialDesignIcons.com). Prefix name with `mdi:`, ie `mdi:home`.
| `icon` | Any icon from [MaterialDesignIcons.com](http://MaterialDesignIcons.com) ([Cheatsheet](https://materialdesignicons.com/cheatsheet)). Prefix name with `mdi:`, ie `mdi:home`.
| `assumed_state` | For switches with an assumed state two buttons are shown (turn off, turn on) instead of a switch. By setting `assumed_state` to `false` you will get the default switch icon.
| `device_class` | Sets the class of the device, changing the device state and icon that is displayed on the UI (see below).
| `initial_state` | Sets the initial state for automations. `on` or `off`.

View file

@ -15,6 +15,11 @@ redirect_from: /ecosystem/hass-configurator/
Since there currently is no nice way to edit the yaml-files Home Assistant is using through the frontend, here is a small webapp that hopefully makes the configuration easier. It is a customized and embedded [Ace editor](https://ace.c9.io/), which has syntax highlighting for yaml, the format used for Home Assistants configuration files. There is an integrated file browser to select whatever file you want to edit. When you're done with editing the file, click the save-button and it will replace the original.
Essentially this is a browser-based alternative to modifying your configuration through SSH, Windows + SMB, Github etc..
<p class='img'>
<img src='/images/hassio/screenshots/addon-hass-configurator.png'>
Screenshot of the HASS Configurator.
</p>
### {% linkable_title Feature list %}
- Web-Based editor to modify your files
@ -64,6 +69,10 @@ Limit access to the configurator by adding allowed IP addresses / networks to th
List of statically banned IP addresses, e.g. `BANNED_IPS = ["1.1.1.1", "2.2.2.2"]`
#### BANLIMIT (integer)
Ban IPs after `n` failed login attempts. Restart the service to reset banning. The default of `0` disables this feature. `CREDENTIALS` has to be set for this to work.
#### IGNORE_PATTERN (list)
Files and folders to ignore in the UI, e.g. `IGNORE_PATTERN = [".*", "*.log", "__pycache__"]`.
#### DIRSFIRST (bool)
If set to `True`, directories will be displayed at the top of the filebrowser.
#### GIT (bool)
Set this variable to `True` to enable Git integration. This feature requires [GitPython](https://gitpython.readthedocs.io)
to be installed on the system that is running the configurator. For technical reasons this feature can not be enabled with the static settings file.

View file

@ -10,6 +10,10 @@ footer: true
redirect_from: /getting-started/installation/
---
<p class='note'>
Beginners should check our [Getting started guide](/getting-started/) first. This is for users that require advanced installations.
</p>
Home Assistant provides multiple ways to be installed. A requirement is that you have [Python](https://www.python.org/downloads/) installed. For Windows, we require at least **Python 3.5** and for other operating systems at least **Python 3.4.2**.
<div class="text-center hass-option-cards" markdown="0">

View file

@ -72,6 +72,10 @@ Remark: to restart your Home Assistant within Synology NAS, you just have to do
* Go to the Docker-app and move to "Container"-section
* Right-click on it and select "Action"->"Restart".
<p class='note'>
If you want to use a USB Bluetooth adapter or Z-Wave USB Stick with Home Assistant on Synology Docker these instructions do not correctly configure the container to access the USB devices. To configure these devices on your Synology Docker Home Assistant you can follow the instructions provided [here](https://philhawthorne.com/installing-home-assistant-io-on-a-synology-diskstation-nas/) by Phil Hawthorne.
</p>
### {% linkable_title Restart %}
This will launch Home Assistant and serve the web interface from port 8123 on your Docker host.

View file

@ -22,7 +22,7 @@ Running these commands will:
- Install Home Assistant
- Launch Home Assistant and serve the web interface on [http://localhost:8123](http://localhost:8123)
If you're running a Linux-based platform, we suggest you follow the [VirtualEnv instructions](/docs/installation/virtualenv/) to avoid using `root`.
If you're running a Linux-based platform, we suggest you follow the instructions for a [virtual environment](/docs/installation/virtualenv/) to avoid using `root`.
Video tutorials of this process for various operating systems are available here:
@ -30,3 +30,4 @@ Video tutorials of this process for various operating systems are available here
- [macOS](https://www.youtube.com/watch?v=hej6ipN86ls)
- [Ubuntu 14.04](https://www.youtube.com/watch?v=SXaAG1lGNH0)
Keep in mind that the used operating systems and the shown software releases may be outdated.

View file

@ -14,7 +14,7 @@ It can happen that you run into trouble while installing Home Assistant. This pa
#### {% linkable_title pip3: command not found %}
This utility should have been installed as part of the Python 3.4 installation. Check if Python 3.4 is installed by running `python3 --version`. If it is not installed, [download it here](https://www.python.org/getit/).
This utility should have been installed as part of the Python installation. Check if Python is installed by running `python3 --version`. If it is not installed, [download it here](https://www.python.org/getit/).
If you are able to successfully run `python3 --version` but not `pip3`, install Home Assistant by running the following command instead:

View file

@ -1,7 +1,7 @@
---
layout: page
title: "Installation in virtualenv"
description: "Instructions how to install Home Assistant in a virtual environment."
title: "Installation in Python virtual environment"
description: "How to install Home Assistant in a Python virtual environment."
date: 2016-4-16 16:40
sidebar: true
comments: false
@ -9,12 +9,19 @@ sharing: true
footer: true
redirect_from: /getting-started/installation-virtualenv/
---
<p class='note'>
Beginners should check our [getting started guide](/getting-started/) first.
</p>
There are several reasons why it makes sense to run Home Assistant in a virtual environment. A [virtualenv](https://virtualenv.pypa.io/en/latest/) encapsulates all aspect of a Python environment within a single directory tree. That means the Python packages you install for Home Assistant won't interact with the rest of your system and vice-versa. It means a random upgrade for some other program on your computer won't break Home Assistant, and it means you don't need to install Python packages as root.
Virtualenvs are pretty easy to setup. This example will walk through one method of setting one up (there are certainly others). We'll be using Debian in this example (as many Home Assistant users are running Raspbian on a Raspberry Pi), but all of the Python related steps should be the same on just about any platform.
Virtualenvs are pretty easy to setup. We'll be using Debian in this example (as many Home Assistant users are running Raspbian on a Raspberry Pi), but all of the Python related steps should be the same on just about any platform.
### {% linkable_title Step 0: Install some dependencies %}
### {% linkable_title Basic guide %}
The basic guide is for testing Home Assistant. Also check the advanced guide for instances used in production.
## {% linkable_title Step 1: Install dependencies %}
```bash
$ sudo apt-get update
@ -23,33 +30,54 @@ $ sudo apt-get install python3-pip python3-dev
$ sudo pip3 install --upgrade virtualenv
```
### {% linkable_title Step 1: Create a Home Assistant user & group %}
## {% linkable_title Step 2: Setup virtualenv %}
This step is optional, but it's a good idea to give services like Home Assistant their own user. It gives you more granular control over permissions, and reduces the exposure to the rest of your system in the event there is a security related bug in Home Assistant. This is a reasonably Linux oriented step, and will look different on other operating systems (or even other Linux distributions).
```bash
$ python3 -m venv $HOME/homeassistant
```
## {% linkable_title Step 3: Install or update Home Assistant %}
```bash
$ source $HOME/homeassistant/bin/activate
(homeassistant)$ pip3 install --upgrade homeassistant
```
## {% linkable_title Step 4: Run Home Assistant %}
```bash
$ $HOME/homeassistant/bin/hass
```
### {% linkable_title Advanced guide %}
## {% linkable_title Separate user & group for Home Assistant (Basic guide step 2) %}
It's a good idea to give services like Home Assistant their own user. It gives you more granular control over permissions, and reduces the exposure to the rest of your system in the event there is a security related bug in Home Assistant. This is a reasonably Linux oriented step, and will look different on other operating systems (or even other Linux distributions).
```bash
$ sudo adduser --system homeassistant
$ sudo addgroup homeassistant
```
Home Assistant stores its configuration in `$HOME/.homeassistant` by default, so in this case, it would be in `/home/homeassistant/.homeassistant`
Home Assistant stores its configuration in `$HOME/.homeassistant` by default, so in this case, it would be in `/home/homeassistant/.homeassistant`.
If you plan to use a Z-Wave controller, you will need to add this user to the `dialout` group
If you plan to use a Z-Wave controller, you will need to add this user to the `dialout` group:
```bash
$ sudo usermod -G dialout -a homeassistant
```
### {% linkable_title Step 2: Create a directory for Home Assistant %}
## {% linkable_title Custom installation directory for Home Assistant (Basic guide step 2) %}
This can be anywhere you want. We chose to put it in `/srv`. You also need to change the ownership of the directory to the user you created above (if you created one).
This can be anywhere you want. We chose to put it in `/srv`. You also need to change the ownership of the directory to the user you created above.
```bash
$ sudo mkdir /srv/homeassistant
$ sudo chown homeassistant:homeassistant /srv/homeassistant
$ python3 -m venv /srv/homeassistant
```
### {% linkable_title Step 3: Become the new user %}
## {% linkable_title Install or update Home Assistant %}
This is obviously only necessary if you created a `homeassistant` user, but if you did, be sure to switch to that user whenever you install things in your virtualenv, otherwise you'll end up with mucked up permissions.
@ -59,37 +87,14 @@ $ sudo su -s /bin/bash homeassistant
The `su` command means 'switch' user. We use the '-s' flag because the `homeassistant` user is a system user and doesn't have a default shell by default (to prevent attackers from being able to log in as that user).
### {% linkable_title Step 4: Set up the virtualenv %}
All this step does is stick a Python environment in the directory we're using. That's it. It's just a directory. There's nothing special about it, and it is entirely self-contained.
It will include a `bin` directory, which will contain all the executables used in the virtualenv (including Home Assistant itself). It also includes a script called `activate` which we will use to activate the virtualenv.
```bash
$ virtualenv -p python3 /srv/homeassistant
```
### {% linkable_title Step 5: Activate the virtualenv %}
```bash
$ source /srv/homeassistant/bin/activate
```
After that, your prompt should include `(homeassistant)`.
### {% linkable_title Step 6: Install Home Assistant %}
Once your virtualenv has been activated, you don't need to `sudo` any of your `pip` commands. `pip` will be installing things in the virtualenv, which the `homeassistant` user has permission to modify.
```bash
(homeassistant)$ pip3 install --upgrade homeassistant
```
And that's it... you now have Home Assistant installed, and you can be sure that every bit of it is contained in `/srv/homeassistant`.
## {% linkable_title Run Home Assistant (Basic guide step 4) %}
### {% linkable_title Finally... Run Home Assistant %}
There are two ways to launch Home Assistant. If you are **in** the virtualenv, you can just run `hass` and it will work as normal. If the virtualenv is not activated, you just use the `hass` executable in the `bin` directory mentioned earlier. There is one caveat... Because Home Assistant stores its configuration in the user's home directory, we need to be the user `homeassistant` user or specify the configuration with `-c`.
There are two ways to launch Home Assistant. If you are **in** the virtualenv, you can just run `hass` and it will work as normal. If the virtualenv is not activated, you just use the `hass` executable in the `bin` directory mentioned earlier. There is one caveat... Because Home Assistant stores its configuration in the user's home directory, we need to be the user `homeassistant` or specify the configuration with `-c`.
```bash
$ sudo -u homeassistant -H /srv/homeassistant/bin/hass
@ -97,10 +102,6 @@ $ sudo -u homeassistant -H /srv/homeassistant/bin/hass
The `-H` flag is important. It sets the `$HOME` environment variable to `/home/homeassistant` so `hass` can find its configuration.
### {% linkable_title Upgrading Home Assistant %}
Upgrading Home Assistant is simple, just repeat steps 3, 5 and 6.
### {% linkable_title Starting Home Assistant on boot %}
## {% 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.

View file

@ -16,6 +16,7 @@ To add (include) a non-secure Z-Wave [device](/docs/z-wave/devices/) to your sys
1. Go to the [Z-Wave control panel](/docs/z-wave/control-panel/) in the Home Assistant frontend
2. Click the **Add Node** button in the *Z-Wave Network Management* card - this will place the controller in inclusion mode
3. Activate your device to be included by following the instructions provided with the device
4. With the device in its final location, run a *Heal*
Don't use this for [secure devices](https://home-assistant.io/docs/z-wave/adding/#adding-secure-devices), since this is likely to limit the features the device supports.
@ -56,3 +57,4 @@ To remove (exclude) a Z-Wave device from your system:
1. Go to the Z-Wave control panel in the Home Assistant frontend
2. Click the **Remove Node** button in the *Z-Wave Network Management* card - this will place the controller in exclusion mode
3. Activate your device to be excluded by following the instructions provided with the device
4. With the device in its final location, run a *Heal*

View file

@ -47,12 +47,20 @@ $ echo -e -n "\x01\x08\x00\xF2\x51\x01\x01\x05\x01\x50" > /dev/serial/by-id/usb-
### {% linkable_title Razberry Board %}
You need to disable the on-board Bluetooth since the board requires the use of the hardware UART (and there's only one on the Pi3). You do this by adding the following to the end of `/boot/config.txt`, then rebooting:
You need to disable the on-board Bluetooth since the board requires the use of the hardware UART (and there's only one on the Pi3). You do this by adding the following to the end of `/boot/config.txt`:
```
dtoverlay=pi3-disable-bt
```
Then disable the Bluetooth modem service:
```bash
$ sudo systemctl disable hciuart
```
Finally, reboot to make those changes active.
### {% linkable_title Aeon Minimote %}
Here's a handy configuration for the Aeon Labs Minimote that defines all possible button presses. Put it into `automation.yaml`.