diff --git a/_deploy b/_deploy index 5a20d28e543..cb366470d97 160000 --- a/_deploy +++ b/_deploy @@ -1 +1 @@ -Subproject commit 5a20d28e54328a61b0719eccbffe13cebf59752c +Subproject commit cb366470d97306fd188ce184cbb81e2ea2292fcf diff --git a/sass/custom/_paulus.scss b/sass/custom/_paulus.scss index a1f761d3932..43eaa3bf8b1 100644 --- a/sass/custom/_paulus.scss +++ b/sass/custom/_paulus.scss @@ -34,8 +34,9 @@ border: none !important; box-shadow: none !important; max-height: 50px; - max-width: 200px; + max-width: 140px; margin: 10px; + vertical-align: middle; } } @@ -102,7 +103,7 @@ h6:hover a.title-link { article.post, article.page, article.listing { img, table { border-radius: 3px; - box-shadow: rgba(0,0,0,0.06) 0 0 10px; + box-shadow: rgba(0,0,0,0.06) 0 0 10px; } img.no-shadow { @@ -120,7 +121,7 @@ article.post, article.page, article.listing { text-align: center; padding-bottom: 3px; font-size: .9rem; - box-shadow: rgba(0,0,0,0.06) 0 0 10px; + box-shadow: rgba(0,0,0,0.06) 0 0 10px; img { display: block; @@ -171,7 +172,7 @@ p.note { &.warning { background-color: #F7F9E1; - + &::before { background-color: rgb(187, 185, 13);; content: "\f071" " Warning " attr(data-title); @@ -217,17 +218,18 @@ p.note { } } -.prep-instructions-container { - #generic-prep, #fedora-prep, #centos-prep, .prep-instructions { +.advanced-installs-container { + + #upstart-install, #systemd-install, #osx-install, .advanced-installs { display: none; } label.menu-selector { display: inline-block; text-align: center; - padding: 10px; + padding: 20px; white-space: nowrap; - border-bottom: 2px solid $grayLight; + border-bottom: 5px solid $grayLight; transition: border-bottom-color .5s; } @@ -235,60 +237,21 @@ p.note { margin-left: 10px; } - #generic-prep:checked ~ .menu-selector.generic, - #fedora-prep:checked ~ .menu-selector.fedora, - #centos-prep:checked ~ .menu-selector.centos + #upstart-install:checked ~ .menu-selector.upstart, + #systemd-install:checked ~ .menu-selector.systemd, + #osx-install:checked ~ .menu-selector.osx { border-bottom-color: $blue; } - #generic-prep:checked ~ .prep-instructions.generic, - #fedora-prep:checked ~ .prep-instructions.fedora, - #centos-prep:checked ~ .prep-instructions.centos + #upstart-install:checked ~ .advanced-installs.upstart, + #systemd-install:checked ~ .advanced-installs.systemd, + #osx-install:checked ~ .advanced-installs.osx { display: block; } - .prep-instructions { - margin-top: 20px; + .advanced-installs { + margin-top: 30px; } } - -.post-instructions-container { - #generic-post, #fedora-post, #debian-post, .post-instructions { - display: none; - } - - label.menu-selector { - display: inline-block; - text-align: center; - padding: 10px; - white-space: nowrap; - border-bottom: 2px solid $grayLight; - transition: border-bottom-color .5s; - } - - label.menu-selector + label.menu-selector { - margin-left: 10px; - } - - #generic-post:checked ~ .menu-selector.generic-post, - #fedora-post:checked ~ .menu-selector.fedora-post, - #debian-post:checked ~ .menu-selector.debian-post - { - border-bottom-color: $blue; - } - - #generic-post:checked ~ .post-instructions.generic-post, - #fedora-post:checked ~ .post-instructions.fedora-post, - #debian-post:checked ~ .post-instructions.debian-post - { - display: block; - } - - .post-instructions { - margin-top: 20px; - } - -} - diff --git a/source/_includes/custom/grid_item_left.html b/source/_includes/custom/grid_item_left.html index c1a498fb418..afc9cca654f 100644 --- a/source/_includes/custom/grid_item_left.html +++ b/source/_includes/custom/grid_item_left.html @@ -2,19 +2,48 @@

Home Assistant will track the state of all the devices in your home, so you don't have to.

- - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Browse all »

diff --git a/source/_includes/custom/navigation.html b/source/_includes/custom/navigation.html index 06d049a284e..29109f91d69 100644 --- a/source/_includes/custom/navigation.html +++ b/source/_includes/custom/navigation.html @@ -3,9 +3,10 @@ Getting started
  • diff --git a/source/_includes/site/head.html b/source/_includes/site/head.html index c216696b7dd..63ab4f5f8c8 100644 --- a/source/_includes/site/head.html +++ b/source/_includes/site/head.html @@ -15,7 +15,7 @@ {% if page.keywords %}{% endif %} - + {% if site.social.facebook.app_id %} diff --git a/source/_posts/2015-09-11-different-ways-to-use-mqtt-with-home-assistant.markdown b/source/_posts/2015-09-11-different-ways-to-use-mqtt-with-home-assistant.markdown new file mode 100644 index 00000000000..d08787fcc20 --- /dev/null +++ b/source/_posts/2015-09-11-different-ways-to-use-mqtt-with-home-assistant.markdown @@ -0,0 +1,201 @@ +--- +layout: post +title: "Using MQTT with Home Assistant" +description: "This post describes three different ways to use MQTT with Home Assistant." +date: 2015-09-11 11:19:38 +0200 +date_formatted: "September 11, 2015" +author: Fabian Affolter +comments: true +categories: how-to +og_image: /images/blog/2015-09-mqtt/arduino.png +--- + + +The [MQTT](https://en.wikipedia.org/wiki/MQTT) support was added to Home Assistant recently. The [MQTT component](https://home-assistant.io/components/mqtt.html) will enable you to do all sort of things. Most likely you will use it to communicate with your devices. But Home Assistant doesn't care where the data is coming from or is limited to real hardware as long as there is MQTT support. This means that it doesn't matter if the data is coming from a human, a web service, or a device. + +A great example is shown in a [Laundry Automation](https://home-assistant.io/blog/2015/08/26/laundry-automation-with-moteino-mqtt-and-home-assistant/) post in this blog. + +This post will give you a small overview of some other possibilities on how to use MQTT with Home Assistant. + + +### {% linkable_title Manual usage %} + +The simplest but not the coolest way as a human to interact with a Home Assistant sensor is launching a command manually. Let's create a "Mood" sensor. For simplicity Home Assistant and the MQTT broker are both running on the same host. The needed configuration snipplets to add to the `configuration.yaml` file consists of two parts: one for the broker and one for the sensor. + +```yaml +mqtt: + broker: 127.0.0.1 + +sensor: + - platform: mqtt + name: "Fabian's Mood" + state_topic: "home-assistant/fabian/mood" +``` + +After a restart of Home Assistant the "Mood" sensor will show up in the frontend. For more details about the configuration of MQTT itself and the sensor, please refer to the [MQTT component](https://home-assistant.io/components/mqtt.html) or the [MQTT sensor](https://home-assistant.io/components/sensor.mqtt.html) documentation. + +Now we can set the mood. The commandline tool (`mosquitto_pub`) which is shipped with `mosquitto` is used to send an MQTT message. + +```bash +mosquitto_pub -h 127.0.0.1 -t "home-assistant/fabian/mood" -m "bad" +``` + +

    + + The Mood sensor +

    + +This is a really bad example. Don't do this in the real world because you won't be able to create diagrams of historical data. Better use a numerical value. + +### {% linkable_title Python MQTT bindings %} + +The last section was pretty boring, I know. Nobody wants to send MQTT messages by hand if there is a computer on the desk. If you are playing the lottery this section is for you. If not, read it anyway because the lottery is just an example :-). + +This example is using the [Paho MQTT Python binding](https://eclipse.org/paho/clients/python/) because those binding should be available on the host where Home Assistant is running. If you want to use this example on another machine, please make sure that the bindings are installed (`pip3 install paho-mqtt`). + +The first step is to add an additional MQTT sensor to the `configuration.yaml` file. The sensor will be called "Lottery" and the unit of measurement will be "No.". + +```yaml + - platform: mqtt + name: "Lottery" + state_topic: "home-assistant/lottery/number" + unit_of_measurement: "No." +``` + +Don't forget to restart Home Assistant to make the configuration active. + +To play, we need numbers from 1 to 49 which can be marked on the ticket. Those numbers should be random and displayed in the Home Assistant frontend. The Python script below is another simple example on how to send MQTT messages from the commandline; this time in a loop. For further information and examples please check the [Paho MQTT](https://eclipse.org/paho/clients/python/docs/) documentation. + +```python +#!/usr/bin/python3 +# +import time +import random +import paho.mqtt.client as mqtt +import paho.mqtt.publish as publish + +broker = '127.0.0.1' +state_topic = 'home-assistant/lottery/number' +delay = 5 + +# Send a single message to set the mood +publish.single('home-assistant/fabian/mood', 'good', hostname=broker) + +# Send messages in a loop +client = mqtt.Client("ha-client") +client.connect(broker) +client.loop_start() + +while True: + client.publish(state_topic, random.randrange(0, 50, 1)) + time.sleep(delay) +``` + +Every 5 seconds a message with a new number is sent to the broker and picked up by Home Assistant. By the way, my mood is much better now. + +

    + + The Lottery sensor +

    + +With only a few lines of Python and an MQTT broker you can create your own "smartdevice" or send information to Home Assistant which you haven't think of. Of course this is not limited to Python. If there is an MQTT library available, the device can be used with Home Assistant now. + +### {% linkable_title Arduino %} + +To get started with real hardware that is capable to send MQTT messages, the Arduino platform is an inexpensive way to do it. In this section an Arduino UNO with an Ethernet shield and a photo resistor is used. The photo resistor is connected to analog pin 0 (A0) and has an output from 0 to 1024. + +

    + + The Arduino UNO with Ethernet shield and photo resistor +

    + +The [MQTT client](http://knolleary.github.io/pubsubclient/) for the Arduino needs to be available in your Arduino IDE. Below you will find a sketch which could act as a starting point. Please modify the IP addresses, the MAC address, and the pin as needed and upload the sketch to your Arduino. + +```c +/* + This sketch is based on the basic MQTT example by + http://knolleary.github.io/pubsubclient/ +*/ + +#include +#include +#include + +#define DEBUG 1 // Debug output to serial console + +// Device settings +IPAddress deviceIp(192, 168, 0, 43); +byte deviceMac[] = { 0xAB, 0xCD, 0xFE, 0xFE, 0xFE, 0xFE }; +char* deviceId = "sensor01"; // Name of the sensor +char* stateTopic = "home-assistant/sensor01/brightness"; // MQTT topic where values are published +int sensorPin = A0; // Pin to which the sensor is connected to +char buf[4]; // Buffer to store the sensor value +int updateInterval = 1000; // Interval in miliseconds + +// MQTT server settings +IPAddress mqttServer(192, 168, 0, 12); +int mqttPort = 1883; + +EthernetClient ethClient; +PubSubClient client(ethClient); + +void reconnect() { + while (!client.connected()) { +#if DEBUG + Serial.print("Attempting MQTT connection..."); +#endif + if (client.connect(deviceId)) { +#if DEBUG + Serial.println("connected"); +#endif + } else { +#if DEBUG + Serial.print("failed, rc="); + Serial.print(client.state()); + Serial.println(" try again in 5 seconds"); +#endif + delay(5000); + } + } +} + +void setup() { + Serial.begin(57600); + client.setServer(mqttServer, mqttPort); + Ethernet.begin(deviceMac, deviceIp); + delay(1500); +} + +void loop() { + if (!client.connected()) { + reconnect(); + } + client.loop(); + + int sensorValue = analogRead(sensorPin); +#if DEBUG + Serial.print("Sensor value: "); + Serial.println(sensorValue); +#endif + client.publish(stateTopic, itoa(sensorValue, buf, 10)); + delay(updateInterval); +} +``` + +The Arduino will send the value of the sensor every second. To use the data in Home Assistant, add an additional MQTT sensor to the `configuration.yaml` file. + +```yaml + - platform: mqtt + name: "Brightness" + state_topic: "home-assistant/sensor01/brightness" + unit_of_measurement: "cd" +``` + +After a restart of Home Assistant the values of your Arduino will be available. + +

    + + The Brightness sensor +

    + +I hope that this post could give you some ideas about the usage Home Assistant and MQTT. If you are working on a cool project that includes Home Assistant, please let us now. diff --git a/source/_posts/2015-09-13-home-assistant-meets-ifttt.markdown b/source/_posts/2015-09-13-home-assistant-meets-ifttt.markdown new file mode 100644 index 00000000000..cf63aa779f5 --- /dev/null +++ b/source/_posts/2015-09-13-home-assistant-meets-ifttt.markdown @@ -0,0 +1,116 @@ +--- +layout: post +title: "Home Assistant meets IFTTT" +description: "Announcing new integration with IFTTT and some samples to get started." +date: 2015-09-13 09:28 -0700 +date_formatted: "September 13, 2015" +author: Paulus Schoutsen +comments: true +categories: how-to release-notes +og_image: /images/blog/2015-09-ifttt/og_facebook.png +--- + +Today we announce the release of Home Assistant v0.7.2 which includes brand new support by +[@sfam][github-sfam] to integrate with [IFTTT][ifttt]. IFTTT stands for If This, Then That and is a +webservice that integrates with almost every possible webservice out there. Adding Home +Assistant to this mix means Home Assistant can connect with all via IFTTT. + +It is now possible to disable your irregation system if it is going to be cloudy tomorrow or tweet +if your smoke alarm goes off. + +[github-sfam]: https://github.com/sfam +[ifttt]: https://ifttt.com + +

    + +

    + +Head over to the [setup instructions](/components/ifttt.html) to get started with IFTTT. Click the +read more button for some example recipes. + + + +In each of the following examples, make sure to replace the XXX in the url with your correct +host address and api password. + +## {% linkable_title Turn off irregation system when not needed %} + +

    + +

    + +Maker channel setup: + +| Field | Value | +| ----- | ----- | +| URL | http://xxx.xxx.xxx.xxx:8123/api/services/switch/turn_off?api_password=xxxxxxxx +| METHOD | POST +| CONTENT TYPE | application/json +| BODY | { "entity_id": "switch.irrigation" } + +## {% linkable_title Tweet when important events happen %} + +

    + +

    + +This will tweet a message when a MQTT message is received that the smoke alarm has been triggered. +Setup Maker channel with event name `HA_FIRE_ALARM` and Twitter channel to tweet the message in +`value1`. + +```yaml +# Configuration.yaml entry +automation: + alias: Post a tweet when fire alarm is triggered + + platform: mqtt + mqtt_topic: home/alarm/fire + mqtt_payload: 'on' + + execute_service: ifttt.trigger + service_data: {"event":"HA_FIRE_ALARM", "value1":"The fire alarm just triggered!"} +``` + +## {% linkable_title Turn on lights when I get home %} + +

    + +

    + +Maker channel setup: + +| Field | Value | +| ----- | ----- | +| URL | http://xxx.xxx.xxx.xxx:8123/api/services/light/turn_on?api_password=xxxxxxxx +| METHOD | POST +| CONTENT TYPE | application/json +| BODY | { "entity_id": "light.kitchen" } + +## {% linkable_title Flash lights when a new PR comes in for Home Assistant %} + +

    + +

    + +Maker channel setup: + +| Field | Value | +| ----- | ----- | +| URL | http://xxx.xxx.xxx.xxx:8123/api/services/light/turn_on?api_password=xxxxxxxx +| METHOD | POST +| CONTENT TYPE | application/json +| BODY | { "entity_id": "group.all_lights", "flash":"yes" } + +## {% linkable_title Fire events when pressing the DO button %} + +

    + +

    + +Maker channel setup: + +| Field | Value | +| ----- | ----- | +| URL | http://xxx.xxx.xxx.xxx:8123/api/events/do_button_pressed?api_password=xxxxxxxx +| METHOD | POST +| CONTENT TYPE | application/json diff --git a/source/_posts/2015-09-18-monitoring-with-glances-and-home-assistant.markdown b/source/_posts/2015-09-18-monitoring-with-glances-and-home-assistant.markdown new file mode 100644 index 00000000000..52853449ad8 --- /dev/null +++ b/source/_posts/2015-09-18-monitoring-with-glances-and-home-assistant.markdown @@ -0,0 +1,78 @@ +--- +layout: post +title: "Remote Monitoring with Glances" +description: "This post describes the setup for monitoring remote hosts with Home Assistant." +date: 2015-09-18 11:00:00 +0200 +date_formatted: "September 18, 2015" +author: Fabian Affolter +comments: true +categories: how-to +og_image: /images/supported_brands/glances.png +--- + + +Inspried by a [feature requests](https://github.com/balloob/home-assistant/issues/310) I started looking into the available options to do monitoring of remote hosts. The feature request is about displaying system information in a similar way than the [systemmonitor](/components/sensor.systemmonitor.html) sensor does it for the local system. After a while I started to think that it would be a nice addition for a small home network where no full-blown system monitoring setup is present. + + + +The basic problem is to get the data from the remote host. Starting with [psutil](https://pypi.python.org/pypi/psutil) that is used by the systemmonitor sensor, a possible solution is only a click away and named [Glances](https://github.com/nicolargo/glances). Glances has a nice curses-based interface and a [RESTful API](https://github.com/nicolargo/glances/wiki/The-Glances-RESTFULL-JSON-API). + +The [Glances sensor](/components/sensor.glances.html) sensor uses that API to get all needed data. + +In this post a default Fedora 22 Workstation installation is used on the host that should be monitored. In fact, it doesn't matter if the system is the local one or a remote one as long as Glances is available. With some adjustments it should work on your own systems too. The difference will be the package and the firewall management tools. + +First some extra packages are needed beside Glances, especially the [bottle](http://bottlepy.org/docs/dev/index.html) webserver. I guess that Glances is available for your distribution as well. Otherwise follow those [instructions](https://github.com/nicolargo/glances#installation). + +``` +sudo dnf -y install glances python-bottle +``` + +On Fedora the Firewall settings are strict. Let's open port 61208 to allow other hosts to connect to that port. This is not needed if you just want to observe your local machine. + +```bash +sudo firewall-cmd --permanent --add-port=61208/tcp +sudo firewall-cmd --reload +``` + +Launch `glances` and keep an eye on the output. + +```bash +glances -w +Glances web server started on http://0.0.0.0:61208/ +``` + +Now browse to http://IP_ADRRESS:61208/. You should see the webified view of Glances. + +

    + + Glances web interface +

    + +Another check is to access the API located at http://IP_ADRRESS:61208/api/2/mem/used and to confirm that a detail about your memory usage is provided as a JSON response. If so, you are good to proceed. + +```bash +curl -X GET http://IP_ADDRESS:61208/api/2/mem/used +{"used": 203943936} +``` + +Add the [glances sensor](/components/sensor.glances.html) entry to your `configuration.yaml` file and restart Home Assistant then. + +```yaml +# Example configuration.yaml entry + - platform: glances + name: NAS + host: IP_ADDRESS + resources: + - 'disk_use_percent' + - 'disk_use' + - 'disk_free' +``` + +If there are no error in the log file then you should see your new sensors. + +

    + + The Glances sensors +

    + +[Glances](https://github.com/nicolargo/glances) has a couple of optional dependencies which are extenting the range of provided information. This means that it would be possible to get details about the RAID system, HDD temperature, IP addresses, sensors, etc., please create a [Pull request](https://github.com/balloob/home-assistant/pulls) with your additions or a [Feature request](https://github.com/balloob/home-assistant/issues/new) if you want see more details in your Home Assistant frontend. diff --git a/source/_posts/2015-09-19-alarm-sonos-and-itunes-support.markdown b/source/_posts/2015-09-19-alarm-sonos-and-itunes-support.markdown new file mode 100644 index 00000000000..9fb7ab40e4f --- /dev/null +++ b/source/_posts/2015-09-19-alarm-sonos-and-itunes-support.markdown @@ -0,0 +1,73 @@ +--- +layout: post +title: "Alarms, Sonos and iTunes now supported" +description: "Home Assistant 0.7.3 has been released with support for Sonos, iTunes and improved ." +date: 2015-09-19 21:47:00 +0700 +date_formatted: "September 19, 2015" +author: Paulus Schoutsen +comments: true +categories: release-notes +--- + +It's like someone opened a can of rock solid developers and emptied it above our +[chat channel](https://gitter.im/balloob/home-assistant) because it exploded with +great conversations and solid contributions. Featured in release 0.7.3: Sonos, iTunes, Alarm component and Automation upgrade. + +See [GitHub](https://github.com/balloob/home-assistant/releases/tag/0.7.3) for more detailed release notes. + +_Migration note: the `scheduler` component has been removed in favor of the `automation` component._ + +__Sonos__
    + +Sonos support has been added by [@rhooper](https://github.com/rhooper) and [@SEJeff](https://github.com/SEJeff). Home Assistant is now able to automatically +detect Sonos devices in your network and set them up for you. It will allow you to control music +playing on your Sonos and change the volume. + +__iTunes and airplay speakers__
    + +[@maddox](https://github.com/maddox) has contributed support for controlling iTunes and airplay speakers. For this to work you will +have to run [itunes-api](https://github.com/maddox/itunes-api) on your Mac as middleware. + +``` +# Example configuration.yaml entry +media_player: + platform: itunes + name: iTunes + host: http://192.168.1.50 + port: 8181 +``` + + + +__Automation__
    +Automation has gotten a lot of love. It now supports conditions, multiple triggers and new types of +triggers. The best to get started with it is to head over to the new +[getting started with automation](/getting-started/automation.html) page. + +```yaml +# Example of entry in configuration.yaml +automation: + alias: Light on in the evening + trigger: + - platform: sun + event: sunset + offset: "-01:00:00" + - platform: state + entity_id: group.all_devices + state: home + condition: + - platform: state + entity_id: group.all_devices + state: home + - platform: time + after: "16:00:00" + before: "23:00:00" + action: + service: homeassistant.turn_on + entity_id: group.living_room +``` + +__Verisure Alarms__
    + +We now support arming and disarming your verisure alarm from within Home Assistant thanks to added +support by [@persandstrom](https://github.com/persandstrom). diff --git a/source/components/arduino.markdown b/source/components/arduino.markdown index 3a02b4cb1c4..651b0517184 100644 --- a/source/components/arduino.markdown +++ b/source/components/arduino.markdown @@ -28,8 +28,10 @@ To integrate an Arduino boards with Home Assistant, add the following section to arduino: port: /dev/ttyACM0 ``` -The port where is your board connected to your Home Assistant host. If you are using an original Arduino the port will be named `ttyACM*`. The exact -number can be determined with `ls /dev/ttyACM*`. + +Configuration variables: + +- **port** (*Required*): The port where your board is connected to your Home Assistant host. If you are using an original Arduino the port will be named `ttyACM*`. The exact number can be determined with `ls /dev/ttyACM*`. ```bash ls /dev/ttyACM* @@ -41,49 +43,8 @@ If that is not working, check your `dmesg` or `journalctl -f` output. Keep in mi A word of caution: The Arduino boards are not storing states. This means that with every initialization the pins are set to off/low.

    -## Switch Configuration +## Building on top of the Arduino component -Support for switching pins is limited to high/on and low/off of the digital pins. PWM (pin 3,5,6,9,10, and 11 on a Arduino Uno) is not supported yet. - -To enable the Arduino switch pins with Home Assistant, add the following section to your `configuration.yaml` file: - -```yaml -# Example configuration.yaml entry -switch: - platform: arduino - pins: - 11: - name: Fan Office - type: digital - 12: - name: Light Desk - type: digital -``` - -The digital pins are numbered from 0 to 13. The available pins are 2 till 13. For testing purposes you can use pin 13 because with that pin you can control the internal LED. - -The name field of the pins array will be used in the frontend. - -## Sensor Configuration - -The sensor platform allow you to get an numerical values from an analog input pin. Usually between 0 and 1024. - -To enable an Arduino sensor with Home Assistant, add the following section to your `configuration.yaml` file: - -```yaml -# Example configuration.yaml entry -sensor: - platform: arduino - pins: - 1: - name: Door switch - type: analog - 0: - name: Brightness - type: analog -``` - -The 6 analog pins are numbered from A0 to A5. - -The name field of the pins array will be used in the frontend. + - [Arduino Sensor](/components/sensor.arduino.html) + - [Arduino Switch](/components/switch.arduino.html) diff --git a/source/components/automation.markdown b/source/components/automation.markdown index 8ac0028c5b0..65039a51d46 100644 --- a/source/components/automation.markdown +++ b/source/components/automation.markdown @@ -9,143 +9,262 @@ sharing: true footer: true --- -This page will talk about automating Home Assistant using the `automation` component. For more advanced ways of automation, see the [create a component]({{site_root}}/developers/creating_components.html) page. +This page will go into more detail about the various options the `automation` component offers. If +you haven't yet, read the [getting started page on automation](/getting-started/automation.html). -Each part of automation consists of two parts: the trigger part and the action part. The final result will look something like this: +A configuration section of an automation requires a `trigger` and an `action` section. `condition` and +`condition_type` are optional. To keep this page compact, all following sections will not show the +full configuration but only the relevant part. -``` +```yaml +# Example of entry in configuration.yaml automation: - # Optional alias that the logs will use to refer to the entry - alias: Sunset notification - - # Type of trigger and information for the trigger - platform: state - state_entity_id: sun.sun - state_from: 'above_horizon' - state_to: 'below_horizon' - - # Action to be done when trigger activated - execute_service: notify.NOTIFIER_NAME - service_data: {"message":"The sun has set"} -``` - -## {% linkable_title Setting up triggers %} - -#### {% linkable_title Time-based automation %} -This allows you to trigger actions whenever the time matches your filter. You can setup filters to match on hours, minutes and seconds. Any filter that you omit will match all values. - -Here are some example values: - -``` - # Match at the start of every hour - platform: time - time_minutes: 0 - time_seconds: 0 - - # Match at 4pm - platform: time - time_hours: 16 - time_minutes: 0 - time_seconds: 0 -``` - -#### {% linkable_title State-based automation %} -This allows you to trigger actions based on state changes of any entity within Home Assistant. You can omit the `state_from` and `state_to` to match all. - -``` - # Match when the sun sets - platform: state - state_entity_id: sun.sun - state_from: 'above_horizon' - state_to: 'below_horizon' - - # Match when a person comes home - platform: state - state_entity_id: device_tracker.Paulus_OnePlus_One - state_from: 'not_home' - state_to: 'home' - - # Match when a light turns on - platform: state - state_entity_id: light.Ceiling - state_from: 'off' - state_to: 'on' + alias: Light on in the evening + trigger: + - platform: sun + event: sunset + offset: "-01:00:00" + - platform: state + entity_id: group.all_devices + state: home + condition: + - platform: state + entity_id: group.all_devices + state: home + - platform: time + after: "16:00:00" + before: "23:00:00" + action: + service: homeassistant.turn_on + entity_id: group.living_room ```

    - Use quotes around your values for state_from and state_to to avoid the YAML parser interpreting some values as booleans. +All configuration entries have to be sequential. If you have automation:, +automation 2: and automation 4: then the last one will not be processed.

    -#### {% linkable_title MQTT-based automation %} -This allows you to trigger actions based on messages on an MQTT topic. You can specify an optional payload to match as well. + - [Jump to conditions](#conditions) + - [Jump to actions](#actions) + - [Jump to troubleshooting](#troubleshooting) -``` - # Match any changes to bathroom light - platform: mqtt - mqtt_topic: home/bathroom/light +## {% linkable_title Triggers %} - # Match only if bathroom light is turned on - platform: mqtt - mqtt_topic: home/bathroom/light - mqtt_payload: 'on' -``` +Triggers are what starts the processing of an automation rule. It is possible to specify multiple +triggers for the same rule. Once a trigger starts, Home Assistant will validate the conditions, if any, +and call the action. -## {% linkable_title Setting up the action %} +#### {% linkable_title Event trigger %} +Triggers when an event is being processed. Events are the raw building blocks of Home Assistant. +You can match events on just the event name or also require specific event data to be present. -Currently the only supported action is calling a service. Services are what devices expose to be controlled, so this will allow us to control anything that Home Assistant can control. - -``` - # Turn the lights Ceiling and Wall on. - execute_service: light.turn_on - service_entity_id: light.Ceiling,light.Wall - - # Turn the lights Ceiling and Wall on and turn them red. - execute_service: light.turn_on - service_entity_id: light.Ceiling,light.Wall - service_data: {"rgb_color": [255, 0, 0]} - - # Notify the user - execute_service: notify.NOTIFIER_NAME - service_data: {"message":"YAY"} -``` - -## {% linkable_title Putting it all together %} -For every combination of a trigger and an action we will have to combine the configuration lines and add it to an `automation` component entry in `configuration.yaml`. You can add an optional `alias` key to the configuration to make the logs more understandable. To setup multiple entries, append 2, 3 etc to the section name. An example of a `configuration.yaml` file: - -``` +```yaml automation: - alias: Sunset notification + trigger: + platform: event + event_type: MY_CUSTOM_EVENT + # optional + event_data: + mood: happy +``` - platform: state - state_entity_id: sun.sun - state_from: 'above_horizon' - state_to: 'below_horizon' +#### {% linkable_title MQTT trigger %} +Triggers when a specific message is received on given topic. Optionally can match on the payload +being sent over the topic. - execute_service: notify.NOTIFIER_NAME - service_data: {"message":"The sun has set"} +```yaml +automation: + trigger: + platform: mqtt + topic: living_room/switch/ac + # Optional + payload: 'on' +``` -automation 2: - alias: Turn lights off at 8am in the morning +#### {% linkable_title Numeric state trigger %} +On state change of a specified entity, attempts to parse the state as a number and triggers if value +is above and/or below a threshold. - platform: time - time_hours: 8 - time_minutes: 0 - time_seconds: 0 +```yaml +automation: + trigger: + platform: numeric_state + entity_id: sensor.temperature + # At least one of the following required + above: 17 + below: 25 +``` - execute_service: light.turn_off +#### {% linkable_title State trigger %} +Triggers when the state of an entity changes. If only entity_id given will match all state changes. -automation 3: - alias: Turn lights in study room on when Paulus comes home - - platform: state - state_entity_id: device_tracker.Paulus_OnePlus - state_from: 'not_home' - state_to: 'home' - - execute_service: homeassistant.turn_on - service_entity_id: group.Study_Room +```yaml +automation: + trigger: + platform: state + entity_id: device_tracker.paulus + # Optional + from: "not_home" + to: "home" ```

    -All configuration entries have to be sequential. If you have automation:, automation 2: and automation 4: then the last one will not be processed. + Use quotes around your values for from and to to avoid the YAML parser + interpreting some values as booleans.

    + +#### {% linkable_title Sun trigger %} +Triggers based on sunrise and sunset, both with an optional offset. + +```yaml +automation: + trigger: + platform: sun + # Possible values: sunset, sunrise + event: sunset + # Optional time offset + offset: -00:45:00 +``` + +#### {% linkable_title Time trigger %} +Time can be triggered in many ways. The most common is to specify `after` and trigger at a specific +point in time each day. Alternatively, you can also match if the hour, minute or second of the current +time has a specific value. For example, by only setting minutes in the config to 5 it will trigger every +hour when it is 5 minutes past whole. You cannot use `after` together with hour, minute or second. + +```yaml +automation: + trigger: + platform: time + # All following are optional. + # When 'after' is used, you cannot also match on hour, minute, seconds. + # Military time format. + # after: "15:32:00" + hours: 0 + minutes: 5 + seconds: 0 + weekday: + - sat + - sun +``` + +You can use `weekday` to limit the trigger times to speific days as well (also available in conditions). +Valid values for `weekday` are (`sun`, `mon`, `tue`, `wed`, `thu`, `fri` & `sat`) + +The above example will trigger on Saturday and Sunday every hour on the 5 (2:05, 3:05, 4:05, etc). + +## {% linkable_title Conditions %} + +Conditions are an optional part of an automation rule and be used to prevent an action from happening +when triggered. Conditions look very familiar to triggers but are very different. A trigger will look +at events happening at the system while a condition only looks at how the system looks right now. +A trigger can observe that a switch is being turned on. A condition can only see if a switch is on +or off. + +An automation rule can have mulitiple triggers. By default the action will only fire if all conditions +pass. An optional key `condition_type: 'or'` can be set on the automation rule to fire action if any +condition matches. + +```yaml +automation: + condition_type: or +``` + +If your triggers and conditions are exactly the same, you can use a shortcut to specify conditions. +In this case, triggers that are not valid conditions will be ignored. +```yaml +automation: + condition: use_trigger_values +``` + +#### {% linkable_title Numeric state condition %} +Attempts to parse the state of specified entity as a number and triggers if value is above and/or +below a threshold. + +```yaml +automation: + condition: + platform: numeric_state + entity_id: sensor.temperature + # At least one of the following required + above: 17 + below: 25 +``` + +#### {% linkable_title State condition %} +Tests if an entity is a specified state. + +```yaml +automation: + condition: + platform: state + entity_id: device_tracker.paulus + state: not_home +``` + +#### {% linkable_title Time condition %} +The time condition can test if it is after a specified time, before a specified time or if it is a +certain day of the week + +```yaml +automation: + condition: + platform: time + # At least one of the following is required. + after: "15:00:00" + before: "23:00:00" + weekday: + - mon + - wed + - fri +``` + +Valid values for `weekday` are (sun, mon, tue, wed, thu, fri & sat) + +## {% linkable_title Actions %} + +When an automation rule fires, it calls a service. For this service you can specify an entity id it +should apply to and optional service parameters (to specify for example the brightness). + +```yaml +automation: + # Change the light in the kitchen and living room to 150 brightness and color red. + action: + service: homeassistant.turn_on + entity_id: + - light.kitchen + - light.living_room + data: + brightness: 150 + rgb_color: [255, 0, 0] +``` + +```yaml +automation: + # Notify me on my mobile phone of an event + action: + service: notify.notify + data: + message: Something just happened, better take a look! +``` + +If you want to specify multiple services to be called or include a delay, have a look at the +[script component](/components/script.html). If you want to describe how certain entities should look, +check out the [scene component](/components/scene.html). + +## {% linkable_title Troubleshooting %} + +You can verify that your automation rules are being initialized correctly by watching both the realtime +logs and also the logbook. The realtime logs will show the rules being initialized (once for each trigger): + +```bash +INFO [homeassistant.components.automation] Initialized rule Rainy Day +INFO [homeassistant.components.automation] Initialized rule Rainy Day +INFO [homeassistant.components.automation] Initialized rule Rainy Day +INFO [homeassistant.components.automation] Initialized rule Rain is over +``` + +The Logbook component will show a line entry when an automation is triggered. You can look at the +previous entry to determine which trigger in the rule triggered the event. + +![Logbook example](/images/components/automation/logbook.png) diff --git a/source/components/camera.foscam.markdown b/source/components/camera.foscam.markdown new file mode 100644 index 00000000000..846adb3947e --- /dev/null +++ b/source/components/camera.foscam.markdown @@ -0,0 +1,35 @@ +--- +layout: page +title: "Foscam IP camera support" +description: "Instructions how to integrate Foscam IP cameras within Home Assistant." +date: 2015-09-17 08:01 +sidebar: false +comments: false +sharing: true +footer: true +--- + + +The foscam platform allows you to watch the live stream of your [Foscam](http://www.foscam.com/) IP camera in Home Assistant. + +To enable your Foscam IP camera in your installation, add the following to your `configuration.yaml` file: + +```yaml +# Example configuration.yaml entry +camera: + platform: foscam + ip: 192.168.0.123 + name: Door Camera + port: 88 + username: USERNAME + password: PASSWORD +``` + +Configuration variables: + +- **ip** *Required*: The IP address your camera. +- **port** *Optional*: The port that the camera is running on. The default is 88. +- **name** *Optional*: This parameter allows you to override the name of your camera. +- **username** *Required*: The username for accessing your camera. +- **password** *Required*: The password for accessing your camera. + diff --git a/source/components/camera.generic.markdown b/source/components/camera.generic.markdown index b0d54041383..851b6747bee 100644 --- a/source/components/camera.generic.markdown +++ b/source/components/camera.generic.markdown @@ -14,12 +14,21 @@ This component allows you to integrate any IP camera into Home Assistant. It sup Home Assistant will serve the images via its server, making it possible to view your IP camera's while outside of your network. +To enable this sensor in your installation, add the following to your `configuration.yaml` file: + ```yaml # Example configuration.yaml entry camera: platform: generic - name: my sample camera - username: MY_USERNAME - password: MY_PASSWORD still_image_url: http://194.218.96.92/jpg/image.jpg + name: my sample camera + username: USERNAME + password: PASSWORD ``` + +Configuration variables: + +- **still_image_url** *Required*: The URL your camera serves the image on, eg. http://192.168.1.21:2112/ +- **name** *Optional*: This parameter allows you to override the name of your camera. +- **username** *Optional*: The username for accessing your camera. +- **password** *Optional*: The password for accessing your camera. diff --git a/source/components/device_tracker.actiontec.markdown b/source/components/device_tracker.actiontec.markdown index 1e00789a67d..5f89e162c04 100644 --- a/source/components/device_tracker.actiontec.markdown +++ b/source/components/device_tracker.actiontec.markdown @@ -12,7 +12,8 @@ footer: true This platform allows you to detect presence by looking at connected devices to an [Actiontec](http://www.actiontec.com/) device. -Supported devices: +Supported devices (tested): + - MI424WR (Verizon FIOS)

    @@ -26,7 +27,15 @@ device_tracker: host: YOUR_ROUTER_IP username: YOUR_ADMIN_USERNAME password: YOUR_ADMIN_PASSWORD + home_interval: MINUTES ``` +Configuration variables: + +- **host** (*Required*): The IP address of your router, e.g. 192.168.1.1. +- **username** (*Required*: The username of an user with administrative privileges, usually *admin*. +- **password** (*Required*): The password for your given admin account. +- **home_interval** (*Optional*): If the home_interval is set then the component will not let a device be AWAY if it has been HOME in the last home_interval minutes. This is in addition to the 3 minute wait built into the device_tracker component. + See the [device tracker component page](/components/device_tracker.html) for instructions how to configure the people to be tracked. diff --git a/source/components/device_tracker.aruba.markdown b/source/components/device_tracker.aruba.markdown index e609b8efef3..4e43c3fe5af 100644 --- a/source/components/device_tracker.aruba.markdown +++ b/source/components/device_tracker.aruba.markdown @@ -9,7 +9,12 @@ sharing: true footer: true --- -This platform allows you to detect presence by looking at connected devices to an [Aruba Instant](http://www.arubanetworks.com/products/networking/aruba-instant/) device. This has been tested on an ARUBA AP-105. + +This platform allows you to detect presence by looking at connected devices to an [Aruba Instant](http://www.arubanetworks.com/products/networking/aruba-instant/) device. + +Supported devices (tested): + +- ARUBA AP-105

    This device tracker needs telnet to be enabled on the router. @@ -24,5 +29,11 @@ device_tracker: password: YOUR_ADMIN_PASSWORD ``` +Configuration variables: + +- **host** *Required*: The IP address of your router, e.g. 192.168.1.1. +- **username** *Required*: The username of an user with administrative privileges, usually *admin*. +- **password** *Required*: The password for your given admin account. + See the [device tracker component page](/components/device_tracker.html) for instructions how to configure the people to be tracked. diff --git a/source/components/device_tracker.asuswrt.markdown b/source/components/device_tracker.asuswrt.markdown index 362a30a3a3e..028a94daea2 100644 --- a/source/components/device_tracker.asuswrt.markdown +++ b/source/components/device_tracker.asuswrt.markdown @@ -12,6 +12,10 @@ footer: true This platform offers presence detection by looking at connected devices to a [ASUSWRT](http://event.asus.com/2013/nw/ASUSWRT/) based router. +

    +This device tracker needs telnet to be enabled on the router. +

    + To use an ASUSWRT router in your installation, add the following to your `configuration.yaml` file: ```yaml @@ -23,6 +27,10 @@ device_tracker: password: YOUR_ADMIN_PASSWORD ``` -This device tracker needs telnet to be enabled on the router. +Configuration variables: + +- **host** (*Required*): The IP address of your router, e.g. 192.168.1.1. +- **username** (*Required*: The username of an user with administrative privileges, usually *admin*. +- **password** (*Required*): The password for your given admin account. See the [device tracker component page](/components/device_tracker.html) for instructions how to configure the people to be tracked. diff --git a/source/components/device_tracker.ddwrt.markdown b/source/components/device_tracker.ddwrt.markdown index 4435eda1b27..b24aa7ef523 100644 --- a/source/components/device_tracker.ddwrt.markdown +++ b/source/components/device_tracker.ddwrt.markdown @@ -18,9 +18,15 @@ To use a DD-WRRT router in your installation, add the following to your `configu # Example configuration.yaml entry device_tracker: platform: ddwrt - host: 192.168.1.1 - username: admin - password: PASSWORD + host: ROUTER_IP_ADDRESS + username: YOUR_ADMIN_USERNAME + password: YOUR_ADMIN_PASSWORD ``` +Configuration variables: + +- **host** (*Required*): The IP address of your router, e.g. 192.168.1.1. +- **username** (*Required*: The username of an user with administrative privileges, usually *admin*. +- **password** (*Required*): The password for your given admin account. + See the [device tracker component page](/components/device_tracker.html) for instructions how to configure the people to be tracked. diff --git a/source/components/device_tracker.luci.markdown b/source/components/device_tracker.luci.markdown index 97c8d709f5e..c56fdadcdce 100644 --- a/source/components/device_tracker.luci.markdown +++ b/source/components/device_tracker.luci.markdown @@ -16,9 +16,15 @@ Before this scanner can be used you have to install the luci RPC package on Open # Example configuration.yaml entry device_tracker: platform: luci - host: 192.168.1.1 - username: admin - password: PASSWORD + host: ROUTER_IP_ADDRESS + username: YOUR_ADMIN_USERNAME + password: YOUR_ADMIN_PASSWORD ``` +Configuration variables: + +- **host** (*Required*): The IP address of your router, e.g. 192.168.1.1. +- **username** (*Required*): The username of an user with administrative privileges, usually *admin*. +- **password** (*Required*): The password for your given admin account. + See the [device tracker component page](/components/device_tracker.html) for instructions how to configure the people to be tracked. diff --git a/source/components/device_tracker.markdown b/source/components/device_tracker.markdown index 3de99d1a31e..4d4e5a0206f 100644 --- a/source/components/device_tracker.markdown +++ b/source/components/device_tracker.markdown @@ -11,22 +11,41 @@ footer: true Home Assistant can get information from your wireless router to track which devices are connected. There are three different types of supported wireless routers: +- [Actiontec](/components/device_tracker.actiontec.html) +- [Aruba](/components/device_tracker.aruba.html) +- [ASUSWRT](/components/device_tracker.asuswrt.html) - [DD-WRT](/components/device_tracker.ddwrt.html) -- [tomato](/components/device_tracker.tomato.html) -- [netgear](/components/device_tracker.netgear.html) - [luci (OpenWRT)](/components/device_tracker.luci.html) +- [netgear](/components/device_tracker.netgear.html) +- [Thomson](/components/device_tracker.thomson.html) +- [tomato](/components/device_tracker.tomato.html) - [TP-Link](/components/device_tracker.tplink.html) -You can also decide to directly scan the network for devices by using the [nmap scanner](/components/device_tracker.nmap_scanner.html). +Alternative trackers: + +- [MQTT](/components/device_tracker.mqtt.html) +- [nmap scanner](/components/device_tracker.nmap_scanner.html) to scan the network for devices +- [Owntrack](/components/device_tracker.owntrack.html) To get started add the following lines to your `configuration.yaml` (example for Netgear): -``` +```yaml +# Example configuration.yaml entry for Netgear device device_tracker: platform: netgear host: 192.168.1.1 username: admin - password: MY_PASSWORD + password: YOUR_PASSWORD + + # Optional configuration + + # If new discovered devices are tracked by default (default: yes) + track_new_devices: yes + # Seconds between each scan for new devices (default: 12) + interval_seconds: 12 + # Seconds to wait till marking someone as not home after not being seen + # (default: 180) + consider_home: 180 ``` -Once tracking, the `device_tracker` component will maintain a file in your config dir called `known_devices.csv`. Edit this file to adjust which devices have to be tracked. Here you can also setup a url for each device to be used as the entity picture. +Once tracking, a file will be created in your config dir called `known_devices.yaml`. Edit this file to adjust which devices have to be tracked. Here you can also setup a url for each device to be used as the entity picture and set whether the device will be show in the UI when in away state. diff --git a/source/components/device_tracker.mqtt.markdown b/source/components/device_tracker.mqtt.markdown new file mode 100644 index 00000000000..a75bcbf6845 --- /dev/null +++ b/source/components/device_tracker.mqtt.markdown @@ -0,0 +1,24 @@ +--- +layout: page +title: "MQTT device tracker" +description: "Instructions how to use MQTT to track devices in Home Assistant." +date: 2015-09-19 20:41 +sidebar: false +comments: false +sharing: true +footer: true +--- + + +This platform allows you to detect presence by monitoring a MQTT topic for new locations. To use this +platform, you specify a unique topic for each device. + +```yaml +# Example configuration.yaml entry +device_tracker: + platform: mqtt + qos: 1 + devices: + paulus_oneplus: /location/paulus + annetherese_n4: /location/annetherese +``` diff --git a/source/components/device_tracker.netgear.markdown b/source/components/device_tracker.netgear.markdown index dc3b59b2bc9..f37594ac958 100644 --- a/source/components/device_tracker.netgear.markdown +++ b/source/components/device_tracker.netgear.markdown @@ -16,9 +16,15 @@ This platform allows you to detect presence by looking at connected devices to a # Example configuration.yaml entry device_tracker: platform: netgear - host: 192.168.1.1 - username: admin - password: PASSWORD + host: YOUR_ROUTER_IP + username: YOUR_ADMIN_USERNAME + password: YOUR_ADMIN_PASSWORD ``` +Configuration variables: + +- **host** (*Required*): The IP address of your router, e.g. 192.168.1.1. +- **username** (*Required*: The username of an user with administrative privileges, usually *admin*. +- **password** (*Required*): The password for your given admin account. + See the [device tracker component page](/components/device_tracker.html) for instructions how to configure the people to be tracked. diff --git a/source/components/device_tracker.nmap_scanner.markdown b/source/components/device_tracker.nmap_scanner.markdown index de144c8e4a6..ee3ac047cb9 100644 --- a/source/components/device_tracker.nmap_scanner.markdown +++ b/source/components/device_tracker.nmap_scanner.markdown @@ -10,15 +10,23 @@ footer: true --- -As an alternative to the router-based device tracking, it is possible to directly scan the network for devices by using Nmap. The IP addresses to scan can be specified in any format that Nmap understands, including the network-prefix notation (`192.168.1.1/24`) and the range notation (`192.168.1.1-255`). +As an alternative to the router-based device tracking, it is possible to directly scan the network +for devices by using Nmap. The IP addresses to scan can be specified in any format that Nmap understands, +including the network-prefix notation (`192.168.1.1/24`) and the range notation (`192.168.1.1-255`). -If you're on Debian or Ubuntu, you might have to install the packages for arp and nmap. Do so by running `apt-get install net-tools nmap`. +If you're on Debian or Ubuntu, you might have to install the packages for arp and nmap. Do so by +running `apt-get install net-tools nmap`. ``` # Example configuration.yaml entry device_tracker: platform: nmap_tracker hosts: 192.168.1.1/24 + home_interval: 10 ``` -See the [device tracker component page](/components/device_tracker.html) for instructions how to configure the people to be tracked. +`home_interval` is an optional value set in minutes. This will be the number of minutes nmap will not +scan this device, assuming it is home, in order to preserve the device battery. + +See the [device tracker component page](/components/device_tracker.html) for instructions how to +configure the people to be tracked. diff --git a/source/components/device_tracker.owntrack.markdown b/source/components/device_tracker.owntrack.markdown new file mode 100644 index 00000000000..39f055f8495 --- /dev/null +++ b/source/components/device_tracker.owntrack.markdown @@ -0,0 +1,21 @@ +--- +layout: page +title: "Owntrack device tracker" +description: "Instructions how to use Owntrack to track devices in Home Assistant." +date: 2015-09-22 07:00 +sidebar: false +comments: false +sharing: true +footer: true +--- + + +This platform allows you to detect presence by monitoring MQTT topics uses by [Owntrack](http://owntracks.org/) for new locations. + +To integrate Owntrack in Home Assistant, add the following section to your `configuration.yaml` file: + +```yaml +# Example configuration.yaml entry +device_tracker: + platform: owntracks +``` diff --git a/source/components/device_tracker.tomato.markdown b/source/components/device_tracker.tomato.markdown index 89c5f4726c1..b32a7e4f315 100644 --- a/source/components/device_tracker.tomato.markdown +++ b/source/components/device_tracker.tomato.markdown @@ -16,10 +16,17 @@ Tomato requires an extra config variable called `http_id`. The value can be obta # Example configuration.yaml entry device_tracker: platform: tomato - host: 192.168.1.1 - username: admin - password: PASSWORD - http_id: ABCDEFG + host: YOUR_ROUTER_IP_ADDRESS + username: YOUR_ADMIN_USERNAME + password: YOUR_ADMIN_PASSWORD + http_id: YOUR_HTTP_ID ``` +Configuration variables: + +- **host** (*Required*): The IP address of your router, e.g. 192.168.1.1. +- **username** (*Required*: The username of an user with administrative privileges, usually *admin*. +- **password** (*Required*): The password for your given admin account. +- **http_id** (*Required*): The value can be obtained by logging in to the Tomato admin interface and search for `http_id` in the page source code. + See the [device tracker component page](/components/device_tracker.html) for instructions how to configure the people to be tracked. diff --git a/source/components/device_tracker.tplink.markdown b/source/components/device_tracker.tplink.markdown index d10750af4ba..712145c57f5 100644 --- a/source/components/device_tracker.tplink.markdown +++ b/source/components/device_tracker.tplink.markdown @@ -21,4 +21,11 @@ device_tracker: password: YOUR_ADMIN_PASSWORD ``` +Configuration variables: + +- **host** (*Required*): The IP address of your router, e.g. 192.168.1.1. +- **username** (*Required*: The username of an user with administrative privileges, usually *admin*. +- **password** (*Required*): The password for your given admin account. + + See the [device tracker component page](/components/device_tracker.html) for instructions how to configure the people to be tracked. diff --git a/source/components/discovery.markdown b/source/components/discovery.markdown index 64193b2eb88..aca8501c092 100644 --- a/source/components/discovery.markdown +++ b/source/components/discovery.markdown @@ -26,3 +26,7 @@ discovery: ``` If you are developing a new platform, please read [how to make your platform discoverable]({{site_root}}/developers/add_new_platform.html#discovery). + +

    +There is currently a known issue with running this playform on a 64-bit version of Python. +

    diff --git a/source/components/ifttt.markdown b/source/components/ifttt.markdown new file mode 100644 index 00000000000..8cffcb173b9 --- /dev/null +++ b/source/components/ifttt.markdown @@ -0,0 +1,65 @@ +--- +layout: page +title: "IFTTT" +description: "Instructions how to setup IFTTT within Home Assistant." +date: 2015-09-07 18:00 +sidebar: false +comments: false +sharing: true +footer: true +--- + +[IFTTT](https://ifttt.com) is a web service that allows users to create chains of simple conditional +statements, so called "recipes". With the ifttt component you can trigger recipes through the "maker" +channel. See the [announcement blog post](/blog/2015/09/13/home-assistant-meets-ifttt/) for examples +how to use it. + +```yaml +# Example configuration.yaml entry +ifttt: + key: xxxxx-x-xxxxxxxxxxxxx +``` + +Key is your API key which can be obtained by viewing the properties of the [Maker Channel](https://ifttt.com/maker). + +

    + +Property screen of the Maker Channel +

    + +Once you have added your key to `configuration.yaml`, restart your Home Assistant server. This will load up the IFTTT component and make a service available to trigger events in IFTTT. + +

    +After restarting the server, be sure to watch the console for any logging errors that show up in red, white or yellow. +

    + +### {% linkable_title Testing your trigger %} + +You can use the developer tools to test your [Maker Channel](https://ifttt.com/maker) trigger. To do this, open the Home Assistant UI, open the sidebar, click on the first icon in the developer tools. This should get you to the 'Call Service' screen. Fill in the following values: + +Field | Value +----- | ----- +domain | `ifttt` +service | `trigger` +Service Data | `{"event": "EventName", "value1": "Hello World"}` + +

    + +When your screen looks like this, click the 'call service' button. +

    + +### {% linkable_title Setting up a recipe %} + +

    + +You need to setup a unique trigger for each event you sent to IFTTT. +

    + +### {% linkable_title Sending events from IFTTT to Home Assistant %} + +To be able to receive events from IFTTT, your Home Assistant instance needs to be accessible from +the web. This can be achieved by forwarding port 8123 from your router to the device running Home +Assistant. If your ISP is giving you a new IP address from time to time, consider using +[DuckDNS][duck-dns]. + +[duck-dns]: https://duckdns.org diff --git a/source/components/index.markdown b/source/components/index.markdown index 787a5d37b8d..9e707ffdac6 100644 --- a/source/components/index.markdown +++ b/source/components/index.markdown @@ -24,7 +24,7 @@ Entities are things that you want to observe within Home Assistant. Support for
    -

    Light and environment

    +

    Light and environment

    @@ -70,7 +70,7 @@ Entities are things that you want to observe within Home Assistant. Support for - + @@ -83,7 +83,7 @@ Entities are things that you want to observe within Home Assistant. Support for
    -

    Devices and protocols

    +

    Devices and protocols

    DHTxx reads the temperature and humidity.
    @@ -114,12 +114,17 @@ Entities are things that you want to observe within Home Assistant. Support for - + - + + + + + +
    RFXtrx sensors monitors values from RFXtrx sensors.RFXtrx sensors monitors values from RFXtrx devices.
    MQTT allows sending and recieving MQTT messages.MQTT allows sending and recieving MQTT messages, incl. switches and sensors.
    aREST sensors observe and switches controls the pins of aREST enabled devices.
    @@ -138,7 +143,7 @@ Entities are things that you want to observe within Home Assistant. Support for
    -

    Presence detection

    +

    Presence detection

    Offers presence detection by looking at connected devices or by scanning the network.

    @@ -147,7 +152,7 @@ Entities are things that you want to observe within Home Assistant. Support for - + @@ -166,6 +171,16 @@ Entities are things that you want to observe within Home Assistant. Support for + + + + + + + + + + @@ -201,14 +216,14 @@ Entities are things that you want to observe within Home Assistant. Support for
    -

    Media player

    +

    Media player

    Controls your media player (Playback and Volume) and get details about the played track.

    Aruba routers
    OpenWRT routers
    Owntrack devices
    MQTT devices
    Netgear routers
    - + @@ -216,6 +231,11 @@ Entities are things that you want to observe within Home Assistant. Support for + + + + + @@ -226,6 +246,16 @@ Entities are things that you want to observe within Home Assistant. Support for + + + + + + + + + +
    Google Cast devicesGoogle Cast
    Kodi
    iTunes
    Music Player Daemon (MPD)Logitech Squeezebox
    Denon Network Receivers
    Sonos devices
    @@ -235,7 +265,7 @@ Entities are things that you want to observe within Home Assistant. Support for
  • Rest API
  • - \ No newline at end of file +
  • Website
  • + diff --git a/source/developers/python_api.markdown b/source/developers/python_api.markdown index 8c91fb2c021..091aa17aedb 100644 --- a/source/developers/python_api.markdown +++ b/source/developers/python_api.markdown @@ -11,21 +11,127 @@ footer: true In the package [`homeassistant.remote`](https://github.com/balloob/home-assistant/blob/master/homeassistant/remote.py) a Python API on top of the [HTTP API](/developers/api.html) can be found. -The two snippets below shows how to use the `homeassistant.remote` package: +This page is not a full documentation it's more a collection of some example. A simple way to get all current entities is to visit the "Set State" page in the "Developer Tools". For the examples below just choose one from the available entries. Here the sensor `sensor.office_temperature` and the switch `switch.livingroom_pin_2` are used. + +First import the module and setup the basics. ```python import homeassistant.remote as remote -api = remote.API("host", "password") -living_room = remote.get_state(api, 'group.living_room') +api = remote.API('host', 'password') +print(remote.validate_api(api)) ``` +This snippets shows how to use the `homeassistant.remote` package in another way. + ```python import homeassistant.remote as remote -api = remote.API("host", "password") +api = remote.API('host', 'password') hass = remote.HomeAssistant(api) hass.start() living_room = hass.states.get('group.living_room') ``` +### {% linkable_title Get details about servies and events %} + +Similar to the output in the "Developer Tools" of the frontend + +```python +import homeassistant.remote as remote + +api = remote.API('host', 'password') + +print('-- Available services:') +services = remote.get_services(api) +for service in services: + print(service['services']) + +print('\n-- Available event') +events = remote.get_event_listeners(api) +for event in events: + print(event) +``` + +### {% linkable_title Get the state of an entity %} + +To get the details of a single entity the `get_state` method is used. + +```python +import homeassistant.remote as remote + +api = remote.API('host', 'password') +office_temperature = remote.get_state(api, 'sensor.office_temperature') +print('{} is {} {}.'.format(office_temperature.attributes['friendly_name'], + office_temperature.state, + office_temperature.attributes['unit_of_measurement'] + ) + ) +``` + +The output is composed out of the details which are stored for this entity. + +```bash +Office Temperature is 19 °C. +``` + +The exact same thing is working for a switch. The difference is that both entities have different attributes. + +```python +import homeassistant.remote as remote + +api = remote.API('host', 'password') +switch_livingroom = remote.get_state(api, 'switch.livingroom_pin_2') +print('{} is {}.'.format(switch_livingroom.attributes['friendly_name'], + switch_livingroom.state + ) + ) +``` + +### {% linkable_title Set the state of an entity %} + +Of course, it's possible to set the state. + +```python +import homeassistant.remote as remote +from homeassistant.const import STATE_ON + +remote.set_state(api, 'sensor.office_temperature', new_state=123) +remote.set_state(api, 'switch.livingroom_pin_2', new_state=STATE_ON) +``` + +The state will be set to those value until the next update occurs. + +### {% linkable_title Blinking all entites of a domain %} + +If you want to turn on all entities of a domain, just a service which was retrieved by `get_services`. + + +```python +import time +import homeassistant.remote as remote + +domain = 'switch' + +remote.call_service(api, domain, 'turn_on') +time.sleep(10) +remote.call_service(api, domain, 'turn_off') +``` + +### {% linkable_title Control a single entity %} + +To turn on or off a single switch, the ID of the entity is needed as attribute. + +```python +import time +import homeassistant.remote as remote + +domain = 'switch' +switch_name = 'switch.livingroom_pin_2' + +remote.call_service(api, domain, 'turn_on', {'entity_id': '{}'.format(switch_name)}) +time.sleep(5) +remote.call_service(api, domain, 'turn_off', {'entity_id': '{}'.format(switch_name)}) +``` + +For more details please check the source of [homeassistant.remote](https://github.com/balloob/home-assistant/blob/master/homeassistant/remote.py). diff --git a/source/developers/rest_api.markdown b/source/developers/rest_api.markdown index 8be90e0a52f..b34db9b29f0 100644 --- a/source/developers/rest_api.markdown +++ b/source/developers/rest_api.markdown @@ -11,7 +11,7 @@ footer: true Home Assistant runs a web server accessible on port 8123. - * http://127.0.0.1:8123/ is an interface to control Home Assistant. + * http://localhost:8123/ is an interface to control Home Assistant. * http://localhost:8123/api/ is a Rest API. The API accepts and returns only JSON encoded objects. All API calls have to be accompanied by the header `X-HA-Access: YOUR_PASSWORD` (YOUR_PASSWORD as specified in your `configuration.yaml` file). @@ -21,7 +21,7 @@ There are multiple ways to consume the Home Assistant Rest API. One is with `cur ```bash curl -X GET \ -H "x-ha-access: YOUR_PASSWORD" \ - http://localhost:8123/api + http://localhost:8123/api/ ``` Another option is to use Python and the [Requests](http://docs.python-requests.org/en/latest/) module. diff --git a/source/getting-started/android.markdown b/source/getting-started/android.markdown index a1578265a2f..72e2170c1ed 100644 --- a/source/getting-started/android.markdown +++ b/source/getting-started/android.markdown @@ -20,5 +20,3 @@ Home Assistant is not available on the Play Store. Instead, Home Assistant lever

    - -Some internet service providers will only offer dynamic IPs. This can cause you to be unable to access Home Assistant while being remote. You can solve this by using a free Dynamic DNS service like [DuckDNS](https://www.duckdns.org/). diff --git a/source/getting-started/automation.markdown b/source/getting-started/automation.markdown new file mode 100644 index 00000000000..e8afa80b762 --- /dev/null +++ b/source/getting-started/automation.markdown @@ -0,0 +1,171 @@ +--- +layout: page +title: "Automating Home Assistant" +description: "Steps to help you get automation setup in Home Assistant." +date: 2015-09-19 09:40 +sidebar: false +comments: false +sharing: true +footer: true +--- + +When all your devices are set up it's time to put the cherry on the pie: automation. Home Assistant +offers [a few built-in automations](/components/#automation) but mainly you'll be using +[the automation component](/components/automation.html) to set up your own rules. + +### {% linkable_title The basics of automation %} + +Every automation rule consists of triggers, an action to be performed and optional conditions. + +Triggers can be anything observed in Home Assistant. For example, it can be a certain point in time +or a person coming home, which can be observed by the state changing from `not_home` to `home`. + +Actions will call services within Home Assistant. For example, turn a light on, set the temperature +on your thermostat or activate a scene. + +Conditions are used to prevent actions from firing unless certain conditions are met. For example, +it is possible to only turn on the light if someone comes home and it is after a certain point in +time. + +The difference between a condition and a trigger can be confusing. The difference is that the trigger +looks at the event that is happening, ie a car engine turning on. Conditions looks at the current state +of the system, ie is the car engine on. + +### {% linkable_title Exploring the internal state %} + +Automation rules are based on the internal state of Home Assistant. This is available for exploring +in the app using the developer tools. The first icon will show you the available services and the +second icon will show you the current devices. + +Each device is represented in Home Assistant as an entity consisting of the following parts: + +| Name | Description | Example | +| ---- | ----- | ---- | +| Entity ID | Unique identifier for the entity. | `light.kitchen` +| State | The current state of the device. | `home` +| Attributes | Extra data related to the device and/or current state. | `brightness` + +A service can be called to have Home Assistant perform an action. Turn on a light, run a script or +enable a scene. Each service has a domain and a name. For example the service `light.turn_on` is +capable of turning on any light device in your system. Services can be passed parameters to for +example tell which device to turn on or what color to use. + +## {% linkable_title Creating your first automation rule %} + +Before we dive deeper into what every piece of automation _can_ do, let's look at a simple automation +rule: **Turn on the lights when the sun sets** + +In this example, we are defining a trigger to track the sunset and tell it to fire when the sun is +setting. When this event is triggered, the service `light.turn_on` is called without any +parameters. Because we specify no parameters, it will turn on all the lights. + +```yaml +# Example configuration.yaml entry +automation: + alias: Turn on light when sun sets + trigger: + platform: sun + event: sunset + action: + service: light.turn_on +``` + +After a few days of running this automation rule you come to realize that this automation rule is not +good enough. It was already dark when the lights went on and the one day you weren't home, the lights +turned on anyway. Time for some tweaking. Let's add an offset to the sunset trigger and a condition +to only turn on the lights if anyone is home. + +```yaml +# Example configuration.yaml entry +automation: + alias: Turn on light when sun sets + trigger: + platform: sun + event: sunset + offset: "-01:00:00" + condition: + platform: state + entity_id: group.all_devices + state: home + action: + service: light.turn_on +``` + +Now you're happy and all is good. You start to like this automation business and buy some more lights, +this time you put them in the bedroom. But what you now realize is that when the sun is setting, the +lights in the bedroom are also being turned on! Time to tweak the automation to only turn on the living +room lights. + +The first thing you do is to look at the entities in the developer tools (second icon) in the app. +You see the names of your lights and you write them down: `light.table_lamp`, `light.bedroom`, +`light.ceiling`. + +Instead of hard coding the entity ids of the lights in the automation rule, we will set up a group. +This will allow us to see the living room separate in the app and be able to address it from +automation rules. + +So we tweak the config to add the group and have the automation rule only turn on the group. + +```yaml +# Example configuration.yaml entry +group: + living_room: + - light.table_lamp + - light.ceiling + +automation: + alias: Turn on light when sun sets + trigger: + platform: sun + event: sunset + offset: "-01:00:00" + condition: + platform: state + entity_id: group.all_devices + state: home + action: + service: light.turn_on + entity_id: group.living_room +``` + +Christmas is coming along and you decide to buy a remote switch to control the christmas lights from +Home Assistant. You can't claim to live in the house of the future if you're still manually turn on +your christmas lights! + +We hook the switch up to Home Assistant and grab the entity id from the developer tools: +`switch.christmas_lights`. We will update the group to include the switch and will change our action. +We are no longer able to call `light.turn_on` because we also want to turn on a switch. This is +where `homeassistant.turn_on` comes to the rescue. This service is capable of turning any entity on. + +```yaml +# Example configuration.yaml entry +group: + living_room: + - light.table_lamp + - light.ceiling + - switch.christmas_lights + +automation: + alias: Turn on light when sun sets + trigger: + platform: sun + event: sunset + offset: "-01:00:00" + condition: + platform: state + entity_id: group.all_devices + state: home + action: + service: homeassistant.turn_on + entity_id: group.living_room +``` + +### {% linkable_title Further reading %} + +We went over the basics of creating a home automation rule. From here no longer any hand holding, +go automate! + + - Learn about the available [automation triggers](/components/automation.html#triggers) + - Learn about the available [automation conditions](/components/automation.html#conditions) + - Learn about [scripts](/components/script.html) to help you trigger multiple actions and delays + - Learn about [scenes](/components/scene.html) to help you set many entities at once to your liking diff --git a/source/getting-started/autostart.markdown b/source/getting-started/autostart.markdown new file mode 100644 index 00000000000..bda54391481 --- /dev/null +++ b/source/getting-started/autostart.markdown @@ -0,0 +1,125 @@ +--- +layout: page +title: "Launch Home Assistant on boot" +description: "Instructions how to setup Home Assistant to launch on boot on various platforms.." +date: 2015-9-1 22:57 +sidebar: false +comments: false +sharing: true +footer: true +--- + +
    + + + + + + + + +
    +Many linux distributions use the Upstart system (or similar) for managing daemons. Typically, systems based on Debian 7 or previous use Upstart. This includes Ubuntu releases before 15.04 and all current Raspian releases. If you are unsure if your system is using Upstart, you may check with the following command: + +```bash +ps -p 1 -o comm= +``` + +If the preceding command returns the string `init`, you are likely using Upstart. + +Upstart will launch init scripts that are located in the directory /etc/init.d/. A sample init script for systems using Upstart is maintained by this project. + +To install this script, download it, tweak it to you liking, and install it by following the directions in the header. This script will setup Home Assistant to run when the system boots. To start/stop Home Assistant manually, issue the following commands: +```bash +sudo service hass-daemon start +sudo service hass-daemon stop +``` + +When running Home Assistant with this script, the configuration directory will be located at /var/opt/homeassistant. This directory will contain a verbose log rather than simply an error log. + +When running daemons, it is good practice to have the daemon run under its own user name rather than the default user's name. Instructions for setting this up are outside the scope of this document. +
    + + + +
    +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: + +```bash +ps -p 1 -o comm= +``` + +If the preceding command returns the string `systemd`, you are likely using systemd. + +If you want Home Assistant to be launched automatically, an extra step is needed to setup systemd. You need a service file to control Home Assistant with systemd. + +```bash +su -c 'cat <> /lib/systemd/system/home-assistant.service +[Unit] +Description=Home Assistant +After=network.target + +[Service] +Type=simple +ExecStart=hass + +[Install] +WantedBy=multi-user.target +EOF' +``` + +You need to reload systemd to make the daemon aware of the new configuration. Enable and launch Home Assistant after that. + +```bash +sudo systemctl --system daemon-reload +sudo systemctl enable home-assistant +sudo systemctl start home-assistant +``` + +If everything went well, sudo systemctl start home-assistant should give you a positive feedback. + +```bash +$ sudo systemctl status home-assistant -l +● home-assistant.service - Home Assistant + Loaded: loaded (/usr/lib/systemd/system/home-assistant.service; disabled; vendor preset: disabled) + Active: active (running) since Thu 2015-06-25 23:38:37 CEST; 3min 13s ago + Main PID: 8557 (python3.4) + CGroup: /system.slice/home-assistant.service + └─8557 /usr/bin/python3.4 -m homeassistant +[...] +``` + +To get Home Assistant's logging output, simple use journalctl. + +```bash +sudo journalctl -f -u home-assistant +``` +
    + +
    +Setting up Home Assistant to run as a background service is simple. OS X will +start it on boot and make sure it's always running. + +To get Home Assistant installed as a background service, run: + +```bash +$ hass --install-osx + +Home Assistant has been installed. Open it here: http://localhost:8123 + +``` + +Home Assistant will log to `~/Library/Logs/homeassistant.log` + +To uninstall the service, run: + +```bash +$ hass --uninstall-osx + +Home Assistant has been uninstalled. + +``` + +
    + +###[« Back to Getting Started](/getting-started/index.html) diff --git a/source/getting-started/configuration.markdown b/source/getting-started/configuration.markdown index c445e577838..f2238791327 100644 --- a/source/getting-started/configuration.markdown +++ b/source/getting-started/configuration.markdown @@ -9,13 +9,20 @@ sharing: true footer: true --- -By default, Home Assistant will create a configuration folder. Depending on your operating system this is `~/.homeassistant` (OS X/Linux) or `%APPDATA%/.homeassistant` (Windows). If you want to use a different folder for configuration, run `hass --config path/to/config`.

    +Home Assistant will create a configuration folder when it is run for the first time. Location depends +on operating system: on OS X/Linux it is `~/.homeassistant` and on Windows it is `%APPDATA%/.homeassistant`. +If you want to use a different folder for configuration, run `hass --config path/to/config`. -Inside your configuration folder is the file `configuration.yaml`. This is the main file that contains which components will be loaded and what their configuration is. An example configuration file is located at [`here`](https://github.com/balloob/home-assistant/blob/master/config/configuration.yaml.example). +Inside your configuration folder is the file `configuration.yaml`. This is the main file that contains +which components will be loaded and what their configuration is. An example configuration file is +located [here](https://github.com/balloob/home-assistant/blob/master/config/configuration.yaml.example). -When launched for the first time, Home Assistant will write a default configuration enabling the web interface and device discovery. It can take up to a minute for your devices to be discovered and show up in the interface. +When launched for the first time, Home Assistant will write a default configuration enabling the web +interface and device discovery. It can take up to a minute for your devices to be discovered and +show up in the interface. -If you are running into troubles while configuring Home Assistant, have a look at [the configuration troubleshoot page](/getting-started/troubleshooting-configuration.html). +If you are running into troubles while configuring Home Assistant, have a look at +[the configuration troubleshoot page](/getting-started/troubleshooting-configuration.html).

    You will have to restart Home Assistant for changes in configuration.yaml to take effect. @@ -23,7 +30,9 @@ If you are running into troubles while configuring Home Assistant, have a look a ### {% linkable_title Setting up the basic info %} -By default Home Assistant will try to detect your location and will automatically select a temperature unit and time zone based on your location. You can overwrite this by adding the following information to your `configuration.yaml`: +By default Home Assistant will try to detect your location and will automatically select a +temperature unit and time zone based on your location. You can overwrite this by adding the +following information to your `configuration.yaml`: ```yaml homeassistant: @@ -53,74 +62,18 @@ http: api_password: YOUR_PASSWORD ``` -### {% linkable_title Adding devices and services %} - -Home Assistant will be able to automatically discover and configure any Google Chromecasts, Netgear routers, -Belkin WeMo switches and Philips Hue bridges in your network if you have -[the discovery component]({{site_root}}/components/discovery.html) enabled (which is by default). - -Not all devices can be discovered, so if you have any of the following devices or services, please see their respective pages for installation instructions: - - * [Device tracking]({{site_root}}/components/device_tracker.html) - * [ISY994 controller]({{site_root}}/components/isy994.html) - * [Nest thermostat]({{site_root}}/components/thermostat.html) - * [Notifications]({{site_root}}/components/notify.html) - * [SABnzbd](/blog/2015/03/22/release-notes/#sabnzbd) - * [TellStick](/components/tellstick.html) - * [Wink hub]({{site_root}}/components/wink.html) - * [Add support for your own device or service]({{site_root}}/developers/add_new_platform.html) - -See the [components overview page](/components/) for a complete list of supported devices. - -### {% linkable_title Grouping devices %} - -Once you get a bunch of devices set up, it is time to organize them. This can be done using groups. -Each group exists of a name and a list of entity IDs. Entity IDs can be retrieved from the web interface -by using the Set State page in the Developer Tools (one in the middle). - - -```yaml -group: - living_room: light.table_lamp, switch.ac - bedroom: - - light.bedroom - - media_player.nexus_player -``` - -### {% linkable_title Customizing devices and services %} - -By default, most of your devices will be visible on the Home Assistant States -page and have a default icon determined by their domain. You may find it -desireable to customize the look and feel of your front page by altering some -of these parameters. - -By adding the following parameters to the `homeassistant:` section of your -`configuration.yaml`, you can customize the attributes of any state on -your front page. - -```yaml -homeassistant: - - # Add this to your existing configuration - - customize: - some.entity_id: - hidden: true - entity_picture: http://URL.TO/PICTURE - friendly_name: SOME CUSTOM NAME -``` - -

    Customizations are currently unavailable for device tracker entities.

    - -### {% linkable_title Setting up Home Automation %} - -When all your devices are set up it's time to put the cherry on the pie: automation. There are many ways to automate your home with Home Assistant so we have divided it into a couple of topics: - - * [Automatic light control based on the sun and if people are home]({{site_root}}/components/device_sun_light_trigger.html) (built-in component) - * [Intruder alerts]({{site_root}}/components/simple_alarm.html) (built-in component) - * [Setup your own automation rules]({{site_root}}/components/automation.html) (using configuration file) - * [Create your own automation component]({{site_root}}/developers/creating_components.html) (writing Python code) - ### {% linkable_title Setting up your phone or tablet %} Home Assistant runs as a self hosted web application. Home Assistant contains support to be added to your homescreen. If you're on Android you can follow [the visual guide]({{site_root}}/getting-started/android.html). For other devices, open Home Assistant on your mobile browser and click on the add to homescreen option. + +### {% linkable_title Remote access %} + +To make Home Assistant accessible while away from home, you will have to setup port forwarding from +your router to port 8123 on the computer that is hosting Home Assistant. Instructions how to do this +can be found by searching ` port forwarding instructions`. + +Some internet service providers will only offer dynamic IPs. This can cause you to be unable to +access Home Assistant while being remote. You can solve this by using a free Dynamic DNS service +like [DuckDNS](https://www.duckdns.org/). + +###[Next step: Setting up devices »](/getting-started/devices.html) \ No newline at end of file diff --git a/source/getting-started/devices.markdown b/source/getting-started/devices.markdown new file mode 100644 index 00000000000..caf9128ce9c --- /dev/null +++ b/source/getting-started/devices.markdown @@ -0,0 +1,62 @@ +--- +layout: page +title: "Adding devices to Home Assistant" +description: "Steps to help you get your devices in Home Assistant." +date: 2015-09-19 09:40 +sidebar: false +comments: false +sharing: true +footer: true +--- + +Home Assistant will be able to automatically discover and configure any Google Chromecasts, Netgear +routers, Belkin WeMo switches, Philips Hue bridges and Sonos speakers in your network if you have +[the discovery component]({{site_root}}/components/discovery.html) enabled (which is by default). + +See the [components overview page](/components/) to find installation instructions for your devices +and services. + +To get the most out of automation, it is useful to setup the following things: + + * [Presence Detection](/components/#presence) + * [Notification service](/components/#notify-service) + +If you can't find support for your favorite device or service, +[consider adding support](/developers/add_new_platform.html) + +### {% linkable_title Grouping devices %} + +Once you get a bunch of devices set up, it is time to organize them. This can be done using groups. +Each group exists of a name and a list of entity IDs. Entity IDs can be retrieved from the web interface +by using the Set State page in the Developer Tools (icon in the middle). + + +```yaml +# Example configuration.yaml entry +group: + living_room: light.table_lamp, switch.ac + bedroom: + - light.bedroom + - media_player.nexus_player +``` + +### {% linkable_title Customizing devices and services %} + +By default, all of your devices will be visible and have a default icon determined by their domain. +You may find it desireable to customize the look and feel of your front page by altering some +of these parameters. This can be done by adding the following config to the `homeassistant:` section. + +```yaml +# Example configuration.yaml entry +homeassistant: + + # Add this to your existing configuration + customize: + some.entity_id: + hidden: true + entity_picture: http://placehold.it/200x200 + friendly_name: My better name +``` + + +###[Next step: Setting up automation »](/getting-started/automation.html) diff --git a/source/getting-started/index.markdown b/source/getting-started/index.markdown index 044e632db49..7d1ebfbb1e5 100644 --- a/source/getting-started/index.markdown +++ b/source/getting-started/index.markdown @@ -16,277 +16,83 @@ footer: true -
    -

    Preparation

    - -
    - - - - - - - - -
    -Installing and running Home Assistant on your local machine is easy. Make sure you have Python 3.4 installed and execute the following code in a console: - - -
    - -
    -

    The preparation of a Fedora 22 host will only take a couple of minutes. First install Python 3.4 and the other needed packages out of the Fedora Package Collection. This ensure that you receive updates in the future.

    - -

    -It's assumed that your user has an entry in the sudoers file. Otherwise, run the commands which needs more privileges as root. -

    - -```bash -sudo dnf -y install python3 python3-devel gcc -``` - -
    - -
    - -

    CentOS is providing longtime support and often not shipping the latest release of a software component. To run, Python 3.x on CentOS Software Collections needs to be activated.

    - -
    Step 1. Install the tools for the Software Collection
    - -```bash -sudo yum -y install scl-utils -``` - -
    Step 2. Make the repository available.
    - -```bash -sudo yum -y install https://www.softwarecollections.org/en/scls/rhscl/rh-python34/epel-7-x86_64/download/rhscl-rh-python34-epel-7-x86_64.noarch.rpm -``` - -
    Step 3. Install Python 3.x
    - -```bash -sudo yum -y install rh-python34 -``` - -
    Step 4. Start using software collections:
    - -```bash -scl enable rh-python34 bash -``` - -
    - -
    - -
    -

    Installation

    + +
    +Installing and running Home Assistant on your local machine is easy. Make sure you have Python 3.4 installed and execute the following code in a console: +

    ```bash pip3 install homeassistant -hass --open-ui +hass \-\-open-ui ```

    Running these commands will:

    1. Install Home Assistant
    2. -
    3. Launch Home Assistant and serve web interface on http://localhost:8123
    4. +
    5. Launch Home Assistant and serve web interface on http://localhost:8123
    -
    - - -

    Post-Installation

    - -
    - - - - - - - - -
    -

    There is nothing else to do. If you run into any issues, please see the troubleshooting page.

    - -

    If you want to see what Home Assistant can do, you can start the demo mode by running hass --demo-mode.

    - -

    In the future, if you want to update to the latest version, run pip3 install --upgrade home-assistant.

    - -
    - -
    -

    By default, the access to port 8123 is not allowed. If you want to allow other hosts in your local network access, open port 8123.

    - -```bash -sudo firewall-cmd --permanent --add-port=8123/tcp -sudo firewall-cmd --reload -``` -

    Home Assistant will serve its web interface on http://[IP address of the host]:8123.

    - -

    If you want that Home Assistant is lauched automatically, an extra step is needed to setup systemd. You need a service file to control Home Assistant with systemd.

    - - +
    -```bash -su -c 'cat <> /lib/systemd/system/home-assistant.service -[Unit] -Description=Home Assistant -After=network.target - -[Service] -Type=simple -ExecStart=/usr/bin/python3.4 -m homeassistant - -[Install] -WantedBy=multi-user.target -EOF' -``` - -

    You need to reload systemd to make the daemon aware of the new configuration. Enable and launch Home Assistant after that.

    - -```bash -sudo systemctl --system daemon-reload -sudo systemctl enable home-assistant -sudo systemctl start home-assistant -``` - -

    If everything went well, sudo systemctl start home-assistant should give you a positive feedback.

    - -```bash -$ sudo systemctl status home-assistant -l -● home-assistant.service - Home Assistant - Loaded: loaded (/usr/lib/systemd/system/home-assistant.service; disabled; vendor preset: disabled) - Active: active (running) since Thu 2015-06-25 23:38:37 CEST; 3min 13s ago - Main PID: 8557 (python3.4) - CGroup: /system.slice/home-assistant.service - └─8557 /usr/bin/python3.4 -m homeassistant -[...] -``` - -

    To get Home Assistant's logging output, simple use journalctl.

    - -```bash -sudo journalctl -f -u home-assistant -``` - -

    In the future, if you want to update to the latest version, run pip3 install --upgrade home-assistant.

    - -

    -Those instructions were written for Fedora 22 Server and Workstation. They may work for Cloud flavor as well but this was not tested. -

    - - -
    - -
    - -

    Coming soon...

    - - - -
    - -
    - -
    - - -
    - -

    Installation with Docker is straightforward. Adjust the following command so that /path/to/your/config/ points at the folder where you want to store your config and run it:

    ```bash -docker run -d --name="home-assistant" -v /path/to/your/config:/config -v /etc/localtime:/etc/localtime:ro --net=host balloob/home-assistant +docker run -d \-\-name="home-assistant" -v /path/to/your/config:/config -v /etc/localtime:/etc/localtime:ro \-\-net=host balloob/home-assistant ```

    This will launch Home Assistant and serve its web interface from port 8123 on your Docker host.

    -When using boot2docker on OS X you are unable to map the local time to your Docker container. Replace -v /etc/localtime:/etc/localtime:ro with -e "TZ=America/Los_Angeles" (replacing America/Los_Angeles with your timezone) +When using boot2docker on OS X you are unable to map the local time to your Docker container. Replace -v /etc/localtime:/etc/localtime:ro with -e "TZ=America/Los_Angeles" (replacing America/Los_Angeles with your timezone)

    +
    -
    -
    +

    Home Assistant uses Python 3.4 which is not shipped with the current Raspbian distibution for the Raspberry Pi. Before installing Home Assistant, you will have to install Python 3.4. -

    Home Assistant uses Python 3.4. This makes installation on a Raspberry Pi a bit more difficult as it is not available in the package repository. Please follow the following instructions to get it up and running.

    +Once that is complete, installing and running Home Assistant on your local machine is easy. Make sure you have Python 3.4 installed and execute the following code in a console: -

    Step 1. Install pyenv

    - -```bash -curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash -``` - -

    After the installation is done, run:

    - -```bash -nano ~/.bashrc -``` - -

    Then add these lines to the end of the file and save:

    -``` -export PATH="$HOME/.pyenv/bin:$PATH" -eval "$(pyenv init -)" -eval "$(pyenv virtualenv-init -)" -``` - -
    Step 2. Install requirements
    - -```bash -sudo apt-get install python3-dev -sudo apt-get install libsqlite3-dev libreadline-dev libbz2-dev -``` - -

    Log out and then back in so your bashrc is reloaded.

    - -

    -NOTE: the rest of the commands are not being run as sudo and will install python etc under you user's home directory. -

    - -

    Step 3. Install python 3.4.2 (this will take a few hours)

    - -```bash -pyenv install 3.4.2 -``` - -

    Step 4. Create Python Virtual Environment

    -```bash -pyenv virtualenv 3.4.2 homeassistant -``` - -

    Step 5. Set the virtual environment

    -```bash -cd home-assistant -pyenv local homeassistant -``` - -

    Step 6. Install Home Assistant

    +

    ```bash pip3 install homeassistant +hass \-\-open-ui ``` +

    +

    Running these commands will:

    +
      +
    1. Install Home Assistant
    2. +
    3. Launch Home Assistant and serve web interface on http://localhost:8123
    4. +
    +
    -

    Step 7. Start it up

    + +### {% linkable_title Troubleshooting %} + +If you run into any issues, please see [the troubleshooting page](/getting-started/troubleshooting.html). It contains solutions to many of the more commonly encountered issues. + +For additional help, in addition to this site, there are three sources: + + - [Gitter Chatroom](https://gitter.im/balloob/home-assistant) for general Home Assistant discussions and questions. + - [Development Mailing List](https://groups.google.com/forum/#!forum/home-assistant-dev) for development related questions and discussing new features. + - [GitHub Page](https://github.com/balloob/home-assistant) for issue reporting. + +### {% linkable_title What's next %} +If you want to have Home Assistant start on boot, [autostart instructions](/getting-started/autostart.html) can be found here. + +To see what Home Assistant can do, launch demo mode: ```bash -hass +hass \-\-demo-mode ``` -

    It will be up and running on port 8123

    - -

    In the future, if you want to update to the latest version, run pip3 install --upgrade home-assistant.

    - - - - - -###[Next step: configuring Home Assistant »](/getting-started/configuration.html) +To update Home Assistant to the latest release: +```bash +pip3 install \-\-upgrade homeassistant +``` +###[Next step: Configuring Home Assistant »](/getting-started/configuration.html) diff --git a/source/getting-started/troubleshooting.markdown b/source/getting-started/troubleshooting.markdown index b3588e679d9..3d1e7a0f629 100644 --- a/source/getting-started/troubleshooting.markdown +++ b/source/getting-started/troubleshooting.markdown @@ -17,7 +17,7 @@ This utility should have been installed as part of the Python 3.4 installation. is installed by running `python3 --version`. If it is not installed, [download it here](https://www.python.org/getit/). -If you are to succesfully run `python3 --version` but not `pip3`, run the following command instead +If you are able to successfully run `python3 --version` but not `pip3`, run the following command instead to install Home Assistant: `python3 -m pip install homeassistant`. **No module named pip**
    @@ -27,8 +27,27 @@ by some distributions. If you are unable to run `python3 -m pip --version` you c `python3 get-pip.py`. **No access to the frontend**
    -In newer Linux distributions (at least Fedora 22/CentOS 7) the access to a host are very limited. -This means that you can't access the Home Assistant Frontend that is running on a host in your -network. Check the Post-installation section on the [Getting started](/getting-started/) page and -follow the instruction that match your distribution to allow access to port 8123. +In newer Linux distributions (at least Fedora 22/CentOS 7) the access to a host is very limited. +This means that you can't access the Home Assistant Frontend that is running on a host outside of the host machine. Windows and OSX machines may also have issues with this. +To fix this you will need to open your machine's firewall for TCP traffic over port 8123. The method for doing this will vary depending on your operating system and the firewall you have installed. Below are some suggestions to try. Google is your friend here. + +[Windows](http://windows.microsoft.com/en-us/windows/open-port-windows-firewall#1TC=windows-7) and [Mac OSX](https://support.apple.com/en-us/HT201642) have good instructions posted. + +For firewalld systems (Fedora, RHEL, etc.): +```bash +sudo firewall-cmd --permanent --add-port=8123/tcp +sudo firewall-cmd --reload +``` + +For UFW systems (Ubuntu, Debian, Raspbian, etc.): +```bash +sudo ufw allow 8123/tcp +``` + +For iptables systems (usually the default): +```bash +iptables -I INPUT -p tcp --dport 8123 -j ACCEPT +iptables-save > /etc/network/iptables.rules # your rules may be saved elsewhere +``` +###[« Back to Getting Started](/getting-started/index.html) diff --git a/source/images/blog/2015-09-glances/sensors.png b/source/images/blog/2015-09-glances/sensors.png new file mode 100644 index 00000000000..bd51461e579 Binary files /dev/null and b/source/images/blog/2015-09-glances/sensors.png differ diff --git a/source/images/blog/2015-09-glances/web-glances.png b/source/images/blog/2015-09-glances/web-glances.png new file mode 100644 index 00000000000..b5999dfd100 Binary files /dev/null and b/source/images/blog/2015-09-glances/web-glances.png differ diff --git a/source/images/blog/2015-09-ifttt/og_facebook.png b/source/images/blog/2015-09-ifttt/og_facebook.png new file mode 100644 index 00000000000..18ab31a495c Binary files /dev/null and b/source/images/blog/2015-09-ifttt/og_facebook.png differ diff --git a/source/images/blog/2015-09-ifttt/recipe-do.png b/source/images/blog/2015-09-ifttt/recipe-do.png new file mode 100644 index 00000000000..d678d5324c7 Binary files /dev/null and b/source/images/blog/2015-09-ifttt/recipe-do.png differ diff --git a/source/images/blog/2015-09-ifttt/recipe-geo.png b/source/images/blog/2015-09-ifttt/recipe-geo.png new file mode 100644 index 00000000000..2d8359d06d1 Binary files /dev/null and b/source/images/blog/2015-09-ifttt/recipe-geo.png differ diff --git a/source/images/blog/2015-09-ifttt/recipe-github.png b/source/images/blog/2015-09-ifttt/recipe-github.png new file mode 100644 index 00000000000..3029228bde1 Binary files /dev/null and b/source/images/blog/2015-09-ifttt/recipe-github.png differ diff --git a/source/images/blog/2015-09-ifttt/recipe-twitter.png b/source/images/blog/2015-09-ifttt/recipe-twitter.png new file mode 100644 index 00000000000..74f40fbcee5 Binary files /dev/null and b/source/images/blog/2015-09-ifttt/recipe-twitter.png differ diff --git a/source/images/blog/2015-09-ifttt/recipe-weather.png b/source/images/blog/2015-09-ifttt/recipe-weather.png new file mode 100644 index 00000000000..149f5d59517 Binary files /dev/null and b/source/images/blog/2015-09-ifttt/recipe-weather.png differ diff --git a/source/images/blog/2015-09-ifttt/splash.png b/source/images/blog/2015-09-ifttt/splash.png new file mode 100644 index 00000000000..ab82760d5e3 Binary files /dev/null and b/source/images/blog/2015-09-ifttt/splash.png differ diff --git a/source/images/blog/2015-09-mqtt/arduino-shield.png b/source/images/blog/2015-09-mqtt/arduino-shield.png new file mode 100644 index 00000000000..792170b59f6 Binary files /dev/null and b/source/images/blog/2015-09-mqtt/arduino-shield.png differ diff --git a/source/images/blog/2015-09-mqtt/arduino.png b/source/images/blog/2015-09-mqtt/arduino.png new file mode 100644 index 00000000000..edbe5c2bed4 Binary files /dev/null and b/source/images/blog/2015-09-mqtt/arduino.png differ diff --git a/source/images/blog/2015-09-mqtt/lottery.png b/source/images/blog/2015-09-mqtt/lottery.png new file mode 100644 index 00000000000..3d165d6f566 Binary files /dev/null and b/source/images/blog/2015-09-mqtt/lottery.png differ diff --git a/source/images/blog/2015-09-mqtt/mood.png b/source/images/blog/2015-09-mqtt/mood.png new file mode 100644 index 00000000000..c49ee432520 Binary files /dev/null and b/source/images/blog/2015-09-mqtt/mood.png differ diff --git a/source/images/components/automation/logbook.png b/source/images/components/automation/logbook.png new file mode 100644 index 00000000000..69563ef8f6c Binary files /dev/null and b/source/images/components/automation/logbook.png differ diff --git a/source/images/components/ifttt/finding_key.png b/source/images/components/ifttt/finding_key.png new file mode 100644 index 00000000000..5502f2a68aa Binary files /dev/null and b/source/images/components/ifttt/finding_key.png differ diff --git a/source/images/components/ifttt/setup_trigger.png b/source/images/components/ifttt/setup_trigger.png new file mode 100644 index 00000000000..6e93b14ea37 Binary files /dev/null and b/source/images/components/ifttt/setup_trigger.png differ diff --git a/source/images/components/ifttt/testing_service.png b/source/images/components/ifttt/testing_service.png new file mode 100644 index 00000000000..27a53a5ff25 Binary files /dev/null and b/source/images/components/ifttt/testing_service.png differ diff --git a/source/images/screenshots/transmission-pref.png b/source/images/screenshots/transmission_perf.png similarity index 100% rename from source/images/screenshots/transmission-pref.png rename to source/images/screenshots/transmission_perf.png diff --git a/source/images/supported_brands/arest.png b/source/images/supported_brands/arest.png new file mode 100644 index 00000000000..8905776801d Binary files /dev/null and b/source/images/supported_brands/arest.png differ diff --git a/source/images/supported_brands/aruba.png b/source/images/supported_brands/aruba.png new file mode 100644 index 00000000000..e20f1c95a6b Binary files /dev/null and b/source/images/supported_brands/aruba.png differ diff --git a/source/images/supported_brands/denon.png b/source/images/supported_brands/denon.png new file mode 100644 index 00000000000..621cdda9d67 Binary files /dev/null and b/source/images/supported_brands/denon.png differ diff --git a/source/images/supported_brands/dht.png b/source/images/supported_brands/dht.png new file mode 100644 index 00000000000..701af8ffbd1 Binary files /dev/null and b/source/images/supported_brands/dht.png differ diff --git a/source/images/supported_brands/foscam.png b/source/images/supported_brands/foscam.png new file mode 100644 index 00000000000..af91c29cba7 Binary files /dev/null and b/source/images/supported_brands/foscam.png differ diff --git a/source/images/supported_brands/glances.png b/source/images/supported_brands/glances.png new file mode 100644 index 00000000000..1108619b318 Binary files /dev/null and b/source/images/supported_brands/glances.png differ diff --git a/source/images/supported_brands/ifttt.png b/source/images/supported_brands/ifttt.png new file mode 100644 index 00000000000..f986bf76db4 Binary files /dev/null and b/source/images/supported_brands/ifttt.png differ diff --git a/source/images/supported_brands/itunes.png b/source/images/supported_brands/itunes.png new file mode 100644 index 00000000000..f61681b0d1e Binary files /dev/null and b/source/images/supported_brands/itunes.png differ diff --git a/source/images/supported_brands/owntrack.png b/source/images/supported_brands/owntrack.png new file mode 100644 index 00000000000..8dcc8edff96 Binary files /dev/null and b/source/images/supported_brands/owntrack.png differ diff --git a/source/images/supported_brands/sonos.png b/source/images/supported_brands/sonos.png new file mode 100644 index 00000000000..47d1ebc0205 Binary files /dev/null and b/source/images/supported_brands/sonos.png differ