mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-16 13:56:53 +00:00
Merge branch 'master' into next
This commit is contained in:
commit
0f14803a22
@ -11,6 +11,6 @@ logo: home-assistant.png
|
||||
ha_category: Automation
|
||||
---
|
||||
|
||||
Please see the [getting started section] for in-depth documentation on how to use the automation compnoent.
|
||||
Please see the [getting started section] for in-depth documentation on how to use the automation component.
|
||||
|
||||
[getting started section]: /getting-started/automation/
|
||||
|
@ -14,7 +14,7 @@ ha_release: 0.13
|
||||
|
||||
In addition to the [APCUPSd Sensor](/components/sensor.apcupsd/) devices, you may also create a device which is simply "on" when the UPS status is online and "off" at all other times.
|
||||
|
||||
To enable this sensor, add the following lines to your `configuration.yaml` file for a GET request:
|
||||
To enable this sensor, add the following lines to your `configuration.yaml` file:
|
||||
|
||||
```yaml
|
||||
# Example configuration.yaml entry
|
||||
|
@ -9,7 +9,7 @@ sharing: true
|
||||
footer: true
|
||||
logo: dweet.png
|
||||
ha_category: "History"
|
||||
featured: true
|
||||
featured: false
|
||||
ha_release: 0.19
|
||||
---
|
||||
|
||||
|
@ -49,7 +49,7 @@ Turns one or multiple lights off.
|
||||
| Service data attribute | Optional | Description |
|
||||
| ---------------------- | -------- | ----------- |
|
||||
| `entity_id` | no | String or list of strings that point at `entity_id`s of lights. Else targets all.
|
||||
| `transition` | no | Integer that represents the time the light should take to transition to the new state.
|
||||
| `transition` | yes | Integer that represents the time the light should take to transition to the new state.
|
||||
|
||||
### {% linkable_title Service `light.toggle` %}
|
||||
|
||||
@ -60,4 +60,4 @@ Toggles the state of one or multiple lights using [groups]({{site_root}}/compone
|
||||
| Service data attribute | Optional | Description |
|
||||
| ---------------------- | -------- | ----------- |
|
||||
| `entity_id` | no | String or list of strings that point at `entity_id`s of lights. Else targets all.
|
||||
| `transition` | no | Integer that represents the time the light should take to transition to the new state.
|
||||
| `transition` | yes | Integer that represents the time the light should take to transition to the new state.
|
||||
|
@ -31,6 +31,7 @@ Push your remote and your device should be added:
|
||||
|
||||
Here the name is 0b11000102ef9f210010f70 and you can verify that it works from the frontend.
|
||||
Then you should update your configuration to:
|
||||
|
||||
```yaml
|
||||
light:
|
||||
platform: rfxtrx
|
||||
@ -40,6 +41,7 @@ light:
|
||||
```
|
||||
|
||||
Example configuration:
|
||||
|
||||
```yaml
|
||||
# Example configuration.yaml entry
|
||||
light:
|
||||
|
@ -26,4 +26,4 @@ media_player:
|
||||
|
||||
Configuration variables:
|
||||
|
||||
- **host** *Optional*: Use only if you don't want to scan for devices.
|
||||
- **host** (*Optional*): Use only if you don't want to scan for devices.
|
||||
|
@ -45,9 +45,9 @@ media_player:
|
||||
|
||||
Configuration variables:
|
||||
|
||||
- **host** *Optional*: Where `firetv-server` is running. Default is *localhost:5556*.
|
||||
- **device** *Optional*: The device ID, default is *default*.
|
||||
- **name** *Optional*: The friendly name of the device, default is 'Amazon Fire TV'.
|
||||
- **host** (*Optional*): Where `firetv-server` is running. Default is *localhost:5556*.
|
||||
- **device** (*Optional*): The device ID, default is *default*.
|
||||
- **name** (*Optional*): The friendly name of the device, default is 'Amazon Fire TV'.
|
||||
|
||||
|
||||
<p class='note warning'>
|
||||
|
@ -30,5 +30,5 @@ media_player:
|
||||
|
||||
Configuration variables:
|
||||
|
||||
- **host** *Required*: The URL of the itunes-api API, eg. http://192.168.1.50
|
||||
- **port** *Optional*: The port where itunes-api is accessible, eg. 8181.
|
||||
- **host** (*Required*): The URL of the itunes-api API, eg. http://192.168.1.50
|
||||
- **port** (*Optional*): The port where itunes-api is accessible, eg. 8181.
|
||||
|
@ -31,8 +31,8 @@ media_player:
|
||||
|
||||
Configuration variables:
|
||||
|
||||
- **host** *Required*: The host name or address of the device that is running XBMC/Kodi
|
||||
- **port** *Required*: The port number, default 8080
|
||||
- **name** *Optional*: The name of the device used in the frontend.
|
||||
- **username** *Optional*: The XBMC/Kodi HTTP username.
|
||||
- **password** *Optional*: The XBMC/Kodi HTTP password.
|
||||
- **host** (*Required*): The host name or address of the device that is running XBMC/Kodi
|
||||
- **port** (*Required*): The port number, default 8080
|
||||
- **name** (*Optional*): The name of the device used in the frontend.
|
||||
- **username** (*Optional*): The XBMC/Kodi HTTP username.
|
||||
- **password** (*Optional*): The XBMC/Kodi HTTP password.
|
||||
|
@ -29,10 +29,10 @@ media_player:
|
||||
|
||||
Configuration variables:
|
||||
|
||||
- **server** *Required*: IP address of the Music Player Daemon, eg. 192.168.1.32
|
||||
- **port** *Optional*: Port of the Music Player Daemon, defaults to 6600.
|
||||
- **location** *Optional*: Location of your Music Player Daemon.
|
||||
- **password** *Optional*: Password for your Music Player Daemon.
|
||||
- **server** (*Required*): IP address of the Music Player Daemon, eg. 192.168.1.32
|
||||
- **port** (*Optional*): Port of the Music Player Daemon, defaults to 6600.
|
||||
- **location** (*Optional*): Location of your Music Player Daemon.
|
||||
- **password** (*Optional*): Password for your Music Player Daemon.
|
||||
|
||||
This platform works with [Music Player Daemon](http://www.musicpd.org/) and [mopidy](https://www.mopidy.com/) with [Mopidy-MPD](https://docs.mopidy.com/en/latest/ext/mpd/) as used by [Pi MusicBox](http://www.pimusicbox.com/).
|
||||
|
||||
|
@ -34,7 +34,7 @@ media_player:
|
||||
|
||||
Configuration variables:
|
||||
|
||||
- **host** *Required*: The IP of the Panasonic Viera TV, e.g. `192.168.0.10`
|
||||
- **port** *Optional*: The port of your Panasonic Viera TV. Defaults to `55000`
|
||||
- **name** *Optional*: The name you would like to give to the Panasonic Viera TV.
|
||||
- **host** (*Required*): The IP of the Panasonic Viera TV, e.g. `192.168.0.10`
|
||||
- **port** (*Optional*): The port of your Panasonic Viera TV. Defaults to `55000`
|
||||
- **name** (*Optional*): The name you would like to give to the Panasonic Viera TV.
|
||||
|
||||
|
@ -27,6 +27,6 @@ media_player:
|
||||
|
||||
Configuration variables:
|
||||
|
||||
- **host** *Required*: The IP of the Pioneer device, eg. `192.168.0.10`
|
||||
- **name** *Optional*: The name you would like to give to the receiver.
|
||||
- **host** (*Required*): The IP of the Pioneer device, eg. `192.168.0.10`
|
||||
- **name** (*Optional*): The name you would like to give to the receiver.
|
||||
|
||||
|
@ -29,8 +29,8 @@ media_player:
|
||||
|
||||
Configuration variables:
|
||||
|
||||
- **host** *Required*: The IP of the Samsung Smart TV, e.g. 192.168.0.10
|
||||
- **name** *Optional*: The name you would like to give to the Samsung Smart TV.
|
||||
- **host** (*Required*): The IP of the Samsung Smart TV, eg. 192.168.0.10
|
||||
- **name** (*Optional*): The name you would like to give to the Samsung Smart TV.
|
||||
|
||||
|
||||
Currently known supported models:
|
||||
@ -44,3 +44,5 @@ Currently known supported models:
|
||||
|
||||
If your model is not on the list then give it a test, if everything works correctly then add it to the list on [GitHub](https://github.com/home-assistant/home-assistant.io).
|
||||
The two letters at the beginning of the model number represent the region, UE is Europe, UN is North America and UA is Asia & Australia. The two numbers following that represent the screen size. If you add your model remember to remove these before adding them to the list.
|
||||
|
||||
There's currently a [known issue](https://github.com/home-assistant/home-assistant/issues/2098) with some TV's receiving a *Key press UP* that can interrupt certain applications.
|
||||
|
@ -30,7 +30,7 @@ media_player:
|
||||
|
||||
Configuration variables:
|
||||
|
||||
- **host** *Required*: The host name or address of the Logitech Media Server, eg. 192.168.1.21.
|
||||
- **port** *Optional*: Telnet port to Logitech Media Server, default 9090.
|
||||
- **username** *Optional*: The username, if password protection is enabled.
|
||||
- **password** *Optional*: The password, if password protection is enabled.
|
||||
- **host** (*Required*): The host name or address of the Logitech Media Server, eg. 192.168.1.21.
|
||||
- **port** (*Optional*): Telnet port to Logitech Media Server, default 9090.
|
||||
- **username** (*Optional*): The username, if password protection is enabled.
|
||||
- **password** (*Optional*): The password, if password protection is enabled.
|
||||
|
@ -13,11 +13,11 @@ ha_iot_class: "Local Poll"
|
||||
ha_release: 0.18
|
||||
---
|
||||
|
||||
The `webostv` platform allows you to control a LG WebOS Smart TV.
|
||||
The `webostv` platform allows you to control a [LG](http://www.lg.com) WebOS Smart TV.
|
||||
|
||||
When the TV is first connected, you will need to accept Home Assistant on the TV to allow communication.
|
||||
|
||||
To add a TV to your installation, add the following to your `configuration.yaml` file and follow the configurator instructions:
|
||||
To add a TV to your installation, add the following to your `configuration.yaml` file:
|
||||
|
||||
```yaml
|
||||
# Example configuration.yaml entry
|
||||
@ -29,7 +29,7 @@ media_player:
|
||||
|
||||
Configuration variables:
|
||||
|
||||
- **host** *Optional*: The IP of the LG WebOS Smart TV, e.g. 192.168.0.10
|
||||
- **name** *Optional*: The name you would like to give to the LG WebOS Smart TV.
|
||||
- **host** (*Optional*): The IP of the LG WebOS Smart TV, eg. 192.168.0.10
|
||||
- **name** (*Optional*): The name you would like to give to the LG WebOS Smart TV.
|
||||
|
||||
If you do not provide a host name, all LG WebOS Smart TV's within your network will be auto-discovered if your TV network name is set to `[LG] webOS TV`
|
||||
|
@ -14,6 +14,7 @@ The `rfxtrx` platform support sensors that communicate in the frequency range of
|
||||
|
||||
First you have to set up your [rfxtrx hub.](/components/rfxtrx/)
|
||||
The easiest way to find your sensors is to add this to your `configuration.yaml`:
|
||||
|
||||
```yaml
|
||||
sensor:
|
||||
platform: rfxtrx
|
||||
@ -28,6 +29,7 @@ Then when the sensor emits a signal it will be automatically added:
|
||||
|
||||
Here the name is 0a52080000301004d240259 and you can verify that it works from the frontend.
|
||||
Then you should update your configuration to:
|
||||
|
||||
```yaml
|
||||
sensor:
|
||||
platform: rfxtrx
|
||||
@ -52,6 +54,7 @@ sensor:
|
||||
|
||||
|
||||
Example configuration:
|
||||
|
||||
```yaml
|
||||
# Example configuration.yaml entry
|
||||
sensor:
|
||||
|
@ -31,6 +31,7 @@ Push your remote and your device should be added:
|
||||
|
||||
Here the name is 0b11000102ef9f210010f70 and you can verify that it works from the frontend.
|
||||
Then you should update your configuration to:
|
||||
|
||||
```yaml
|
||||
switch:
|
||||
platform: rfxtrx
|
||||
@ -40,6 +41,7 @@ switch:
|
||||
```
|
||||
|
||||
Example configuration:
|
||||
|
||||
```yaml
|
||||
# Example configuration.yaml entry
|
||||
switch:
|
||||
|
@ -13,3 +13,9 @@ ha_release: 0.17
|
||||
---
|
||||
|
||||
To get your Z-Wave thermostat working with Home Assistant, follow the instructions for the general [Z-Wave component](/components/zwave/).
|
||||
|
||||
## NOTE
|
||||
If your thermostat support fan modes or different operating modes, it should be considered a hvac component, and will also be detected as one. Thermostat component does not support setting fan or operation mode. This is controlled via the hvac component.
|
||||
|
||||
If the thermostat support different operationg modes, you will get one thermostat entity for each mode.
|
||||
These can be hidden with settings using the customize setting in the config file.
|
||||
|
@ -38,13 +38,13 @@ Then get the OpenZWave files and switch to the `python3` branch:
|
||||
$ git clone https://github.com/OpenZWave/python-openzwave.git
|
||||
$ cd python-openzwave
|
||||
$ git checkout python3
|
||||
$ PYTHON_EXEC=`which python3` make build
|
||||
$ sudo PYTHON_EXEC=`which python3` make install
|
||||
$ 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:
|
||||
|
||||
```$ sudo PYTHON_EXEC=`which python3` checkinstall --pkgname python-openzwave --pkgversion 1.0 --provides python-openzwave```
|
||||
```$ sudo PYTHON_EXEC=$(which python3) checkinstall --pkgname python-openzwave --pkgversion 1.0 --provides python-openzwave```
|
||||
|
||||
</p>
|
||||
|
||||
@ -89,7 +89,7 @@ $ ls /dev/ttyACM*
|
||||
```
|
||||
|
||||
<p class='note'>
|
||||
Depending on what's plugged into your USB ports, the name found above may change. You an 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 Events %}
|
||||
|
@ -28,7 +28,7 @@ def setup(hass, config):
|
||||
def handle_hello(call):
|
||||
name = call.data.get(ATTR_NAME, DEFAULT_NAME)
|
||||
|
||||
hass.states.set('hello.service.hello', name)
|
||||
hass.states.set('hello_service.hello', name)
|
||||
|
||||
hass.services.register(DOMAIN, 'hello', handle_hello)
|
||||
|
||||
|
@ -46,6 +46,7 @@
|
||||
<li>{% active_link /developers/server_sent_events/ Server-sent events %}</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>{% active_link /developers/helpers/ Online helpers %}</li>
|
||||
<li>{% active_link /developers/multiple_instances/ Multiple Instances %}</li>
|
||||
<li>{% active_link /developers/website/ Home-Assistant.io %}</li>
|
||||
<li>{% active_link /developers/credits/ Credits %}</li>
|
||||
|
@ -8,9 +8,10 @@
|
||||
{% active_link /getting-started/ Installation %}
|
||||
<ul>
|
||||
<li>{% active_link /getting-started/installation-raspberry-pi/ Raspberry Pi %}</li>
|
||||
<li>{% active_link /getting-started/installation-raspberry-pi-all-in-one/ Raspberry Pi All-In-One Installer %}</li>
|
||||
<li>{% active_link /getting-started/installation-docker/ Docker %}</li>
|
||||
<li>{% active_link /getting-started/installation-synology/ Synology NAS %}</li>
|
||||
<li>{% active_link /getting-started/installation-virtualenv/ VirtualEnv Linux Instructions %}</li>
|
||||
<li>{% active_link /getting-started/installation-virtualenv/ VirtualEnv Linux %}</li>
|
||||
<li>{% active_link /getting-started/troubleshooting/ Troubleshooting %}</li>
|
||||
</ul>
|
||||
</li>
|
||||
@ -44,9 +45,9 @@
|
||||
<li>
|
||||
{% active_link /getting-started/autostart/ Auto-start Home Assistant %}
|
||||
<ul>
|
||||
<li>{% active_link /getting-started/autostart-systemd/ Linux - SystemD %}</li>
|
||||
<li>{% active_link /getting-started/autostart-systemd/ Linux - systemd %}</li>
|
||||
<li>{% active_link /getting-started/autostart-upstart/ Linux - Upstart %}</li>
|
||||
<li>{% active_link /getting-started/autostart-macos/ macOS %}</li>
|
||||
<li>{% active_link /getting-started/autostart-macos/ OS X %}</li>
|
||||
<li>{% active_link /getting-started/autostart-synology/ Synology NAS %}</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
44
source/_posts/2016-05-18-why-we-use-polymer.markdown
Normal file
44
source/_posts/2016-05-18-why-we-use-polymer.markdown
Normal file
@ -0,0 +1,44 @@
|
||||
---
|
||||
layout: post
|
||||
title: "Why we use web components and Polymer"
|
||||
description: "In this blog post I talk about the reasoning to use web components and Polymer."
|
||||
date: 2016-05-18 00:09:00 +0000
|
||||
date_formatted: "May 18, 2016"
|
||||
author: Paulus Schoutsen
|
||||
author_twitter: balloob
|
||||
comments: true
|
||||
categories: Technology
|
||||
---
|
||||
|
||||
I've been planning to write this post for a while now as we get questions like this a lot: _"Why does Home Assistant use Polymer? Why not React, Redux and what not?"_
|
||||
|
||||
It's understandable, Polymer is quite the underdog in the world of web frameworks. A corporate backer does not guarantee popularity or an active community and this shows in the number of projects using Polymer.
|
||||
|
||||
Still, [we use Polymer and it's awesome][demo]. To explain why, I'll be referencing the React workflow quite a bit, as they do a lot of things right, and show how it is done in Polymer.
|
||||
|
||||
Polymer gives us components for the web, just like React, but based on web standards: [web components], [CSS variables]. These standards don't have wide browser support yet but it's being implemented by every major browser: It's the future. For now they are being polyfilled and that works just fine but in the future the Home Assistant web app will be able to run native in the browsers == fast.
|
||||
|
||||
<!--more-->
|
||||
|
||||
Polymer does not have the nice developer experience that one can have with React and the [React Dev Tools] but that's a matter of time. The developer tools in every browser have seen a lot of improvements recently and each improvement helps support for web components.
|
||||
|
||||
Another major benefit of Polymer for Home Assistant is that we get [material design for free]. The material design components that come with Polymer have a very high quality. Google is using these components themselves and make sure that performance and accessibility using screen readers/keyboards are great. As an open source project, the more we can outsource, the better - so our contributors can focus on the core product: home automation.
|
||||
|
||||
What about Flux, data management and interaction between components? It's actually pretty similar to React or any other component based framework. Flux-like architectures work with Polymer just like with React: whenever data changes it will update the attributes of a component which will propagate to the children. For Home Assistant we use [NuclearJS] with our [own Polymer bindings]. For data moving from child to parent the Polymer pattern is using DOM events instead of callbacks but the end result is the same. It is so similar in fact, that it took me only two hours to make a [React Native frontend for on top of our core][ha-rn].
|
||||
|
||||
So what about Babel and ES2015? Also this is covered. Each web component exists of a HTML template and a JavaScript class to back it. Think of the HTML template as the render method in React. In Home Assistant we have the HTML templates import one another and have a separate chain for the JavaScript classes backing each component. This allows us to use Babel and NPM modules for the JavaScript part ([more info here][tools-js]). This does however come with the downside of other JS based frameworks: the browser blocks any painting while the JavaScript is being parsed instead of upgrading the website incrementally. This, however, is something we take for granted right now and hope that module bundlers will be able to solve this for us eventually. Tree shaking is a very promising improvement in this space.
|
||||
|
||||
Most of this blog post has been comparing Polymer to React. In many ways Polymer is similar to React but it is not as far evolved yet. I like React but I do not see it as a technology that will be around forever. Given the trend of previous popular JS frameworks, React will probably get replaced by another framework that works even better. Web components however will be here forever as they are part of the HTML standard. And this gives us peace of mind at the virtual Home Assistant headquarters: we do not have to be afraid of having to rewrite our frontend just to stay relevant or because people don't want to include another dependency just to run this legacy piece.
|
||||
|
||||
So there it is, the reason why we use Polymer.
|
||||
|
||||
[web components]: https://www.w3.org/standards/techs/components#w3c_all
|
||||
[CSS variables]: https://www.w3.org/TR/css-variables/
|
||||
[React Dev Tools]: https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en
|
||||
[NuclearJS]: https://optimizely.github.io/nuclear-js/
|
||||
[own Polymer bindings]: http://paulusschoutsen.nl/blog/2015/07/using-polymer-with-flux-and-a-global-app-state/
|
||||
[ha-rn]: https://github.com/balloob/home-assistant-react-native-ios
|
||||
[tools-js]: https://github.com/home-assistant/home-assistant-polymer#building-the-app
|
||||
[material design for free]: https://elements.polymer-project.org/browse?package=paper-elements
|
||||
[demo]: https://home-assistant.io/demo
|
||||
|
File diff suppressed because one or more lines are too long
@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Home Assistant Demo</title>
|
||||
|
||||
<meta name="description" content="Open-source home automation platform running on Python 3 and Polymer.">
|
||||
<link rel='manifest' href='/demo/manifest.json' />
|
||||
<link rel='shortcut icon' href='/demo/favicon.ico' />
|
||||
<link rel='icon' type='image/png'
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 51 KiB |
@ -22,7 +22,7 @@ Home Assistant is open-source and MIT licensed. The source can be found here:
|
||||
You will need to set up a development environment if you want to start developing a new feature or component for Home Assistant. Please follow these steps to get setup.
|
||||
Visit the [the Home Assistant repository](https://github.com/home-assistant/home-assistant) first and click fork in the top right.
|
||||
|
||||
We suggest that you setup a [virtual environment](https://docs.python.org/3.4/library/venv.html) aka `venv` before running the setup script.
|
||||
We suggest that you setup a virtual environment using [`venv`](https://docs.python.org/3.4/library/venv.html) before running the setup script.
|
||||
|
||||
```bash
|
||||
$ git clone https://github.com/YOUR_GIT_USERNAME/home-assistant.git
|
||||
@ -30,6 +30,9 @@ $ cd home-assistant
|
||||
$ git remote add upstream https://github.com/home-assistant/home-assistant.git
|
||||
$ script/setup
|
||||
```
|
||||
On Windows you can use `python setup.py develop` instead of the setup script.
|
||||
|
||||
After following these steps, running `hass` will invoke your local installation.
|
||||
|
||||
### {% linkable_title Testing your work %}
|
||||
|
||||
@ -39,8 +42,6 @@ Testing your work requires `tox` to be installed:
|
||||
$ pip3 install tox
|
||||
```
|
||||
|
||||
After following these steps, running `hass` will invoke your local installation.
|
||||
|
||||
### {% linkable_title Prevent Linter Errors %}
|
||||
|
||||
Home Assistant enforces strict [PEP8 style](https://www.python.org/dev/peps/pep-0008/) compliance on all code submitted. You can save yourself the hassle of extra commits just to fix style errors by enabling the flake8 git commit hook. It will check your code when you attempt to commit to the repo. It will block the commit if there are any style issues, giving you a chance to fix it.
|
||||
@ -78,10 +79,13 @@ $ git fetch upstream dev # to pull the latest changes into a local dev branch
|
||||
$ git rebase upstream/dev # to put those changes into your feature branch before your changes
|
||||
```
|
||||
|
||||
### {% linkable_title Squashing your commits %}
|
||||
|
||||
Your feature is done, it looks great and the tests are all passing. What now? Squash your commits, and create a pull request. Squashing your commits makes for a more readable git commit history. It's an interactive process that is best explained by Matt Stauffer in [this video](https://www.youtube.com/watch?v=7IfkL8swmFw).
|
||||
If rebase detects conflicts, you can repeat the following process until all changes have been resolved:
|
||||
|
||||
1. `git status` will show you the file with the conflict.
|
||||
2. Edit the file and resolving the lines between `<<<< | >>>>`
|
||||
3. Add the modified file `git add <file>` or `git add .`
|
||||
4. Continue rebase `git rebase --continue`
|
||||
5. Repeat until you've resolved all conflicts.
|
||||
|
||||
### {% linkable_title Further reading %}
|
||||
|
||||
@ -92,3 +96,4 @@ Your feature is done, it looks great and the tests are all passing. What now? Sq
|
||||
- [Rest API](/developers/api/)
|
||||
- [Server-sent events](/developers/server_sent_events/)
|
||||
- [Website](/developers/website/)
|
||||
- [Home Assitant on Github - CONTRIBUTING.md](https://github.com/home-assistant/home-assistant/blob/dev/CONTRIBUTING.md)
|
||||
|
18
source/developers/helpers.markdown
Normal file
18
source/developers/helpers.markdown
Normal file
@ -0,0 +1,18 @@
|
||||
---
|
||||
layout: page
|
||||
title: "Little online helpers"
|
||||
description: "The little helpers for the development of Home Assistant."
|
||||
date: 2016-05-17 16:00
|
||||
sidebar: true
|
||||
comments: false
|
||||
sharing: true
|
||||
footer: true
|
||||
---
|
||||
|
||||
There are a bunch of online services which can help you if you are developing for Home Assistant or maintaining platforms/components. Some are directly connected to Pull Requests and the repositories itself, others are only publishing details and updates in our [gitter.im](https://gitter.im/home-assistant/home-assistant/devs) chatroom.
|
||||
|
||||
- [Coveralls](https://coveralls.io/github/home-assistant/home-assistant)
|
||||
- [Travis CI](https://travis-ci.org/home-assistant/home-assistant)
|
||||
- [gemnasium](https://gemnasium.com/github.com/home-assistant/home-assistant)
|
||||
- [Pivotal Tracker](https://www.pivotaltracker.com/n/projects/1250084)
|
||||
|
@ -20,4 +20,24 @@ automation:
|
||||
|
||||
The available conditions for an automation are the same as for the script syntax. So see that page for a [full list of available conditions][script-condition].
|
||||
|
||||
Example of using condition:
|
||||
|
||||
```yaml
|
||||
- alias: 'Enciende Despacho'
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: sensor.mini_despacho
|
||||
to: 'ON'
|
||||
condition:
|
||||
condition: or
|
||||
conditions:
|
||||
- condition: template
|
||||
value_template: '{{ states.sun.sun.attributes.elevation < 4 }}'
|
||||
- condition: template
|
||||
value_template: '{{ states.sensor.sensorluz_7_0.state < 10 }}'
|
||||
action:
|
||||
- service: scene.turn_on
|
||||
entity_id: scene.DespiertaDespacho
|
||||
```
|
||||
|
||||
[script-condition]: /getting-started/scripts-conditions/
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
layout: page
|
||||
title: "Autostart using SystemD"
|
||||
description: "Instructions how to setup Home Assistant to launch on boot using SystemD."
|
||||
title: "Autostart using systemd"
|
||||
description: "Instructions how to setup Home Assistant to launch on boot using systemd."
|
||||
date: 2015-9-1 22:57
|
||||
sidebar: true
|
||||
comments: false
|
||||
@ -9,7 +9,7 @@ sharing: true
|
||||
footer: true
|
||||
---
|
||||
|
||||
Newer linux distributions are trending towards using systemd for managing daemons. Typically, systems based on Fedora or Debian 8 or later use systemd. This includes Ubuntu releases including and after 15.04, CentOS, and Red Hat. If you are unsure if your system is using `systemd`, you may check with the following command:
|
||||
Newer linux distributions are trending towards using `systemd` for managing daemons. Typically, systems based on Fedora, ArchLinux, or Debian (8 or later) use `systemd`. This includes Ubuntu releases including and after 15.04, CentOS, and Red Hat. If you are unsure if your system is using `systemd`, you may check with the following command:
|
||||
|
||||
```bash
|
||||
$ ps -p 1 -o comm=
|
||||
|
@ -0,0 +1,47 @@
|
||||
---
|
||||
layout: page
|
||||
title: "Raspberry Pi All-In-One Installer"
|
||||
date: 2016-05-12 01:39
|
||||
comments: true
|
||||
sharing: true
|
||||
footer: true
|
||||
---
|
||||
|
||||
The "[Raspberry Pi All-In-One Installer](https://github.com/home-assistant/fabric-home-assistant)" deploys a complete Home Assistant server including support for MQTT with websocket support, Z-Wave, and the Open-Zwave-Control-Panel.
|
||||
|
||||
Requirements before installation:
|
||||
|
||||
* You have a Raspberry Pi with a fresh installation of [Raspbian Jessie/Jessie Lite](https://www.raspberrypi.org/downloads/raspbian/) connected to your network.
|
||||
* You are able to SSH into your Raspberry Pi.
|
||||
|
||||
|
||||
Installation instructions:
|
||||
|
||||
1. SSH into your Raspberry Pi
|
||||
2. Run `wget -Nnv https://raw.githubusercontent.com/home-assistant/fabric-home-assistant/master/hass_rpi_installer.sh && bash hass_rpi_installer.sh;`
|
||||
3. Installation will take approx 1-2 hour's depending on the model of Raspberry Pi the installer is being run against.
|
||||
|
||||
|
||||
Once rebooted, your Raspberry Pi will be up and running with Home Assistant. You can access it at **http://your_raspberry_pi_ip:8123**.
|
||||
|
||||
The Home Assistant configuration is located at `/home/hass`. The virtualenv with the Home Assistant installation is located at `/srv/hass/hass_venv`. As part of the secure installation, a new user is added to your Raspberry Pi to run Home Assistant as named, "hass". This is a system account and does not have login or other abilities by design. When editing your configuration.yaml files, you will need to run the commands as "Sudo" or switching users. Setting up WinSCP to allow this seemlessly is detailed below.
|
||||
|
||||
By default, installation makes use of a Python Virtualenv. If you wish to not follow this recommendation, you may add the flag `-n` to the end of the install command specified above.
|
||||
|
||||
The All-In-One installer script will do the following automatically:
|
||||
|
||||
* Create all needed directories
|
||||
* Create needed service accounts
|
||||
* Install OS and Python dependencies
|
||||
* Setup a python virtualenv to run Home Assistant and components inside.
|
||||
* Run as `hass` service account
|
||||
* Install Home Assistant in a virtualenv
|
||||
* Build and install Mosquitto from source with websocket support running on ports 1883 and 9001
|
||||
* Build and Install Python-openzwave in the Home Assistant virtualenv
|
||||
* Build openzwave-control-panel in `/srv/hass/src/open-zwave-control-panel`
|
||||
* Add both Home Assistant and Mosquitto to systemd services to start at boot
|
||||
|
||||
|
||||
|
||||
Windows Users - Please note that after running the installer, you will need to modify a couple settings allowing you to "switch users" to edit your configuration files. The needed change within WinSCP can be seen here: [Imgur](http://i.imgur.com/tlOljo6.jpg)
|
||||
|
@ -9,105 +9,104 @@ sharing: true
|
||||
footer: true
|
||||
---
|
||||
|
||||
There are several reasons why it makes sense to run Home Assistant in a virtualenv. A virtualenv 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 HA, and it means you don't need to install a bunch of Python packages as root.
|
||||
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 Assitant, 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 HA 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. 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.
|
||||
|
||||
## Step 0: Install some dependencies
|
||||
## {% linkable_title Step 0: Install some dependencies %}
|
||||
|
||||
```bash
|
||||
sudo apt-get update
|
||||
sudo apt-get upgrade
|
||||
sudo apt-get install python-pip
|
||||
sudo pip install --upgrade virtualenv
|
||||
$ sudo apt-get update
|
||||
$ sudo apt-get upgrade
|
||||
$ sudo apt-get install python-pip python3-dev
|
||||
$ sudo pip install --upgrade virtualenv
|
||||
```
|
||||
|
||||
## Step 1: Create a Home Assistant user
|
||||
## {% linkable_title Step 1: Create a Home Assistant user %}
|
||||
|
||||
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 HA. This is a reasonably Linux oriented step, and will look different on other OS's (or even other Linux distros).
|
||||
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
|
||||
sudo adduser --system hass
|
||||
$ sudo adduser --system hass
|
||||
```
|
||||
|
||||
Home Assistant stores its config in `$HOME/.homeassistant` by default, so in this case, it would be in `/home/hass/.homeassistant`
|
||||
Home Assistant stores its configuration in `$HOME/.homeassistant` by default, so in this case, it would be in `/home/hass/.homeassistant`
|
||||
|
||||
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 hass
|
||||
$ sudo usermod -G dialout -a hass
|
||||
```
|
||||
|
||||
## Step 2: Create a directory for Home Assistant
|
||||
## {% linkable_title Step 2: Create a directory for Home Assistant %}
|
||||
|
||||
This can be anywhere you want, but I generally put stuff related to servers 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. AS example we put it in `/srv`. You also need to change the ownership of the directory to the user you created above (if you created one).
|
||||
|
||||
```bash
|
||||
sudo mkdir /srv/hass
|
||||
sudo chown hass /srv/hass
|
||||
$ sudo mkdir /srv/hass
|
||||
$ sudo chown hass /srv/hass
|
||||
```
|
||||
## {% linkable_title Step 3: Become the new user %}
|
||||
|
||||
## Step 3: Become the new user
|
||||
|
||||
This is obviously only necessary if you created a 'hass' 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.
|
||||
This is obviously only necessary if you created a `hass` 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.
|
||||
|
||||
```bash
|
||||
sudo su -s /bin/bash hass
|
||||
$ sudo su -s /bin/bash hass
|
||||
```
|
||||
|
||||
The 'su' command means 'switch' user. We use the '-s' flag because the hass 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).
|
||||
The `su` command means 'switch' user. We use the '-s' flag because the `hass` 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).
|
||||
|
||||
## Step 4: Set up the virtualenv
|
||||
## {% 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 hass itself). It also includes a script called 'activate' which we will use to activate the virtualenv.
|
||||
It will include a `bin` directory, which will contain all the executables used in the virtualenv (including hass itself). It also includes a script called `activate` which we will use to activate the virtualenv.
|
||||
|
||||
```bash
|
||||
virtualenv -p python3 /srv/hass
|
||||
$ virtualenv -p python3 /srv/hass
|
||||
```
|
||||
|
||||
## Step 5: Activate the virtualenv
|
||||
## {% linkable_title Step 5: Activate the virtualenv %}
|
||||
|
||||
```bash
|
||||
source /srv/hass/bin/activate
|
||||
$ source /srv/hass/bin/activate
|
||||
```
|
||||
|
||||
After that, your prompt should include '(hass)'.
|
||||
After that, your prompt should include `(hass)`.
|
||||
|
||||
## Step 6: Install Home Assistant
|
||||
## {% 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 our 'hass' user has permission to modify.
|
||||
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 `hass` user has permission to modify.
|
||||
|
||||
```bash
|
||||
(hass)pip3 install --upgrade homeassistant
|
||||
(hass)$ 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/hass
|
||||
And that's it... you now have Home Assistant installed, and you can be sure that every bit of it is contained in `/srv/hass`.
|
||||
|
||||
## Finally... Run Home Assistant
|
||||
## {% 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 that bin directory I mentioned earlier. There is one caveat... Because Home Assistant stores it's config in the user's home directory, we need to be the hass user.
|
||||
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 it's configuration in the user's home directory, we need to be the user `hass` user or specify the configuration with `-c`.
|
||||
|
||||
```bash
|
||||
sudo -u hass -H /srv/hass/bin/hass
|
||||
$ sudo -u hass -H /srv/hass/bin/hass
|
||||
```
|
||||
|
||||
The '-H' flag is important. It sets the `$HOME` environment variable to `/home/hass` so hass can find its configs.
|
||||
The `-H` flag is important. It sets the `$HOME` environment variable to `/home/hass` so `hass` can find its configuration.
|
||||
|
||||
## Upgrading Home Assistant
|
||||
## {% linkable_title Upgrading Home Assistant %}
|
||||
|
||||
Upgrading HA is simple, just repeat steps 3, 5 and 6.
|
||||
Upgrading Home Assistant is simple, just repeat steps 3, 5 and 6.
|
||||
|
||||
## Starting Home Assistant on boot
|
||||
## {% linkable_title Starting Home Assistant on boot %}
|
||||
|
||||
The autostart instructions on home-assistant.io will work just fine, just be sure to replace `/usr/bin/hass` with `/srv/hass/bin/hass` and specify the 'hass' user where appropriate.
|
||||
The [autostart instructions](/getting-started/autostart/) will work just fine, just be sure to replace `/usr/bin/hass` with `/srv/hass/bin/hass` and specify the `hass` user where appropriate.
|
||||
|
||||
## Installing python-openzwave
|
||||
## {% linkable_title Installing python-openzwave %}
|
||||
|
||||
If you want to use Z Wave devices, you'll need to install python-openzwave in your virtualenv. This requires a small tweak to the instructions on home-assistant.io
|
||||
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 on home-assistant.io
|
||||
|
||||
Install the dependencies as normal (note: you'll need to do this as your normal user, since 'hass' isn't a sudoer).
|
||||
Install the dependencies as normal (Note: you will need to do this as your normal user, since `hass` isn't a sudoer).
|
||||
|
||||
```bash
|
||||
$ sudo apt-get install cython3 libudev-dev python3-sphinx python3-setuptools
|
||||
@ -119,7 +118,7 @@ Then, activate your virtualenv (steps 3 and 5 above) and upgrade cython.
|
||||
(hass)$ pip3 install --upgrade cython
|
||||
```
|
||||
|
||||
Finally, get and install python-openzwave
|
||||
Finally, get and install `python-openzwave`.
|
||||
|
||||
```bash
|
||||
(hass)$ mkdir /srv/hass/src
|
||||
|
@ -26,6 +26,42 @@ conditions:
|
||||
below: '20'
|
||||
```
|
||||
|
||||
#### {% linkable_title OR condition %}
|
||||
|
||||
Test multiple conditions in 1 condition statement. Passes if any embedded conditions is valid.
|
||||
|
||||
```yaml
|
||||
condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: 'device_tracker.paulus'
|
||||
state: 'home'
|
||||
- condition: numeric_state
|
||||
entity_id: 'sensor.temperature'
|
||||
below: '20'
|
||||
```
|
||||
|
||||
#### {% linkable_title MIXED AND and OR conditions %}
|
||||
|
||||
Test multiple AND and OR conditions in 1 condition statement. Passes if any embedded conditions is valid.
|
||||
This allows you to mix several AND and OR conditions together.
|
||||
|
||||
```yaml
|
||||
condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: 'device_tracker.paulus'
|
||||
state: 'home'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: sensor.weather_precip
|
||||
state: 'rain'
|
||||
- condition: numeric_state
|
||||
entity_id: 'sensor.temperature'
|
||||
below: '20'
|
||||
```
|
||||
|
||||
#### {% linkable_title Numeric state condition %}
|
||||
|
||||
This type of condition attempts to parse the state of specified entity as a number and triggers if the value matches all of the above or below thresholds.
|
||||
@ -43,21 +79,6 @@ below: 25
|
||||
value_template: {{ float(state.state) + 2 }}
|
||||
```
|
||||
|
||||
#### {% linkable_title OR condition %}
|
||||
|
||||
Test multiple conditions in 1 condition statement. Passes if any embedded conditions is valid.
|
||||
|
||||
```yaml
|
||||
condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: 'device_tracker.paulus'
|
||||
state: 'home'
|
||||
- condition: numeric_state
|
||||
entity_id: 'sensor.temperature'
|
||||
below: '20'
|
||||
```
|
||||
|
||||
#### {% linkable_title State condition %}
|
||||
|
||||
Tests if an entity is a specified state.
|
||||
|
Loading…
x
Reference in New Issue
Block a user