diff --git a/source/_components/automation.markdown b/source/_components/automation.markdown index 99e2c26329d..3585196f9b0 100644 --- a/source/_components/automation.markdown +++ b/source/_components/automation.markdown @@ -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/ diff --git a/source/_components/binary_sensor.apcupsd.markdown b/source/_components/binary_sensor.apcupsd.markdown index 650786af19e..e2e1db42d4c 100644 --- a/source/_components/binary_sensor.apcupsd.markdown +++ b/source/_components/binary_sensor.apcupsd.markdown @@ -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 diff --git a/source/_components/dweet.markdown b/source/_components/dweet.markdown index 9b57782db83..37cf9a82e0c 100644 --- a/source/_components/dweet.markdown +++ b/source/_components/dweet.markdown @@ -9,7 +9,7 @@ sharing: true footer: true logo: dweet.png ha_category: "History" -featured: true +featured: false ha_release: 0.19 --- diff --git a/source/_components/light.markdown b/source/_components/light.markdown index c55e3473a7f..7d92ef67606 100644 --- a/source/_components/light.markdown +++ b/source/_components/light.markdown @@ -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. diff --git a/source/_components/light.rfxtrx.markdown b/source/_components/light.rfxtrx.markdown index 95dd54f172a..9218c91c971 100644 --- a/source/_components/light.rfxtrx.markdown +++ b/source/_components/light.rfxtrx.markdown @@ -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: diff --git a/source/_components/media_player.cast.markdown b/source/_components/media_player.cast.markdown index 0ce3920e4ec..2ffa7180414 100644 --- a/source/_components/media_player.cast.markdown +++ b/source/_components/media_player.cast.markdown @@ -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. diff --git a/source/_components/media_player.firetv.markdown b/source/_components/media_player.firetv.markdown index 9a5aca9937b..eead6cfc6dc 100644 --- a/source/_components/media_player.firetv.markdown +++ b/source/_components/media_player.firetv.markdown @@ -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'.

diff --git a/source/_components/media_player.itunes.markdown b/source/_components/media_player.itunes.markdown index 625a46a59ff..3b9b590d3e8 100644 --- a/source/_components/media_player.itunes.markdown +++ b/source/_components/media_player.itunes.markdown @@ -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. diff --git a/source/_components/media_player.kodi.markdown b/source/_components/media_player.kodi.markdown index 8861c04c1d4..9cd3a203358 100644 --- a/source/_components/media_player.kodi.markdown +++ b/source/_components/media_player.kodi.markdown @@ -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. diff --git a/source/_components/media_player.mpd.markdown b/source/_components/media_player.mpd.markdown index 449a5972500..b5d10aee92d 100644 --- a/source/_components/media_player.mpd.markdown +++ b/source/_components/media_player.mpd.markdown @@ -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/). diff --git a/source/_components/media_player.panasonic_viera.markdown b/source/_components/media_player.panasonic_viera.markdown index f9135c75fc2..8eceb7a2660 100644 --- a/source/_components/media_player.panasonic_viera.markdown +++ b/source/_components/media_player.panasonic_viera.markdown @@ -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. diff --git a/source/_components/media_player.pioneer.markdown b/source/_components/media_player.pioneer.markdown index 0d05f454731..e0a20c48c57 100644 --- a/source/_components/media_player.pioneer.markdown +++ b/source/_components/media_player.pioneer.markdown @@ -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. diff --git a/source/_components/media_player.samsungtv.markdown b/source/_components/media_player.samsungtv.markdown index 75cff8e9a34..87d3cd23c5c 100644 --- a/source/_components/media_player.samsungtv.markdown +++ b/source/_components/media_player.samsungtv.markdown @@ -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. diff --git a/source/_components/media_player.squeezebox.markdown b/source/_components/media_player.squeezebox.markdown index e819dba2bc6..faa59f84265 100644 --- a/source/_components/media_player.squeezebox.markdown +++ b/source/_components/media_player.squeezebox.markdown @@ -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. diff --git a/source/_components/media_player.webostv.markdown b/source/_components/media_player.webostv.markdown index 32e65807f16..69f8fa65547 100644 --- a/source/_components/media_player.webostv.markdown +++ b/source/_components/media_player.webostv.markdown @@ -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` diff --git a/source/_components/sensor.rfxtrx.markdown b/source/_components/sensor.rfxtrx.markdown index 294b1dc2369..8fa51cac38d 100644 --- a/source/_components/sensor.rfxtrx.markdown +++ b/source/_components/sensor.rfxtrx.markdown @@ -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: diff --git a/source/_components/switch.rfxtrx.markdown b/source/_components/switch.rfxtrx.markdown index ee66a922d78..f86f1b24f1b 100644 --- a/source/_components/switch.rfxtrx.markdown +++ b/source/_components/switch.rfxtrx.markdown @@ -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: diff --git a/source/_components/thermostat.zwave.markdown b/source/_components/thermostat.zwave.markdown index 3817564c5bd..6c4d7de9946 100644 --- a/source/_components/thermostat.zwave.markdown +++ b/source/_components/thermostat.zwave.markdown @@ -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. diff --git a/source/_components/zwave.markdown b/source/_components/zwave.markdown index 248e7d8d369..6b7291efeb8 100644 --- a/source/_components/zwave.markdown +++ b/source/_components/zwave.markdown @@ -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 ```

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```

@@ -89,7 +89,7 @@ $ ls /dev/ttyACM* ```

-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/).

#### {% linkable_title Events %} diff --git a/source/_cookbook/python_component_basic_service.markdown b/source/_cookbook/python_component_basic_service.markdown index e6f6bd6b367..5c53ecc1c99 100644 --- a/source/_cookbook/python_component_basic_service.markdown +++ b/source/_cookbook/python_component_basic_service.markdown @@ -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) diff --git a/source/_includes/asides/developers_navigation.html b/source/_includes/asides/developers_navigation.html index f797725eb8e..aec578230d7 100644 --- a/source/_includes/asides/developers_navigation.html +++ b/source/_includes/asides/developers_navigation.html @@ -46,6 +46,7 @@
  • {% active_link /developers/server_sent_events/ Server-sent events %}
  • +
  • {% active_link /developers/helpers/ Online helpers %}
  • {% active_link /developers/multiple_instances/ Multiple Instances %}
  • {% active_link /developers/website/ Home-Assistant.io %}
  • {% active_link /developers/credits/ Credits %}
  • diff --git a/source/_includes/asides/getting_started_navigation.html b/source/_includes/asides/getting_started_navigation.html index 21c7496446d..5e5590175ba 100644 --- a/source/_includes/asides/getting_started_navigation.html +++ b/source/_includes/asides/getting_started_navigation.html @@ -8,9 +8,10 @@ {% active_link /getting-started/ Installation %} @@ -44,9 +45,9 @@
  • {% active_link /getting-started/autostart/ Auto-start Home Assistant %}
  • diff --git a/source/_posts/2016-05-18-why-we-use-polymer.markdown b/source/_posts/2016-05-18-why-we-use-polymer.markdown new file mode 100644 index 00000000000..8f198665c19 --- /dev/null +++ b/source/_posts/2016-05-18-why-we-use-polymer.markdown @@ -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. + + + +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 + diff --git a/source/demo/frontend.html b/source/demo/frontend.html index e21fd545978..ae2bbc3ad41 100644 --- a/source/demo/frontend.html +++ b/source/demo/frontend.html @@ -1,8 +1,8 @@ \ No newline at end of file + clear: both;white-space:pre-wrap} \ No newline at end of file diff --git a/source/demo/index.html b/source/demo/index.html index 91730aeb6eb..f1a2be837a3 100644 --- a/source/demo/index.html +++ b/source/demo/index.html @@ -3,7 +3,7 @@ Home Assistant Demo - + >>>` +3. Add the modified file `git add ` 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) diff --git a/source/developers/helpers.markdown b/source/developers/helpers.markdown new file mode 100644 index 00000000000..78ec58c94e0 --- /dev/null +++ b/source/developers/helpers.markdown @@ -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) + diff --git a/source/getting-started/automation-condition.markdown b/source/getting-started/automation-condition.markdown index 8a712153168..89c18d3b271 100644 --- a/source/getting-started/automation-condition.markdown +++ b/source/getting-started/automation-condition.markdown @@ -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/ diff --git a/source/getting-started/autostart-systemd.markdown b/source/getting-started/autostart-systemd.markdown index a2fdeedfb14..0b63caa1b28 100644 --- a/source/getting-started/autostart-systemd.markdown +++ b/source/getting-started/autostart-systemd.markdown @@ -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= diff --git a/source/getting-started/installation-raspberry-pi-all-in-one.markdown b/source/getting-started/installation-raspberry-pi-all-in-one.markdown new file mode 100644 index 00000000000..1dca90855d5 --- /dev/null +++ b/source/getting-started/installation-raspberry-pi-all-in-one.markdown @@ -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) + diff --git a/source/getting-started/installation-virtualenv.markdown b/source/getting-started/installation-virtualenv.markdown index 2f4f5895cb5..c82aaa40194 100644 --- a/source/getting-started/installation-virtualenv.markdown +++ b/source/getting-started/installation-virtualenv.markdown @@ -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 diff --git a/source/getting-started/scripts-conditions.markdown b/source/getting-started/scripts-conditions.markdown index 3ee0d281bd2..10022a1c719 100644 --- a/source/getting-started/scripts-conditions.markdown +++ b/source/getting-started/scripts-conditions.markdown @@ -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.