Merge branch 'master' into next

This commit is contained in:
Paulus Schoutsen 2016-03-26 00:09:44 -07:00
commit 27c1f41d7b
60 changed files with 1849 additions and 136 deletions

View File

@ -79,6 +79,8 @@ collections:
output: true
cookbook:
output: true
topics:
output: true
# ----------------------- #
# 3rd Party Settings #

View File

@ -80,7 +80,7 @@ Out of the box, the component will do nothing. You have to teach it about all in
You can use [templates] for the values of `speech/text`, `card/title` and `card/content`.
[templates]: /getting-started/templating/
[templates]: /topics/templating/
Configuring the Alexa component for the above intents would look like this:

View File

@ -209,7 +209,7 @@ automation:
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. In the example below, the automation would trigger if the time is before 05:00 _OR_ after 20:00.
An automation rule can have mulitiple conditions. 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. In the example below, the automation would trigger if the time is before 05:00 _OR_ after 20:00.
```yaml
automation:
@ -363,4 +363,4 @@ The Logbook component will show a line entry when an automation is triggered. Y
![Logbook example](/images/components/automation/logbook.png)
[template]: /getting-started/templating/
[template]: /topics/templating/

View File

@ -33,7 +33,7 @@ Configuration variables:
- **name** (*Optional*): Let you overwrite the the name of the device. By default *name* from the device is used.
- **payload_on** (*Optional*): The payload that represents enabled state. Default is "ON".
- **payload_off** (*Optional*): The payload that represents disabled state. Default is "OFF".
- **value_template** (*Optional*): Defines a [template](/getting-started/templating/) to extract a value from the payload.
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload.
## {% linkable_title Examples %}

View File

@ -25,6 +25,7 @@ binary_sensor:
qos: 0
payload_on: "ON"
payload_off: "OFF"
sensor_class: opening
value_template: '{% raw %}{{ value.x }}{% endraw %}'
```
@ -35,7 +36,8 @@ Configuration variables:
- **qos** (*Optional*): The maximum QoS level of the state topic. Default is 0.
- **payload_on** (*Optional*): The payload that represents on state. Default is "ON".
- **payload_off** (*Optional*): The payload that represents state. Default is "OFF".
- **value_template** (*Optional*): Defines a [template](/getting-started/templating/) to extract a value from the payload.
- **sensor_class** (*Optional*): The [type/class](/components/binary_sensor/) of the sensor to set the icon in the frontend.
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload.
For a quick check you can use the commandline tools shipped with `mosquitto` to send MQTT messages. Set the state of your sensor manually:

View File

@ -42,7 +42,7 @@ Configuration variables:
- **resource** (*Required*): The resource or endpoint that contains the value.
- **method** (*Optional*): The method of the request. Default is GET.
- **value_template** (*Optional*): Defines a [template](/getting-started/templating/) to extract the value.
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract the value.
- **payload** (*Optional*): The payload to send with a POST request. Usualy formed as a dictionary.
- **name** (*Optional*): Name of the REST binary sensor.

View File

@ -37,7 +37,7 @@ Configuration options for the a TCP Sensor:
- **payload** (*Required*): What to send to the host in order to get the response we're interested in.
- **value_on** (*Required*): The value returned when the device is "on".
- **timeout** (*Optional*): How long in seconds to wait for a response from the service before giving up and disconnecting. Defaults to 10.
- **value_template** (*Optional*): Defines a [template](/getting-started/templating/) to extract the value. By default it's assumed that the entire response is the value.
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract the value. By default it's assumed that the entire response is the value.
- **unit** (*Optional*): The unit of measurement to use for the value.
- **buffer_size** (*Optional*): The size of the receive buffer in bytes. Set this to a larger value if you expect to receive a response larger than the default. Defaults to 1024.

View File

@ -29,7 +29,7 @@ Configuration variables:
- **sensors** array (*Required*): List of your sensors.
- **friendly_name** (*Optional*): Name to use in the Frontend.
- **sensor_class** (*Optional*): Defines the class of the sensor (motion, heat, moisture, etc)
- **value_template** (*Optional*): Defines a [template](/getting-started/templating/) to extract a value from the payload.
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload.
## {% linkable_title Examples %}

View File

@ -12,7 +12,7 @@ ha_category: Other
---
The browser component provides a service to open urls in the default browser on the host machine.
The `browser` component provides a service to open URLs in the default browser on the host machine.
To load this component, add the following lines to your `configuration.yaml`:
@ -21,8 +21,19 @@ To load this component, add the following lines to your `configuration.yaml`:
browser:
```
#### Service `browser/browse_url`
#### {% linkable_title Service `browser/browse_url` %}
| Service data attribute | Optional | Description |
| ---------------------- | -------- | ----------- |
| `url` | no | The url to open
### {% linkable_title Usage %}
To use this service, choose **Call Service** from the **Developer Tools**. Choose the service *browser/browse_url* from the list of **Available services:** and enter the URL into the **Service Data** field and hit **CALL SERVICE**.
```json
{"url": "http://www.google.com"}
```
This will open the given URL on the host machine.

View File

@ -20,7 +20,7 @@ To enable your Foscam IP camera in your installation, add the following to your
# Example configuration.yaml entry
camera:
platform: foscam
ip: 192.168.0.123
ip: IP_ADDRESS
name: Door Camera
port: 88
username: USERNAME
@ -29,12 +29,15 @@ camera:
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.
- **Note**: There seems to be some issues within Foscam with lengthy passwords and passwords containing certain symbols. Be sure to check your camera's documentation.
- **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.
<p class='note'>
There seems to be some issues within Foscam with lengthy passwords and passwords containing certain symbols. Be sure to check your camera's documentation.
</p>
### {% linkable_title Control Foscam PTZ (Pan/Tilt/Zoom) - Home/Away %}
Foscam Webcams which support CGI Commands can be controlled by Home Assistant ([Source](http://www.ipcamcontrol.net/files/Foscam%20IPCamera%20CGI%20User%20Guide-V1.0.4.pdf)). For an example of how this can be done, see the [Foscam IP Camera Pan, Tilt, Zoom Control](/cookbook/foscam_away_mode_PTZ/) Cookbook entry.

View File

@ -27,6 +27,9 @@ device_tracker:
home_interval: 10
```
`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.
Configuration variables:
- **hosts** (*Required*): Thenetwork range to scan in CIDR notation, eg. 192.168.1.1/24
- **home_interval** (*Optional*): 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/) for instructions how to configure the people to be tracked.

View File

@ -23,6 +23,8 @@ OID examples:
- Mikrotik: 1.3.6.1.2.1.4.22.1.2 (confirmed, RouterOS 6.x on RB2011)
- Aruba: 1.3.6.1.4.1.14823.2.3.3.1.2.4.1.2 (untested)
- BiPAC 7800DXL: 1.3.6.1.2.1.17.7.1.2.2.1.1 (confirmed on firmware 2.32e)
- OpenWrt: 1.3.6.1.2.1.4.22.1.2 (tested on Chaos Calmer 15.05 firmware, need to install snmpd package)
- pfSense: 1.3.6.1.2.1.4.22.1.2 (tested on 2.2.4-RELEASE, need to enable SNMP service)
To use the snmp platform in your installation, add the following to your `configuration.yaml` file:

View File

@ -37,5 +37,9 @@ If running home-assistant in a docker container use switch `--net=host` to put i
If you are developing a new platform, please read [how to make your platform discoverable]({{site_root}}/developers/add_new_platform/#discovery).
<p class='note warning'>
There is currently a <a href='https://bitbucket.org/al45tair/netifaces/issues/17/dll-fails-to-load-windows-81-64bit'>known issue</a> with running this playform on a 64-bit version of Python.
There is currently a <a href='https://bitbucket.org/al45tair/netifaces/issues/17/dll-fails-to-load-windows-81-64bit'>known issue</a> with running this platform on a 64-bit version of Python.
</p>
<p class='note'>
If you are on Windows and you're using Python 3.5, download the Netifaces dependency <a href='http://www.lfd.uci.edu/~gohlke/pythonlibs/#netifaces'>here</a>.
</p>

View File

@ -15,10 +15,11 @@ Groups allow the user to combine multiple entities into one. A group can be prom
Check the **Set State** page from the **Developer Tools** and browse the **Current entities:** listing for all available entities.
By default, every group appears in the HOME tab. If you name a group `default_view` it will REPLACE the contents of the HOME tab so you can customize it as you wish.
```yaml
# Example configuration.yaml entry
group:
# If you name an entry default_view it will REPLACE the contents of the "Home" tab
default_view:
view: yes
entities:
@ -42,24 +43,32 @@ group:
Configuration variables:
- **view** (*Optional*): If yes then the entry will be shown as a view (tab).
- **name** (*Optional*): Name of the group.
- **icon** (*Optional*): An optional icon to show in the Frontend.
- **view** (*Optional*): If yes then the entry will be shown as a view.
- **entities** array or comma delimited string (*Required*): List of entites to group.
- **icon** (*Optional*): If the group is a view, this icon will show at the top in the frontend instead of the name. If it's not a view, then the icon shows when this group is used in another group.
- **entities** (*Required*): array or comma delimited string, list of entities to group.
<p class='img'>
<img src='/images/blog/2016-01-release-12/views.png'>
Example of groups shown as views in the frontend.
</p>
If all entities are switches or lights they can be controlled as one with a switch at the top of the card. Grouped states should share the same type of states (ON/OFF or HOME/NOT_HOME).
If all entities in a group are switches or lights then Home Assistant adds a switch at the top of the card that turns them all on/off at once.
You can create views (tabs) that contain other groups.
Notice in the example below that in order to refer to the group "Living Room", you use `group.living_room` (lowercase and spaces replaced with underscores).
```yaml
# Example configuration.yaml entry
group:
living_room:
- light.bowl
- light.ceiling
- light.tv_back_light
children: device_tracker.child_1, device_tracker.child_2
```
# Example configuration.yaml entry that shows two groups, referred to in a view group (tab)
Living Room:
entities:
- light.light_family_1
- binary_sensor.motion_living
Bedroom: light.light_bedroom, switch.sleeping
Rooms:
view: yes
name: Rooms
entities:
- group.living_room
- group.bedroom
```

View File

@ -22,6 +22,13 @@ If you want to enable the light component directly, add the following lines to y
light:
platform: hue
host: DEVICE_IP_ADDRESS
# Optional, make this unique if specifying multiple Hue hubs
allow_unreachable: true
filename: my_hue_hub_token.conf
```
Configuration variables:
- **host** (*Required*): IP address aof the device, eg. 192.168.1.10.
- **allow_unreachable** (*Optional*): This will allow unreachable bulbs to report their state correctly. By default *name* from the device is used.
- **filename** (*Optional*): Make this unique if specifying multiple Hue hubs.

View File

@ -66,9 +66,9 @@ Configuration variables:
- **brightness_command_topic** (*Optional*): The MQTT topic to publish commands to change the light's brightness.
- **rgb_state_topic** (*Optional*): The MQTT topic subscribed to receive RGB state updates.
- **rgb_command_topic** (*Optional*): The MQTT topic to publish commands to change the light's RGB state.
- **state_value_template** (*Optional*): Defines a [template](/getting-started/templating/) to extract the state value.
- **brightness_value_template** (*Optional*): Defines a [template](/getting-started/templating/) to extract the brightness value.
- **rgb_value_template** (*Optional*): Defines a [template](/getting-started/templating/) to extract the RGB value.
- **state_value_template** (*Optional*): Defines a [template](/topics/templating/) to extract the state value.
- **brightness_value_template** (*Optional*): Defines a [template](/topics/templating/) to extract the brightness value.
- **rgb_value_template** (*Optional*): Defines a [template](/topics/templating/) to extract the RGB value.
- **brightness_scale** (*Optional*): Defines the maximum brightness value (i.e. 100%) of the MQTT device (defaults to 255).
- **qos** (*Optional*): The maximum QoS level of the state topic. Default is 0 and will also be used to publishing messages.
- **payload_on** (*Optional*): The payload that represents enabled state. Default is "ON".

View File

@ -46,7 +46,7 @@ Configuration variables:
- **optimistic** (*Optional*): Flag that defines if lock works in optimistic mode. Default is true if no state topic defined, else false.
- **qos** (*Optional*): The maximum QoS level of the state topic. Default is 0 and will also be used to publishing messages.
- **retain** (*Optional*): If the published message should have the retain flag on or not.
- **value_template** (*Optional*): Defines a [template](/getting-started/templating/) to extract a value from the payload.
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload.
<p class='note warning'>
Make sure that your topic match exact. `some-topic/` and `some-topic` are different topics.

View File

@ -125,18 +125,21 @@ Home Assistant will automatically load the correct certificate if you connect to
## {% linkable_title Building on top of MQTT %}
- [MQTT Alarm control panel](/components/alarm_control_panel.mqtt/)
- [MQTT Binary sensor](/components/binary_sensor.mqtt/)
- [MQTT Sensor](/components/sensor.mqtt/)
- [MQTT Switch](/components/switch.mqtt/)
- [MQTT Light](/components/light.mqtt/)
- [MQTT Lock](/components/lock.mqtt/)
- [MQTT Device Tracker](/components/device_tracker.mqtt/)
- [OwnTracks Device Tracker](/components/device_tracker.owntracks/)
- [MQTT automation rule](/components/automation/#mqtt-based-automation)
- [MQTT alarm](/components/alarm_control_panel.mqtt/)
- Integrating it into own component. See the [MQTT example component](/cookbook/python_component_mqtt_basic/) how to do this.
### {% linkable_title Publish service %}
The MQTT component will register the service `publish` which allows publishing messages to MQTT topics. There are two ways of specifiying your payload. You can either use `payload` to hard-code a payload or use `payload_template` to specify a [template](/getting-started/templating/) that will be rendered to generate the payload.
The MQTT component will register the service `publish` which allows publishing messages to MQTT topics. There are two ways of specifiying your payload. You can either use `payload` to hard-code a payload or use `payload_template` to specify a [template](/topics/templating/) that will be rendered to generate the payload.
```json
{

View File

@ -28,7 +28,7 @@ notify:
Configuration variables:
- **username** (*Required*): Enter your the Google email address you have signed up for Google Voice with. Go to https://www.google.com/voice to setup your Google Voice account.
- **password** (*Required*): Enter the password associated with the above email. Go to https://www.pushbullet.com/ to retrieve your API key.
- **password** (*Required*): Enter the password associated with the above email.
- **name** (*Optional*): Setting the optional parameter `name` allows multiple notifiers to be created. The default value is `notify`. The notifier will bind to the service `notify.NOTIFIER_NAME`.
### Usage

View File

@ -37,7 +37,7 @@ Once loaded, the `notify` platform will expose a service that can be called to s
The notification component supports specifying [templates] for both the `message` and the `title`. This will allow you to use the current state of Home Assistant in your notifications.
[templates]: /getting-started/templating/
[templates]: /topics/templating/
### {% linkable_title Test if it works %}

View File

@ -42,4 +42,4 @@ Configuration variables:
- **payload_up** (*Optional*): The payload to open the rollershutter. Default is "OPEN".
- **payload_down** (*Optional*): The payload to close the rollershutter. Default is "CLOSE".
- **payload_stop** (*Optional*): The payload to stop the rollershutter. Default is "STOP".
- **value_template** (*Optional*): Defines a [template](/getting-started/templating/) to extract a value from the payload.
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload.

View File

@ -8,7 +8,7 @@ comments: false
sharing: true
footer: true
logo: hunter-douglas-powerview.png
ha_category: Organization
ha_category: Rollershutter
---
Implements the [Hunter Douglas PowerView](http://www.hunterdouglas.com/operating-systems/powerview-motorization/support) platform scene control. It queries the PowerView Hub and Home Assistant displays them as scenes.
@ -24,4 +24,4 @@ scene:
Configuration variables:
- **address** (*Required*): IP address of the PowerView Hub, eg. http://192.168.1.10.
- **address** (*Required*): IP address of the PowerView Hub, eg. 192.168.1.10.

View File

@ -45,11 +45,11 @@ Configuration variables:
- **monitored_variables** array (*Optional*): List of exposed variables.
- **name** (*Required*): The name of the variable you wish to monitor.
- **unit** (*Optional*): Defines the units of measurement of the sensor, if any.
- **value_template** (*Optional*): Defines a [template](/getting-started/templating/) to extract a value from the payload.
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload.
- **pins** array (*Optional*): List of pins to monitor. Analog pins need a leading **A** for the pin number.
- **name** (*Optional*): The name of the variable you wish to monitor.
- **unit_of_measurement** (*Optional*): Defines the unit of measurement of the sensor, if any.
- **value_template** (*Optional*): Defines a [template](/getting-started/templating/) to extract a value from the payload.
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload.
The variables in the `monitored_variables` array must be available in the response of the device. As a starting point you could use the one of the example sketches (eg. [Ethernet](https://raw.githubusercontent.com/marcoschwartz/aREST/master/examples/Ethernet/Ethernet.ino) for an Arduino with Ethernet shield). In those sketches are two variables (`temperature` and `humidity`) available which will act as endpoints.

View File

@ -31,7 +31,7 @@ Configuration variables:
- **command** (*Required*): The action to take to get the value.
- **name** (*Optional*): Name of the command sensor.
- **unit_of_measurement** (*Optional*): Defines the unit of measurement of the sensor, if any.
- **value_template** (*Optional*): Defines a [template](/getting-started/templating/) to extract a value from the payload.
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload.
## {% linkable_title Examples %}

View File

@ -33,7 +33,7 @@ Configuration variables:
- **name** (*Optional*): The name of the sensor. Default is 'MQTT Sensor'.
- **qos** (*Optional*): The maximum QoS level of the state topic. Default is 0.
- **unit_of_measurement** (*Optional*): Defines the units of measurement of the sensor, if any.
- **value_template** (*Optional*): Defines a [template](/getting-started/templating/) to extract a value from the payload.
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload.
## {% linkable_title Examples %}

View File

@ -44,7 +44,7 @@ Configuration variables:
- **resource** (*Required*): The resource or endpoint that contains the value.
- **method** (*Optional*): The method of the request. Default is GET.
- **value_template** (*Optional*): Defines a [template](/getting-started/templating/) to extract the value.
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract the value.
- **payload** (*Optional*): The payload to send with a POST request. Usualy formed as a dictionary.
- **name** (*Optional*): Name of the REST sensor.
- **unit_of_measurement** (*Optional*): Defines the unit of measurement of the sensor, if any.

View File

@ -72,4 +72,4 @@ Configuration variables:
- **hour** (*Optional*): Specify the hour(s) of the day to schedule the speedtest. Use a list for multiple entries. Default is None.
- **day** (*Optional*): Specify the day(s) of the month to schedule the speedtest. Use a list for multiple entries. Default is None.
This component uses [speetest-cli](https://github.com/sivel/speedtest-cli) to gather network performance data from Speedtest.net. Please be aware of the potential [inconsistencies](https://github.com/sivel/speedtest-cli#inconsistency) that this component may display.
This component uses [speedtest-cli](https://github.com/sivel/speedtest-cli) to gather network performance data from Speedtest.net. Please be aware of the potential [inconsistencies](https://github.com/sivel/speedtest-cli#inconsistency) that this component may display.

View File

@ -34,7 +34,7 @@ Configuration options for the a TCP Sensor:
- **port** (*Required*): The port to connect to the host on.
- **payload** (*Required*): What to send to the host in order to get the response we're interested in.
- **timeout** (*Optional*): How long in seconds to wait for a response from the service before giving up and disconnecting. Defaults to `10`
- **value_template** (*Optional*): Defines a [template](/getting-started/templating/) to extract the value. By default it's assumed that the entire response is the value.
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract the value. By default it's assumed that the entire response is the value.
- **unit** (*Optional*): The unit of measurement to use for the value.
- **buffer_size** (*Optional*): The size of the receive buffer in bytes. Set this to a larger value if you expect to receive a response larger than the default. Defaults to `1024`.

View File

@ -32,7 +32,7 @@ Configuration variables:
- **sensors** array (*Required*): List of your sensors.
- **friendly_name** (*Optional*): Name to use in the Frontend.
- **unit_of_measurement** (*Optional*): Defines the units of measurement of the sensor, if any.
- **value_template** (*Optional*): Defines a [template](/getting-started/templating/) to extract a value from the payload.
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload.
## {% linkable_title Examples %}

View File

@ -46,7 +46,7 @@ Configuration variables:
- **optimistic** (*Optional*): Flag that defines if switch works in optimistic mode. Default is true if no state topic defined, else false.
- **qos** (*Optional*): The maximum QoS level of the state topic. Default is 0 and will also be used to publishing messages.
- **retain** (*Optional*): If the published message should have the retain flag on or not.
- **value_template** (*Optional*): Defines a [template](/getting-started/templating/) to extract a value from the payload.
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload.
<p class='note warning'>
Make sure that your topic match exact. `some-topic/` and `some-topic` are different topics.

View File

@ -38,7 +38,7 @@ Configuration variables:
- **switches** array (*Required*): List of your switches.
- **friendly_name** (*Optional*): Name to use in the Frontend.
- **value_template** (*Required*): Defines a [template](/getting-started/templating/) to set the state of the switch.
- **value_template** (*Required*): Defines a [template](/topics/templating/) to set the state of the switch.
- **turn_on** (*Required*): Defines an [action](/getting-started/automation/) to run when the switch is turned on.
- **turn_off** (*Required*): Defines an [action](/getting-started/automation/) to run when the switch is turned off.

View File

@ -12,7 +12,7 @@ ha_category: Hub
---
The `tellstick` component integrates [TellStick](http://www.telldus.se/products/tellstick) devices into Home Assistant. This integration allows users to add switches, lights, and sensors which are communicating with 433 Mhz. There are couple of vendors (Capidi Elro, Intertechno, Nexa, Proove, Sartano, and Viking) how are selling products which works with TellStick. For more details, please check the TellStick [compatibility list](http://telldus.se/products/compability).
The `tellstick` component integrates [TellStick](http://www.telldus.se/products/tellstick) devices into Home Assistant. This integration allows users to add switches, lights, and sensors which are communicating with 433 Mhz. There are a number of vendors (Capidi Elro, Intertechno, Nexa, Proove, Sartano, and Viking) who are selling products that work with TellStick. For more details, please check the TellStick [compatibility list](http://telldus.se/products/compability).
To get started, add the devices to your `configuration.yaml` file.

View File

@ -22,7 +22,13 @@ To allow Home Assistant to talk to your Z-Wave USB stick you will have to compil
Make sure you have the correct dependencies installed before running the script:
```bash
$ apt-get install cython3 libudev-dev python3-sphinx python3-setuptools
$ sudo apt-get install cython3 libudev-dev python3-sphinx python3-setuptools
```
Make sure you have at least version 0.23 of cython.
```bash
$ sudo pip3 install --upgrade cython
```
Then get the OpenZWave files and switch to the `python3` branch:
@ -37,7 +43,7 @@ $ sudo PYTHON_EXEC=`which python3` make install
<p class='note'>
Instead of `make install`, you can alternatively build your own python-openzwave package which can be easily uninstalled:
`$ sudo PYTHON_EXEC=`which python3` checkinstall --pkgname python-openzwave --pkgversion 1.0 --provides python-openzwave`
```$ sudo PYTHON_EXEC=`which python3` checkinstall --pkgname python-openzwave --pkgversion 1.0 --provides python-openzwave```
</p>

View File

@ -0,0 +1,13 @@
---
layout: page
title: "Configuration.yaml by brusc"
description: ""
date: 2016-03-14 11:45
sidebar: true
comments: false
sharing: true
footer: true
ha_category: Example configuration.yaml
ha_external_link: https://github.com/brusc/Home-Assistant-Configuration
---

View File

@ -0,0 +1,446 @@
homeassistant:
# Name of the location where Home Assistant is running
name: example.com
# Location required to calculate the time the sun rises and sets
latitude: 37
longitude: -121
# C for Celcius, F for Fahrenheit
temperature_unit: F
# Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
time_zone: America/Los_Angeles
customize:
switch.aeon_labs_smart_energy_switch_switch_2:
friendly_name: Mac Switch-Meter
switch.leviton_unknown_type1a02_id0334_switch_3:
friendly_name: W Nightstand
entity_picture: /local/zwvapl.jpg
switch.hub_switch:
friendly_name: Wink Hub Switch
entity_picture: /local/wemoswitch.jpg
switch.leviton_unknown_type1a02_id0334_switch_4:
friendly_name: Christmas Tree
entity_picture: /local/zwvapl.jpg
switch.leviton_unknown_type1a02_id0334_switch_5:
friendly_name: Roof Lights
entity_picture: /local/zwvapl.jpg
light.w_bedroom_ceiling_:
friendly_name: Will's Bedroom Ceiling Lights (Wink)
entity_picture: /local/casetta.jpg
light.living_room_wall_:
friendly_name: Living Room Couch Lights (Wink)
entity_picture: /local/casetta.jpg
media_player.my_shield_android_tv:
friendly_name: Dalek (Cast)
entity_picture: /local/shieldtv.jpg
media_player.chromecast:
friendly_name: Jeff chromecast
entity_picture: /local/chromecast.jpg
media_player.kodi:
friendly_name: Tardis-Win7 (Kodi)
entity_picture: /local/kodi.png
media_player.kodi_2:
friendly_name: Dalek (Kodi)
media_player.roku_2_xd__12a18n045363:
friendly_name: Parents Roku
entity_picture: /local/roku2xd.jpg
sensor.aeon_labs_smart_energy_switch_power_2:
friendly_name: Mac Usage (W)
sensor.aeon_labs_smart_energy_switch_previous_reading_2:
friendly_name: Mac Usage Previous (W)
hidden: true
sensor.aeon_labs_smart_energy_switch_energy_2:
friendly_name: Mac Usage (kWh)
hidden: true
#####################
## GROUPS
#####################
group:
w_bedroom:
- switch.leviton_unknown_type1a02_id0334_switch_3
- light.w_bedroom_ceiling_
christmas:
- switch.leviton_unknown_type1a02_id0334_switch_4
- switch.leviton_unknown_type1a02_id0334_switch_5
almanac:
- sensor.date
- sensor.time
- sensor.time_utc
- sun.sun
tracker:
- device_tracker.will_wnexus
# OpenWeatherMap:
# - sensor.weather_temperature
# - sensor.weather_humidity
# - sensor.weather_pressure
# - sensor.weather_rain
# - sensor.weather_wind_speed
# - sensor.weather_cloud_coverage
# - sensor.weather_forecast
Meteobridge:
- sensor.outdoor_temp_meteobridge
- sensor.outdoor_humidity_meteobridge
- sensor.outdoor_dewpoint_meteobridge
- sensor.precip_rate_meteobridge
- sensor.wind_direction_meteobridge
- sensor.wind_gust_meteohub
- sensor.wind_chill_meteobridge
- sensor.wind_speed_meteobridge
- sensor.indoor_dewpoint_meteobridge
- sensor.indoor_humidity_meteobridge
- sensor.indoor_temp_meteobridge
- sensor.precip_change_meteobridge
- sensor.precip_total_meteobridge
- sensor.sea_level_pressure_meteobridge
- sensor.barometric_pressure_meteobridge
####################
## ZONES
####################
zone:
name: Home
latitude: 37
longitude: -121
radius: 200
icon: mdi:home
zone 2:
name: Barracuda_(SJ)
latitude: 37
longitude: -121
radius: 100
zone 3:
name: SFC
latitude: 37
longitude: -122
radius: 95
####################
## NOTIFICATIONS
####################
####################
## AUTOMATION
####################
automation:
#- alias: 'W_at_work'
# trigger:
# - platform: zone
# entity_id: device_tracker.will_wnexus
# zone: zone.barracuda_sj
# event: enter
# - platform: time
# after: '07:15'
# before: '09:00'
# action:
# service: ifttt.trigger
# data: {"event":"hassnotification_dadsms", "value1": "Will's at Work"}
- alias: "Update_Update"
trigger:
platform: state
entity_id: updater.updater
action:
service: ifttt.trigger
data: {"event":"hassnotification_willsms","value1":"HASS has an update"}
- alias: 'Christmas Roof ON'
trigger:
platform: sun
event: sunset
offset: '-01:00:00'
action:
service: homeassistant.turn_on
entity_id: switch.leviton_unknown_type1a02_id0334_switch_5
- alias: 'Christmas Roof OFF'
trigger:
platform: time
hours: 1
minutes: 0
seconds: 0
action:
service: homeassistant.turn_off
entity_id: switch.leviton_unknown_type1a02_id0334_switch_5
- alias: 'Christmas Tree ON'
trigger:
platform: time
hours: 8
minutes: 0
seconds: 0
action:
service: homeassistant.turn_on
entity_id: switch.leviton_unknown_type1a02_id0334_switch_4
- alias: 'Christmas Tree (OFF)'
trigger:
platform: time
hours: 23
minutes: 0
seconds: 0
action:
service: homeassistant.turn_off
entity_id: switch.leviton_unknown_type1a02_id0334_switch_4
#- alias: test notify
# trigger:
# platform: time
# minutes: '/5' #every 5 min
# action:
# service: notify.pushEtta
# data:
# message: 5 Min Test
#################################
### COMPONENTS ###
#################################
#discovery:
sun:
#updater:
history:
#conversation:
frontend:
logbook:
http:
api_password: Austin12#
server_port: 8123
ssl_certificate: /etc/letsencrypt/live/example.com/fullchain.pem
ssl_key: /etc/letsencrypt/live/example.com/privkey.pem
ifttt:
key: gm3dAtxwX8RpbA793mHWbK1bftO1wgScKt0ZHiT9GyC
media_player 1:
platform: plex
#media_player 2:
# platform: squeezebox
# host: 192.168.2.80
# port: 9000
media_player 3:
platform: cast
media_player 4:
platform: kodi
url: http://192.168.2.129:8080/jsonrpc
user: kodi
password: kodi
media_player 5:
platform: plex
media_player 6:
platform: kodi
url: http://192.168.2.165/jsonrpc
media_player 7:
platform: samsungtv
host: 192.168.2.90
name: Parents TV
wink:
access_token: cf83448f669cd3acd3b969b063028565
refresh_token: 6213c8a1d519d864e08b7364c91eaf22
zwave:
usb_path: /dev/ttyUSB0
config_path: /usr/local/share/python-openzwave/config
polling_interval: 10000
#zigbee:
# device: /dev/ttyUSB1
# baud: 115200
mqtt:
broker: 127.0.0.1
port: 8883
username: hass
password: austin
device_tracker 1:
platform: owntracks
track_new_devices: yes
interval_seconds: 40
consider_home: 120
device_tracker 2:
platform: nmap_tracker
hosts: 192.168.2.0/24
home_interval: 3
#sensor:
# platform: openweathermap
# api_key: b693a8bb2f60dcedc7b4bf33649ed4f1
# forecast: 1
# monitored_conditions:
# - temperature
# - wind_speed
# - humidity
# - pressure
# - clouds
# - rain
sensor 2:
platform: time_date
display_options:
- 'time'
- 'date'
- 'time_utc'
### BEGIN METEO SENSORS ###
sensor 3:
platform: tcp
name: Outdoor Temp (Meteobridge)
host: 192.168.2.82
port: 5556
timeout: 6
payload: "Content-type: text/xml; charset=UTF-8\n\n"
value_template: "{{value.split (' ')[2]}}"
unit: C
sensor 4:
platform: tcp
name: Outdoor Humidity (Meteobridge)
host: 192.168.2.82
port: 5556
timeout: 6
payload: "Content-type: text/xml; charset=UTF-8\n\n"
value_template: "{{value.split (' ')[3]}}"
unit: Percent
sensor 5:
platform: tcp
name: Outdoor Dewpoint (Meteobridge)
host: 192.168.2.82
port: 5556
timeout: 6
payload: "Content-type: text/xml; charset=UTF-8\n\n"
value_template: "{{value.split (' ')[4] }}"
unit: C
sensor 6:
platform: tcp
name: Wind Direction (Meteobridge)
host: 192.168.2.82
port: 5556
timeout: 6
payload: "Content-type: text/xml; charset=UTF-8\n\n"
value_template: "{{value.split (' ')[7]}}"
unit: Degrees
sensor 7:
platform: tcp
name: Wind Gust (Meteohub)
host: 192.168.2.82
port: 5556
timeout: 6
payload: "Content-type: text/xml; charset=UTF-8\n\n"
value_template: "{{value.split (' ')[8]}}"
unit: m/s
sensor 8:
platform: tcp
name: Wind Speed (Meteobridge)
host: 192.168.2.82
port: 5556
timeout: 6
payload: "Content-type: text/xml; charset=UTF-8\n\n"
value_template: "{{value.split (' ')[9]}}"
unit: m/s
sensor 9:
platform: tcp
name: Wind Chill (Meteobridge)
host: 192.168.2.82
port: 5556
timeout: 6
payload: "Content-type: text/xml; charset=UTF-8\n\n"
value_template: "{{value.split (' ')[10]}}"
unit: C
sensor 10:
platform: tcp
name: Precip Rate (Meteobridge)
host: 192.168.2.82
port: 5556
timeout: 6
payload: "Content-type: text/xml; charset=UTF-8\n\n"
value_template: "{{value.split (' ')[13]}}"
unit: mm/hr
sensor 11:
platform: tcp
name: Precip Total (Meteobridge)
host: 192.168.2.82
port: 5556
timeout: 6
payload: "Content-type: text/xml; charaset=UTF-8\n\n"
value_template: "{{value.split (' ')[14]}}"
unit: mm
sensor 12:
platform: tcp
name: Precip Change (Meteobridge)
host: 192.168.2.82
port: 5556
timeout: 6
payload: "Content-type: text/xml; charaset=UTF-8\n\n"
value_template: "{{value.split (' ')[15]}}"
unit: mm
sensor 13:
platform: tcp
name: Indoor Temp (Meteobridge)
host: 192.168.2.82
port: 5556
timeout: 6
payload: "Content-type: text/xml; charaset=UTF-8\n\n"
value_template: "{{value.split (' ')[18]}}"
unit: C
sensor 14:
platform: tcp
name: Indoor Humidity (Meteobridge)
host: 192.168.2.82
port: 5556
timeout: 6
payload: "Content-type: text/xml; charaset=UTF-8\n\n"
value_template: "{{value.split (' ')[19]}}"
unit: percent
sensor 15:
platform: tcp
name: Indoor Dewpoint (Meteobridge)
host: 192.168.2.82
port: 5556
timeout: 6
payload: "Content-type: text/xml; charaset=UTF-8\n\n"
value_template: "{{value.split (' ')[20]}}"
unit: C
sensor 16:
platform: tcp
name: Barometric Pressure (Meteobridge)
host: 192.168.2.82
port: 5556
timeout: 6
payload: "Content-type: text/xml; charaset=UTF-8\n\n"
value_template: "{{value.split (' ')[21]}}"
unit: mb
sensor 17:
platform: tcp
name: Sea Level Pressure (Meteobridge)
host: 192.168.2.82
port: 5556
timeout: 6
payload: "Content-type: text/xml; charaset=UTF-8\n\n"
value_template: "{{value.split (' ')[22]}}"
unit: mb
sensor 18:
platform: steam_online
api_key: [Redact]
accounts:
- 76561198012067051
switch:
platform: wemo

View File

@ -0,0 +1,460 @@
---
layout: page
title: "Configuration.yaml by bassclarinetl2"
description: ""
date: 2016-03-24 17:00
sidebar: true
comments: false
sharing: true
footer: true
ha_category: Example configuration.yaml
---
```yaml
homeassistant:
# Name of the location where Home Assistant is running
name: example.com
# Location required to calculate the time the sun rises and sets
latitude: 37
longitude: -121
# C for Celcius, F for Fahrenheit
temperature_unit: F
# Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
time_zone: America/Los_Angeles
customize:
switch.aeon_labs_smart_energy_switch_switch_2:
friendly_name: Mac Switch-Meter
switch.leviton_unknown_type1a02_id0334_switch_3:
friendly_name: W Nightstand
entity_picture: /local/zwvapl.jpg
switch.hub_switch:
friendly_name: Wink Hub Switch
entity_picture: /local/wemoswitch.jpg
switch.leviton_unknown_type1a02_id0334_switch_4:
friendly_name: Christmas Tree
entity_picture: /local/zwvapl.jpg
switch.leviton_unknown_type1a02_id0334_switch_5:
friendly_name: Roof Lights
entity_picture: /local/zwvapl.jpg
light.w_bedroom_ceiling_:
friendly_name: Will's Bedroom Ceiling Lights (Wink)
entity_picture: /local/casetta.jpg
light.living_room_wall_:
friendly_name: Living Room Couch Lights (Wink)
entity_picture: /local/casetta.jpg
media_player.my_shield_android_tv:
friendly_name: Dalek (Cast)
entity_picture: /local/shieldtv.jpg
media_player.chromecast:
friendly_name: Jeff chromecast
entity_picture: /local/chromecast.jpg
media_player.kodi:
friendly_name: Tardis-Win7 (Kodi)
entity_picture: /local/kodi.png
media_player.kodi_2:
friendly_name: Dalek (Kodi)
media_player.roku_2_xd__12a18n045363:
friendly_name: Parents Roku
entity_picture: /local/roku2xd.jpg
sensor.aeon_labs_smart_energy_switch_power_2:
friendly_name: Mac Usage (W)
sensor.aeon_labs_smart_energy_switch_previous_reading_2:
friendly_name: Mac Usage Previous (W)
hidden: true
sensor.aeon_labs_smart_energy_switch_energy_2:
friendly_name: Mac Usage (kWh)
hidden: true
#####################
## GROUPS
#####################
group:
w_bedroom:
- switch.leviton_unknown_type1a02_id0334_switch_3
- light.w_bedroom_ceiling_
christmas:
- switch.leviton_unknown_type1a02_id0334_switch_4
- switch.leviton_unknown_type1a02_id0334_switch_5
almanac:
- sensor.date
- sensor.time
- sensor.time_utc
- sun.sun
tracker:
- device_tracker.will_wnexus
# OpenWeatherMap:
# - sensor.weather_temperature
# - sensor.weather_humidity
# - sensor.weather_pressure
# - sensor.weather_rain
# - sensor.weather_wind_speed
# - sensor.weather_cloud_coverage
# - sensor.weather_forecast
Meteobridge:
- sensor.outdoor_temp_meteobridge
- sensor.outdoor_humidity_meteobridge
- sensor.outdoor_dewpoint_meteobridge
- sensor.precip_rate_meteobridge
- sensor.wind_direction_meteobridge
- sensor.wind_gust_meteohub
- sensor.wind_chill_meteobridge
- sensor.wind_speed_meteobridge
- sensor.indoor_dewpoint_meteobridge
- sensor.indoor_humidity_meteobridge
- sensor.indoor_temp_meteobridge
- sensor.precip_change_meteobridge
- sensor.precip_total_meteobridge
- sensor.sea_level_pressure_meteobridge
- sensor.barometric_pressure_meteobridge
####################
## ZONES
####################
zone:
name: Home
latitude: 37
longitude: -121
radius: 200
icon: mdi:home
zone 2:
name: Barracuda_(SJ)
latitude: 37
longitude: -121
radius: 100
zone 3:
name: SFC
latitude: 37
longitude: -122
radius: 95
####################
## NOTIFICATIONS
####################
####################
## AUTOMATION
####################
automation:
#- alias: 'W_at_work'
# trigger:
# - platform: zone
# entity_id: device_tracker.will_wnexus
# zone: zone.barracuda_sj
# event: enter
# - platform: time
# after: '07:15'
# before: '09:00'
# action:
# service: ifttt.trigger
# data: {"event":"hassnotification_dadsms", "value1": "Will's at Work"}
- alias: "Update_Update"
trigger:
platform: state
entity_id: updater.updater
action:
service: ifttt.trigger
data: {"event":"hassnotification_willsms","value1":"HASS has an update"}
- alias: 'Christmas Roof ON'
trigger:
platform: sun
event: sunset
offset: '-01:00:00'
action:
service: homeassistant.turn_on
entity_id: switch.leviton_unknown_type1a02_id0334_switch_5
- alias: 'Christmas Roof OFF'
trigger:
platform: time
hours: 1
minutes: 0
seconds: 0
action:
service: homeassistant.turn_off
entity_id: switch.leviton_unknown_type1a02_id0334_switch_5
- alias: 'Christmas Tree ON'
trigger:
platform: time
hours: 8
minutes: 0
seconds: 0
action:
service: homeassistant.turn_on
entity_id: switch.leviton_unknown_type1a02_id0334_switch_4
- alias: 'Christmas Tree (OFF)'
trigger:
platform: time
hours: 23
minutes: 0
seconds: 0
action:
service: homeassistant.turn_off
entity_id: switch.leviton_unknown_type1a02_id0334_switch_4
#- alias: test notify
# trigger:
# platform: time
# minutes: '/5' #every 5 min
# action:
# service: notify.pushEtta
# data:
# message: 5 Min Test
#################################
### COMPONENTS ###
#################################
#discovery:
sun:
#updater:
history:
#conversation:
frontend:
logbook:
http:
api_password: Austin12#
server_port: 8123
ssl_certificate: /etc/letsencrypt/live/example.com/fullchain.pem
ssl_key: /etc/letsencrypt/live/example.com/privkey.pem
ifttt:
key: gm3dAtxwX8RpbA793mHWbK1bftO1wgScKt0ZHiT9GyC
media_player 1:
platform: plex
#media_player 2:
# platform: squeezebox
# host: 192.168.2.80
# port: 9000
media_player 3:
platform: cast
media_player 4:
platform: kodi
url: http://192.168.2.129:8080/jsonrpc
user: kodi
password: kodi
media_player 5:
platform: plex
media_player 6:
platform: kodi
url: http://192.168.2.165/jsonrpc
media_player 7:
platform: samsungtv
host: 192.168.2.90
name: Parents TV
wink:
access_token: cf83448f669cd3acd3b969b063028565
refresh_token: 6213c8a1d519d864e08b7364c91eaf22
zwave:
usb_path: /dev/ttyUSB0
config_path: /usr/local/share/python-openzwave/config
polling_interval: 10000
#zigbee:
# device: /dev/ttyUSB1
# baud: 115200
mqtt:
broker: 127.0.0.1
port: 8883
username: hass
password: austin
device_tracker 1:
platform: owntracks
track_new_devices: yes
interval_seconds: 40
consider_home: 120
device_tracker 2:
platform: nmap_tracker
hosts: 192.168.2.0/24
home_interval: 3
#sensor:
# platform: openweathermap
# api_key: b693a8bb2f60dcedc7b4bf33649ed4f1
# forecast: 1
# monitored_conditions:
# - temperature
# - wind_speed
# - humidity
# - pressure
# - clouds
# - rain
sensor 2:
platform: time_date
display_options:
- 'time'
- 'date'
- 'time_utc'
### BEGIN METEO SENSORS ###
sensor 3:
platform: tcp
name: Outdoor Temp (Meteobridge)
host: 192.168.2.82
port: 5556
timeout: 6
payload: "Content-type: text/xml; charset=UTF-8\n\n"
value_template: "{{value.split (' ')[2]}}"
unit: C
sensor 4:
platform: tcp
name: Outdoor Humidity (Meteobridge)
host: 192.168.2.82
port: 5556
timeout: 6
payload: "Content-type: text/xml; charset=UTF-8\n\n"
value_template: "{{value.split (' ')[3]}}"
unit: Percent
sensor 5:
platform: tcp
name: Outdoor Dewpoint (Meteobridge)
host: 192.168.2.82
port: 5556
timeout: 6
payload: "Content-type: text/xml; charset=UTF-8\n\n"
value_template: "{{value.split (' ')[4] }}"
unit: C
sensor 6:
platform: tcp
name: Wind Direction (Meteobridge)
host: 192.168.2.82
port: 5556
timeout: 6
payload: "Content-type: text/xml; charset=UTF-8\n\n"
value_template: "{{value.split (' ')[7]}}"
unit: Degrees
sensor 7:
platform: tcp
name: Wind Gust (Meteohub)
host: 192.168.2.82
port: 5556
timeout: 6
payload: "Content-type: text/xml; charset=UTF-8\n\n"
value_template: "{{value.split (' ')[8]}}"
unit: m/s
sensor 8:
platform: tcp
name: Wind Speed (Meteobridge)
host: 192.168.2.82
port: 5556
timeout: 6
payload: "Content-type: text/xml; charset=UTF-8\n\n"
value_template: "{{value.split (' ')[9]}}"
unit: m/s
sensor 9:
platform: tcp
name: Wind Chill (Meteobridge)
host: 192.168.2.82
port: 5556
timeout: 6
payload: "Content-type: text/xml; charset=UTF-8\n\n"
value_template: "{{value.split (' ')[10]}}"
unit: C
sensor 10:
platform: tcp
name: Precip Rate (Meteobridge)
host: 192.168.2.82
port: 5556
timeout: 6
payload: "Content-type: text/xml; charset=UTF-8\n\n"
value_template: "{{value.split (' ')[13]}}"
unit: mm/hr
sensor 11:
platform: tcp
name: Precip Total (Meteobridge)
host: 192.168.2.82
port: 5556
timeout: 6
payload: "Content-type: text/xml; charaset=UTF-8\n\n"
value_template: "{{value.split (' ')[14]}}"
unit: mm
sensor 12:
platform: tcp
name: Precip Change (Meteobridge)
host: 192.168.2.82
port: 5556
timeout: 6
payload: "Content-type: text/xml; charaset=UTF-8\n\n"
value_template: "{{value.split (' ')[15]}}"
unit: mm
sensor 13:
platform: tcp
name: Indoor Temp (Meteobridge)
host: 192.168.2.82
port: 5556
timeout: 6
payload: "Content-type: text/xml; charaset=UTF-8\n\n"
value_template: "{{value.split (' ')[18]}}"
unit: C
sensor 14:
platform: tcp
name: Indoor Humidity (Meteobridge)
host: 192.168.2.82
port: 5556
timeout: 6
payload: "Content-type: text/xml; charaset=UTF-8\n\n"
value_template: "{{value.split (' ')[19]}}"
unit: percent
sensor 15:
platform: tcp
name: Indoor Dewpoint (Meteobridge)
host: 192.168.2.82
port: 5556
timeout: 6
payload: "Content-type: text/xml; charaset=UTF-8\n\n"
value_template: "{{value.split (' ')[20]}}"
unit: C
sensor 16:
platform: tcp
name: Barometric Pressure (Meteobridge)
host: 192.168.2.82
port: 5556
timeout: 6
payload: "Content-type: text/xml; charaset=UTF-8\n\n"
value_template: "{{value.split (' ')[21]}}"
unit: mb
sensor 17:
platform: tcp
name: Sea Level Pressure (Meteobridge)
host: 192.168.2.82
port: 5556
timeout: 6
payload: "Content-type: text/xml; charaset=UTF-8\n\n"
value_template: "{{value.split (' ')[22]}}"
unit: mb
sensor 18:
platform: steam_online
api_key: [Redact]
accounts:
- 76561198012067051
switch:
platform: wemo
```

View File

@ -10,34 +10,116 @@ footer: true
ha_category: Custom Python Component Examples
---
This is a simple hello world example to show the basics for setting a state. To use this example, create the file `<config dir>/custom_components/hello_state.py` and copy the below example code.
This is a simple tutorial/example on how to write a component for [Home Assistant](https://home-assistant.io/). We will work on a component called "hello_state" to beginn with. The purpose of this component is to display a given text in the frontend.
The setup of a development environment is described in the [Developers section](/developers/#starting-development) of the documentation.
## {% linkable_title Component %}
To get started, create the file `<config dir>/custom_components/hello_state.py` and copy the below example code.
```python
# The domain of your component. Should be equal to the name of your component.
"""
Support for showing text in the frontend.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/hello_state/
"""
import logging
_LOGGER = logging.getLogger(__name__)
DOMAIN = 'hello_state'
DEPENDENCIES = []
CONF_NAME = 'name'
DEFAULT_NAME = 'World'
def setup(hass, config=None):
"""Setup the Hello State component. """
_LOGGER.info("The 'hello state' component is ready!")
def setup(hass, config):
"""Setup is called when Home Assistant is loading our component."""
# Get the name from the configuration. Use DEFAULT_NAME if no name provided.
name = config[DOMAIN].get(CONF_NAME, DEFAULT_NAME)
# States are in the format DOMAIN.OBJECT_ID
hass.states.set('hello_state.hello', name)
# Return boolean to indicate that initialization was successfully.
return True
```
Load the component by adding the following to your `configuration.yaml`:
1. In the file header we decided to add some details: A short description and the link to the documentation.
2. We want to do some logging. This means that we import the Python logging module and create an alias.
3. The component name is equal to the domain name.
4. At the moment this component has no dependencies. For detail check [dependencies](/developers/creating_components/#dependencies) section.
5. The `setup` function will take care of the initialization of our component.
The component will only write a log message. Keep in mind for later that you have several options for the severity:
- `_LOGGER.info(msg)`
- `_LOGGER.warning(msg)`
- `_LOGGER.error(msg)`
- `_LOGGER.critical(msg)`
- `_LOGGER.exception(msg)`
7. We return `True` if everything is ok.
Add the component to your `configuration.yaml` file.
```yaml
# configuration.yaml entry
hello_state:
# optional
name: Paulus
```
After a start or a restart of Home Assistant the component will create an entry in the log.
```bash
16-03-12 14:16:42 INFO (MainThread) [custom_components.hello_state] The 'hello state' component is ready!
```
The next step is the introduction of configuration options. Most configuration details are coming out of the `configuration.yaml` file. To do that we need to update the `def setup()` method to accept configuration information and access the configuration variable in the `setup` method.
More details about this topic can be found in the [User given configuration](/developers/creating_components/#config-user-given-configuration) section.
```python
import logging
_LOGGER = logging.getLogger(__name__)
DOMAIN = 'hello_state'
DEPENDENCIES = []
CONF_TEXT = 'text'
DEFAULT_TEXT = 'No text!'
def setup(hass, config):
"""Setup the Hello State component. """
# Get the text from the configuration. Use DEFAULT_TEXT if no name is provided.
text = config[DOMAIN].get(CONF_TEXT, DEFAULT_TEXT)
# States are in the format DOMAIN.OBJECT_ID
hass.states.set('hello_state.Hello_State', text)
return True
```
To add the latest feature of our component, update the entry in your `configuration.yaml` file.
```yaml
information:
text: 'Hello, World!'
```
Thanks to `DEFAULT_TEXT` variable the component will launch even if no `text:` field is used in the `configuration.yaml` file. Quite often there are variables which are required. It's important to check if all mandatory configuration variables are provided. If not, the setup should fail. We will use the `validate_config` function as a helper to achive this. The next listing shows the essential parts.
```python
from homeassistant.helpers import validate_config
[...]
if not validate_config(config, {DOMAIN: [CONF_TEXT]}, _LOGGER):
return False
```
If `text:` is missing, there will be a warning in the log file.
```bash
16-03-12 14:37:37 ERROR (MainThread) [custom_components.hello_state] Missing required configuration items in hello_state: text
16-03-12 14:37:37 ERROR (MainThread) [homeassistant.bootstrap] component hello_state failed to initialize
```
After a start or a restart of Home Assistant the component will be visible in the frontend if the `configuration.yaml` file is up-to-date.
<p class='img'>
<img src='/images/screenshots/create-component01.png' />
</p>
To get your component included in the Home Assistant releases, follow the steps described in the [Submitting improvements](https://home-assistant.io/developers/#submitting-improvements) section. Basically you only need to move your component in the `homeassistant/component/` directory of your fork and create a Pull Request.

View File

@ -3,11 +3,11 @@
<a>Getting started <i class="icon icon-caret-down"></i></a>
<ul>
<li><a href='/getting-started/'>Installing Home Assistant</a></li>
<li><a href='/getting-started/configuration/'>Configuration basics</a></li>
<li><a href='/getting-started/configuration/'>Configuration Basics</a></li>
<li><a href='/getting-started/devices/'>Adding devices</a></li>
<li><a href='/getting-started/presence-detection/'>Presence detection</a></li>
<li><a href='/getting-started/presence-detection/'>Presence Detection</a></li>
<li><a href='/getting-started/automation/'>Automation</a></li>
<li><a href='/getting-started/templating/'>Templating</a></li>
<li><a href='/topics/'>Advanced Topics</a></li>
</ul>
</li>
<li><a href='/components/'>Components</a></li>
@ -17,12 +17,12 @@
<ul>
<li><a href="/developers/">Setup Development</a></li>
<li><a href="/developers/architecture/">Architecture</a></li>
<li><a href="/developers/frontend/">Frontend development</a></li>
<li><a href="/developers/frontend/">Frontend Development</a></li>
<li><a href="/developers/creating_components/">
Creating components
Creating Components
</a></li>
<li><a href="/developers/add_new_platform/">
Adding platform support
Adding Platform Support
</a></li>
<li><a href="/developers/api/">API</a></li>
<li><a href="/developers/credits/">Credits</a></li>

View File

@ -34,7 +34,7 @@ Alrighty, it's time for Home Assistant 0.10. A lot amazing things have changed a
[iCloud]: /components/device_tracker.icloud/
[Twitch]: /components/sensor.twitch/
[Template]: /getting-started/templating/
[Template]: /topics/templating/
[Heatmiser]: /components/thermostat.heatmiser/
[Dweet.io]: /components/sensor.dweet/
[Alexa/Amazon echo]: /components/alexa/

View File

@ -47,7 +47,7 @@ First release of 2016 and we are on 🔥! The [main repository][github-ha] has p
[wemo]: /components/switch.wemo/
[Telldus Live]: /components/tellduslive/
[Vera]: /components/vera/
[template helper method]: /getting-started/templating/#home-assistant-template-extensions
[template helper method]: /topics/templating/#home-assistant-template-extensions
[OwnTracks]: /components/device_tracker.owntracks/
[Philips Hue]: /components/light.hue/
[Free Mobile]: /components/notify.free_mobile/

View File

@ -111,14 +111,14 @@ mqtt:
broker: localhost
```
Replace `localhost` with the location of the running MQTT Broker. Devices from the MQTT Bridge are published to the path `/smartthings/<Device Name>/<Atribute>`
Replace `localhost` with the location of the running MQTT Broker. Devices from the MQTT Bridge are published to the path `smartthings/<Device Name>/<Atribute>`
For example, my Dimmer Z-Wave Lamp is called "Fireplace Lights" in SmartThings. The following topics are published:
| Topic | Description
| ----- | -----------
| /smartthings/Fireplace Lights/level | Brightness (0-99)
| /smartthings/Fireplace Lights/switch | Switch State (on/off)
| smartthings/Fireplace Lights/level | Brightness (0-99)
| smartthings/Fireplace Lights/switch | Switch State (on/off)
Here is an example Home Assistant config:
@ -126,10 +126,10 @@ Here is an example Home Assistant config:
switch:
platform: mqtt
name: "Fireplace Lights"
state_topic: "/smartthings/Fireplace Lights/switch"
command_topic: "/smartthings/Fireplace Lights/switch"
brightness_state_topic: "/smartthings/Fireplace Lights/level"
brightness_command_topic: "/smartthings/Fireplace Lights/level"
state_topic: "smartthings/Fireplace Lights/switch"
command_topic: "smartthings/Fireplace Lights/switch"
brightness_state_topic: "smartthings/Fireplace Lights/level"
brightness_command_topic: "smartthings/Fireplace Lights/level"
payload_on: "on"
payload_off: "off"
retain: true

View File

@ -31,7 +31,7 @@ Haaska allows you to control lights, switches, and scenes exposed by your Home A
### {% linkable_title Integrating Home Assistant with HomeKit %}
Contributor Maddox has created a plugin for HomeBridge, an open-source HomeKit bridge. This will allow you to control your home using Siri on your Apple devices. HomeBridge has recently restructured so you'll have to access the plugin in the legacy plugin package.
Contributor Maddox has created a plugin for HomeBridge, an open-source HomeKit bridge. This will allow you to control your home using Siri on your Apple devices. HomeBridge has recently restructured so you'll have to install the plugin separately with the homebridge-homeassistant npm package.
Example config.json entry to load Home Assistant:
@ -48,8 +48,7 @@ Example config.json entry to load Home Assistant:
```
[HomeBridge on GitHub](https://github.com/nfarina/homebridge)
[HomeBridge Legacy Plugins on GitHub](https://github.com/nfarina/homebridge-legacy-plugins)
[Home Assistant on HomeBridge instructions](https://github.com/nfarina/homebridge-legacy-plugins/blob/master/platforms/HomeAssistant.js)
[HomeBridge Home Assistant Plugin](https://github.com/maddox/homebridge-homeassistant)
### {% linkable_title Custom alarm system with Home Assistant %}
@ -58,4 +57,4 @@ User thaijames [describes in the Home Assistant forums](https://automic.us/forum
<p class='img'>
<img src='/images/blog/2016-02-community-highlights/garfield-nfc.png'>
Hold your NFC tag against the belly of Garfield to unlock the alarm.
</p>
</p>

View File

@ -14,7 +14,7 @@ Two weeks has past so here is 0.15! We have been focussing a lot on quality. Mak
- [@fabaff] has upgraded the codebase to follow the PEP257 documentation standard.
- [@partofthething] has migrated us to use the main Python Open Z-Wave library instead of our forked version.
- To make our automations more powerful, [@persandstrom] added the option to use templates to dynamically create service calls. This works for automation, script, Alexa, universal media player, template switch.
- To make our automations more powerful, [@persandstrom] added the option to use templates to dynamically create service calls. This works for automation, Alexa, universal media player, template switch. [Learn more.][services]
- [@MartinHjelmare] has upgraded our scene support to now support all built-in services and components.
Besides bug fixes, this release also brings:
@ -29,7 +29,7 @@ Besides bug fixes, this release also brings:
```yaml
# Example using templates for service and data in service call.
# Works for automation, script, Alexa, universal media player, template switch.
# Works for automation, Alexa, universal media player, template switch.
automation:
- trigger:
- platform: state
@ -45,6 +45,13 @@ automation:
entity_id: switch.{% raw %}{{ states('input_select.is') }}{% endraw %}
```
### Breaking Changes
- Media Player: Attributes to call service play_media has been renamed to
`media_content_type` and `media_content_id`, to match the corresponding media
player state attributes. This change affects automations, scripts and scenes.
[services]: /topics/service_calls/#use-templates-to-decide-which-service-to-call
[Hunter Douglas Powerview]: /components/scene.hunterdouglas_powerview/
[MQTT]: /components/lock.mqtt/
[OwnTracks]: /components/device_tracker.owntracks/

View File

@ -0,0 +1,84 @@
---
layout: page
title: "Events"
description: "Describes all there is to know about events in Home Assistant."
date: 2016-03-12 12:00 -0800
sidebar: false
comments: false
sharing: true
footer: true
---
The core of Home Assistant is the event bus. The event bus allows any component to fire or listen for events. It is the core of everything. For example, any state change will be announced on the event bus as a `state_changed` event containing the previous and the new state of an entity.
Home Assistant contains a few built-in events that are used to coordinate between various components.
### {% linkable_title Event `homeassistant_start` %}
Event `homeassistant_start` is fired when all components from the configuration have been intitialized. This is the event that will start the timer firing off `time_changed` events.
### {% linkable_title Event `homeassistant_stop` %}
Event `homeassistant_stop` is fired when Home Assistant is shutting down. It should be used to close any open connection or release any resources.
### {% linkable_title Event `state_changed` %}
Event `state_changed` is fired when a state changes. Both `old_state` and `new_state` are state objects. [Documentation about state objects.](/topics/state_object/)
Field | Description
----- | -----------
`entity_id` | Entity ID of the changed entity. Example: `light.kitchen`
`old_state` | The previous state of the entity before it changed. This field is ommitted if the entity is new.
`new_state` | The new state of the entity. This field is ommitted if the entity is removed from the state machine.
### {% linkable_title Event `time_changed` %}
Event `time_changed` is fired every second by the timer and contains the current time.
Field | Description
----- | -----------
`now` | A [datetime object](https://docs.python.org/3.4/library/datetime.html#datetime.datetime) containing the current time in UTC.
### {% linkable_title Event `service_registered` %}
Event `service_registered` is fired when a new service has been registered within Home Assistant.
Field | Description
----- | -----------
`domain` | Domain of the service. Example: `light`.
`service` | The service to call. Example: `turn_on`
### {% linkable_title Event `call_service` %}
Event `call_service` is fired to call a service.
Field | Description
----- | -----------
`domain` | Domain of the service. Example: `light`.
`service` | The service to call. Example: `turn_on`
`service_data` | Dictionary with the service call parameters. Example: `{ 'brightness': 120 }`.
`service_call_id` | String with a unique call id. Example: `23123-4`.
### {% linkable_title Event `service_executed` %}
Event `service_executed` is fired by the service handler to indicate the service is done.
Field | Description
----- | -----------
`service_call_id` | String with the unique call id of the service call that was executed. Example: `23123-4`.
### {% linkable_title Event `platform_discovered` %}
Event `platform_discovered` is fired when a new platform has been discovered by the discovery component.
Field | Description
----- | -----------
`service` | The service that is discovered. Example: `zwave`.
`discovered` | Information that is discovered. Can be a dict, tuple etc. Example: `(192.168.1.10, 8889)`.
### {% linkable_title Event `component_loaded` %}
Event `component_loaded` is fired when a new component has been loaded and initialized.
Field | Description
----- | -----------
`component` | Domain of the component that has just been initialized. Example: `light`.

View File

@ -0,0 +1,93 @@
---
layout: page
title: "Service Calls"
description: "Instructions how to call services in Home Assistant."
date: 2016-03-12 12:00 -0800
sidebar: false
comments: false
sharing: true
footer: true
---
Various components allow calling services when a certain event occurs. The most common one is calling a service when an automation trigger happens. But a service can also be called from a script or via the Amazon Echo.
The configuration options to call a config are the same between all components and are described on this page.
Examples on this page will be given as part of an automation component configuration but different approaches can be used for other components too.
<p class='note'>
Use the service developer tool in the frontend to discover available services.
</p>
### {% linkable_title The basics %}
Call the service `homeassistant.turn_on` on the entity `group.living_room`. This will turn all members of `group.living_room` on. You can also omit `entity_id` and it will turn on all possible entities.
```yaml
automation:
- trigger:
platform: sun
event: sunset
action:
service: homeassistant.turn_on
entity_id: group.living_room
```
### {% linkable_title Passing data to the service call %}
You can also specify other parameters beside the entity to target. For example, the light turn on service allows specifying the brightness.
```yaml
automation:
- trigger:
platform: sun
event: sunset
action:
service: light.turn_on
entity_id: group.living_room
data:
brightness: 120
rgb_color: [255, 0, 0]
```
### {% linkable_title Use templates to decide which service to call %}
You can use [templating] support to dynamically choose which service to call. For example, you can call a certain service based on if a light is on.
```yaml
automation:
- trigger:
platform: sun
event: sunset
action:
service_template: >
{% raw %}{% if states.sensor.temperature | float > 15 %}
switch.turn_on
{% else %}
switch.turn_off
{% endif %}{% endraw %}
entity_id: switch.ac
```
### {% linkable_title Use templates to determine the attributes %}
Templates can also be used for the data that you pass to the service call.
```yaml
automation:
- trigger:
platform: sun
event: sunset
action:
service_template: thermostat.set_temperature
data_template:
entity_id: >
{% raw %}{% if is_state('device_tracker.paulus', 'home') %}
thermostat.upstairs
{% else %}
thermostat.downstairs
{% endif %}{% endraw %}
temperature: {% raw %}{{ 22 - distance(states.device_tracker.paulus) }}{% endraw %}
```
[templating]: /topics/templating/

View File

@ -0,0 +1,301 @@
---
layout: page
title: "Splitting up the configuration"
description: "Splitting the configuration.yaml into several files."
date: 2016-03-25 23:30
sidebar: false
comments: false
sharing: true
footer: true
---
So you've been using Home Assistant (HA, hass, or any number of other abbreviations) for a while now and your configuration.yaml file brings people to tears (https://home-assistant.io/cookbook/configuration_yaml_from_bassclarinetl2/) or you simply want to start off with the distributed approach, here's how to "split the configuration.yaml" into more manageable (read: husmanly readable) pieces.
First off, several community members have sanitized (read: without api keys/passwords etc) versions of their configurations available for viewing:
- https://github.com/bassclarinetl2/HASS
- https://github.com/happyleavesaoc/my-home-automation/tree/master/homeassistant
As commenting code doesn't always happen, please read on for the details.
Now despite the logical assumption that the configuration.yaml will be replaced by this process it will in fact remain all be it in a much less cluttered form.
In this lighter version we will still need what could be called the core snippet:
homeassistant:
# Name of the location where Home Assistant is running
name: My Hass Instance
# Location required to calculate the time the sun rises and sets
latitude: 37
longitude: -121
# C for Celcius, F for Fahrenheit
temperature_unit: F
# Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
time_zone: America/Los_Angeles
customize: !include customize.yaml
Note that each line after `homeassistant:` is indented two (2) spaces. Since the configuration files in Home Assistant are based on the YAML "language", indentation and spacing are important. Also note that seemingly strange entry under `customize:`.
`!include filename.yaml` is the statement that tells Home Assistant to insert the contents of `filename.yaml` at that point. This is how we are going to break a monolithic and hard to read file (when it gets big) into more manageable chunks.
Now before we start splitting out the different components, let's look at the other components (in our example) that will stay in the base file:
```
#discovery:
sun:
#updater:
history:
#conversation:
frontend:
logbook:
http:
api_password: ImNotTelling!
server_port: 8123
ssl_certificate: /etc/letsencrypt/live/example.com/fullchain.pem
ssl_key: /etc/letsencrypt/live/example.com/privkey.pem
ifttt:
key: [nope]
wink:
access_token: [wouldn't you]
refresh_token: [like to know]
zwave:
usb_path: /dev/ttyUSB0
config_path: /usr/local/share/python-openzwave/config
polling_interval: 10000
#zigbee:
# device: /dev/ttyUSB1
# baud: 115200
mqtt:
broker: 127.0.0.1
port: 8883
username: user
password: password
```
As with the core snippet, indentation makes a difference. The component headers (`mqtt:`) should be fully left aligned (aka no indent), and the parameters (`port:`) should be indented two (2) spaces.
While some of these components can technically be moved to a separate file they are so small or "one off's" where splitting them off is superfluous. Also, you'll notice the # symbol (hash/pound). This represents a "comment" as far as the commands are interpreted. Put another way, any line prefixed with a `#` will be ignored. This makes breaking up files for human readability really convenient , not to mention turning off features while leaving the entry intact. (Look at the `zigbee:` entry above and the sensors entry further down)
Now, lets assume that a blank file has been created in the hass configuration directory for each of the following:
groups.yaml
zones.yaml
automation.yaml
notifications.yaml
sensors.yaml
switches.yaml
scripts.yaml
media_player.yaml
device_tracker.yaml
customize.yaml
`automation.yaml`will hold all the automation component details
`zones.yaml` will hold the zone component details
and so forth. These files can be called anything but giving them names that match their function will make things easier to keep track of.
Inside the base configuration file add the following entries:
```
group: !include groups.yaml
zone: !include zones.yaml
automation: !include automation.yaml
notifications: !include notifications.yaml
sensor: !include sensors.yaml
switch: !include switches.yaml
scripts: !include: scripts.yaml
media_player: !include media_player.yaml
device_tracker: !include device_tracker.yaml
```
Note that there can only be one `!include:` for each component so chaining them isn't going to work. If that sounds like greek, don't worry about it.
Alright, so we've got the single components and the include statements in the base file, what goes in those extra files?
Let's look at the `device_tracker` file from our example:
```
### device_tracker.yaml
###
###
- platform: owntracks
- platform: nmap_tracker
hosts: 192.168.2.0/24
home_interval: 3
track_new_devices: yes
interval_seconds: 40
consider_home: 120
```
This small example illustrates how the "split" files work. In this case, we start with a "comment block" identifying the file followed by two (2) device tracker entries (owntracks and nmap). These files follow "style 2" that is to say a fully left aligned leading entry (`- platform: owntracks`) followed by the parameter entries indented two (2) spaces.
This (large) sensor configuration gives us another example:
```
### sensors.yaml
###
###
###
##############################################################
### METEOBRIDGE ####
### http://meteobridge.com/wiki/index.php/Add-On_Services ####
### Live Data as Plain text ####
##############################################################
- platform: tcp
name: 'Outdoor Temp (Meteobridge)'
host: 192.168.2.82
timeout: 6
payload: "Content-type: text/xml; charset=UTF-8\n\n"
value_template: "{{value.split (' ')[2]}}"
unit: C
- platform: tcp
name: 'Outdoor Humidity (Meteobridge)'
host: 192.168.2.82
port: 5556
timeout: 6
payload: "Content-type: text/xml; charset=UTF-8\n\n"
value_template: "{{value.split (' ')[3]}}"
unit: Percent
- platform: tcp
name: 'Outdoor Dewpoint (Meteobridge)'
host: 192.168.2.82
port: 5556
timeout: 6
payload: "Content-type: text/xml; charset=UTF-8\n\n"
value_template: "{{value.split (' ')[4] }}"
unit: C
- platform: tcp
name: 'Wind Direction (Meteobridge)'
host: 192.168.2.82
port: 5556
timeout: 6
payload: "Content-type: text/xml; charset=UTF-8\n\n"
value_template: "{{value.split (' ')[7]}}"
unit: Degrees
- platform: tcp
name: 'Wind Gust (Meteohub)'
host: 192.168.2.82
port: 5556
timeout: 6
payload: "Content-type: text/xml; charset=UTF-8\n\n"
value_template: "{{value.split (' ')[8]}}"
unit: m/s
- platform: tcp
name: 'Wind Speed (Meteobridge)'
host: 192.168.2.82
port: 5556
timeout: 6
payload: "Content-type: text/xml; charset=UTF-8\n\n"
value_template: "{{value.split (' ')[9]}}"
unit: m/s
- platform: tcp
name: 'Wind Chill (Meteobridge)'
host: 192.168.2.82
port: 5556
timeout: 6
payload: "Content-type: text/xml; charset=UTF-8\n\n"
value_template: "{{value.split (' ')[10]}}"
unit: C
- platform: tcp
name: 'Precip Rate (Meteobridge)'
host: 192.168.2.82
port: 5556
timeout: 6
payload: "Content-type: text/xml; charset=UTF-8\n\n"
value_template: "{{value.split (' ')[13]}}"
unit: mm/hr
- platform: tcp
name: 'Precip Total (Meteobridge)'
host: 192.168.2.82
port: 5556
timeout: 6
payload: "Content-type: text/xml; charaset=UTF-8\n\n"
value_template: "{{value.split (' ')[14]}}"
unit: mm
- platform: tcp
name: 'Precip Change (Meteobridge)'
host: 192.168.2.82
port: 5556
timeout: 6
payload: "Content-type: text/xml; charaset=UTF-8\n\n"
value_template: "{{value.split (' ')[15]}}"
unit: mm
- platform: tcp
name: 'Indoor Temp (Meteobridge)'
host: 192.168.2.82
port: 5556
timeout: 6
payload: "Content-type: text/xml; charaset=UTF-8\n\n"
value_template: "{{value.split (' ')[18]}}"
unit: C
- platform: tcp
name: 'Indoor Humidity (Meteobridge)'
host: 192.168.2.82
port: 5556
timeout: 6
payload: "Content-type: text/xml; charaset=UTF-8\n\n"
value_template: "{{value.split (' ')[19]}}"
unit: percent
- platform: tcp
name: 'Indoor Dewpoint (Meteobridge)'
host: 192.168.2.82
port: 5556
timeout: 6
payload: "Content-type: text/xml; charaset=UTF-8\n\n"
value_template: "{{value.split (' ')[20]}}"
unit: C
- platform: tcp
name: 'Barometric Pressure (Meteobridge)'
host: 192.168.2.82
port: 5556
timeout: 6
payload: "Content-type: text/xml; charaset=UTF-8\n\n"
value_template: "{{value.split (' ')[21]}}"
unit: mb
- platform: tcp
name: 'Sea Level Pressure (Meteobridge)'
host: 192.168.2.82
port: 5556
timeout: 6
payload: "Content-type: text/xml; charaset=UTF-8\n\n"
value_template: "{{value.split (' ')[22]}}"
unit: mb
###################################
#### STEAM FRIENDS ####
##################################
- platform: steam_online
api_key: [not telling]
accounts:
- 76561198012067051
##################################
#### TIME/DATE ####
##################################
- platform: time_date
display_options:
- 'time'
- 'date'
- platform: worldclock
time_zone: Etc/UTC
name: 'UTC'
- platform: worldclock
time_zone: America/New_York
name: 'Ann Arbor'
- platform: worldclock
time_zone: Europe/Vienna
name: 'Innsbruck'
- platform: worldclock
time_zone: America/New_York
name: 'Ann Arbor'
```
You'll notice that this example includes a secondary parameter section (under the steam section) as well as a better example of the way comments can be used to break down files into sections.
That about wraps it up.
If you have issues checkout `home-assistant.log` in the configuration directory as well as your indentations. If all else fails, head over to the gitter.im chat and ask away.

View File

@ -0,0 +1,39 @@
---
layout: page
title: "State Objects"
description: "Describes all there is to know about state objects in Home Assistant."
date: 2016-03-12 12:00 -0800
sidebar: false
comments: false
sharing: true
footer: true
---
Your devices are represented in Home Assistant as entities. The entities will write their current state to the state machine for other entities/templates/frontend to access. States are a current representation of the entity.
If you overwrite a state via the states dev tool or the API, it will not impact the actual device. If the device state is being polled, it will overwrite the state in the state machine the next polling.
All states will always have an entity id, a state and a timestamp when last updated and last changed.
Field | Description
----- | -----------
`state.entity_id` | Entity ID. Format: `<domain>.<object_id>`. Example: `light.kitchen`.
`state.domain` | Domain of the entity. Example: `light`.
`state.object_id` | Object ID of entity. Example: `kitchen`.
`state.name` | Name of the entity. Based on `friendly_name` attribute with fall back to object ID. Example: `Kitchen Ceiling`.
`state.last_updated` | Time the state was written to the state machine. Note that writing the exact same state including attributes will not result in this field being updated. Example: `14:10:03 13-03-2016`.
`state.last_changed` | Time the state changed. This is not updated when there are only updated attributes. Example: `14:10:03 13-03-2016`.
`state.attributes` | A dictionary with extra attributes related to the current state.
The attributes of an entity are optional. There are a few attributes that are used by Home Assistant for representing the entity in a specific way. Each component will also have it's own attributes to represent extra state data about the entity. For example, the light component has attributes for the current brightness and color of the light. When an attribute is not available, Home Assistant will not write it to the state.
When using templates, attributes will be available by their name. For example `state.attributes.assumed_state`.
Attribute | Description
--------- | -----------
`friendly_name` | Name of the entity. Example: `Kitchen Ceiling`.
`icon` | Icon to use for the entity in the frontend. Example: `mdi:home`.
`hidden` | Boolean if the entity should not be shown in the frontend. Example: `true`.
`entity_picture` | Url to a picture that should be used instead of showing the domain icon. Example: `http://example.com/picture.jpg`.
`assumed_state` | Boolean if the current state is an assumption. [More info](https://home-assistant.io/blog/2016/02/12/classifying-the-internet-of-things/#classifiers) Example: `True`.
`unit_of_measurement` | The unit of measurement the state is expressed in. Used for grouping graphs or understanding the entity. Example: `°C`.

View File

@ -9,11 +9,14 @@ sharing: true
footer: true
---
<p class='note'>
This is an advanced feature of Home Assistant. You'll need a basic understanding of the [Home Assistant architecture], especially states.
</p>
This is an advanced feature of Home Assistant. You'll need a basic understanding of the following things:
- [Home Assistant architecture], especially states.
- [State object]
[Home Assistant architecture]: /developers/architecture/
[State object]: /topics/state_object/
Templating is a powerful feature in Home Assistant that allows the user control over information that is going into and out of the system. It is used for:

View File

@ -0,0 +1,30 @@
---
layout: page
title: "Z-Wave"
description: "Extended instructions how to setup Z-Wave."
date: 2016-03-24 08:49 -0700
sidebar: false
comments: false
sharing: true
footer: true
---
![Under Construction](https://i.imgur.com/WkBB4BV.gif)
Z-Wave is a popular home automation protocol that is not always straightforward to setup. This page will try to help you make sense of it all.
- Note: Upon first run, the z-wave component will take time to initialize entities and entities may appear with incomplete names. Running a network heal may expidite this proccess.
## {% linkable_title Supported Z-Wave Sticks %}
| Device | Works on Linux | Works on Windows | Works on OSX | Comments |
|-------------------------|----------------|------------------|--------------|-----------|
| Aeotec Z-Stick Series 2 | X | | | |
| Aeotec Z-Stick Series 5 | X | | | |
## {% linkable_title Stick Alternatives %}
The alternative to a stick is a hub that supports Z-Wave. Home Assistant supports the following hubs with Z-Wave support:
- [Vera](/components/vera/)

View File

@ -5581,7 +5581,7 @@ case"touchend":return this.addPointerListenerEnd(t,e,i,n);case"touchmove":return
.rendered.error {
color: red;
}</style><template><partial-base narrow="[[narrow]]" show-menu="[[showMenu]]"><span header-title="">Template Editor</span><div class$="[[computeFormClasses(narrow)]]"><div class="edit-pane"><p>Templates are rendered using the Jinja2 template engine with some Home Assistant specific extensions.</p><ul><li><a href="http://jinja.pocoo.org/docs/dev/templates/" target="_blank">Jinja2 tempate documentation</a></li><li><a href="https://home-assistant.io/getting-started/templating/" target="_blank">Home Assistant template extensions</a></li></ul><p></p><paper-textarea label="Template" value="{{template}}"></paper-textarea></div><div class="render-pane"><paper-spinner class="render-spinner" active="[[rendering]]"></paper-spinner><pre class$="[[computeRenderedClasses(error)]]">[[processed]]</pre></div></div></partial-base></template></dom-module><dom-module id="partial-dev-info" assetpath="layouts/"><style>.content {
}</style><template><partial-base narrow="[[narrow]]" show-menu="[[showMenu]]"><span header-title="">Template Editor</span><div class$="[[computeFormClasses(narrow)]]"><div class="edit-pane"><p>Templates are rendered using the Jinja2 template engine with some Home Assistant specific extensions.</p><ul><li><a href="http://jinja.pocoo.org/docs/dev/templates/" target="_blank">Jinja2 tempate documentation</a></li><li><a href="https://home-assistant.io/topics/templating/" target="_blank">Home Assistant template extensions</a></li></ul><p></p><paper-textarea label="Template" value="{{template}}"></paper-textarea></div><div class="render-pane"><paper-spinner class="render-spinner" active="[[rendering]]"></paper-spinner><pre class$="[[computeRenderedClasses(error)]]">[[processed]]</pre></div></div></partial-base></template></dom-module><dom-module id="partial-dev-info" assetpath="layouts/"><style>.content {
margin-top: 64px;
padding: 24px;
background-color: white;

View File

@ -19,19 +19,85 @@ If you are planning to add support for a new type of device to an existing compo
One of the rules for Home Assistant is that platform logic should never interface directly with devices but use a third-party Python 3 library to do so. This way Home Assistant is able to share code with the Python community and we can keep the project maintainable.
Platforms can specify dependencies and requirements the same way as a component does. Please see [the component page](/developers/creating_components/#dependencies) for more information.
### {% linkable_title Creating Entities %}
Home Assistant will call a function with the following signature to initialize your new platform. This function must exist in the platform module you create.
Platforms can specify dependencies and requirements the same way as a component does.
```python
def setup_platform(hass, config, add_devices, discovery_info=None)
REQUIREMENTS = ['some-package==2.0.0', 'some-other-package==2.5.0']
DEPENDENCIES = ['mqtt']
```
In this function, your platform should create the appropriate entities and register them with the Home Assistant core. Entities are Home Assistant's representation of lights, switches, sensors, etc. and are derived from the [Entity Abstract Class](https://github.com/balloob/home-assistant/blob/master/homeassistant/helpers/entity.py). This abstract class contains logic for integrating most standard features into your entities, such as visibility, entity IDs, updates, and many more.
### {% linkable_title Platform example %}
A list of entities can be registered with Home Assistant using the *add_devices* function that is provided as an input to *setup_platform*. Once entities are registered with with Home Assistant their updates will be provided to the core and the core will have control over them. For more information on how Entities can be customized, take a look at the [Entity Abstract Class](https://github.com/balloob/home-assistant/blob/master/homeassistant/helpers/entity.py#L18).
Entities are Home Assistant's representation of lights, switches, sensors, etc. and are derived from the [Entity Abstract Class](https://github.com/balloob/home-assistant/blob/master/homeassistant/helpers/entity.py). This abstract class contains logic for integrating most standard features into your entities, such as visibility, entity IDs, updates, and many more.
This example is for adding support for the imaginary Awesome Lights.
```python
import logging
# Import the device class from the component that you want to support
from homeassistant.components.light import Light
from homeassistant.const import CONF_HOST, CONF_USERNAME, CONF_PASSWORD
# Home Assistant depends on 3rd party packages for API specific code.
REQUIREMENTS = ['awesome_lights==1.2.3']
_LOGGER = logging.getLogger(__name__)
setup_platform(hass, config, add_devices, discovery_info=None):
"""Initialize Awesome Light platform."""
import awesomelights
# Validate passed in config
host = config.get(CONF_HOST)
username = config.get(CONF_USERNAME)
password = config.get(CONF_PASSWORD)
if host is None or username is None or password is None:
_LOGGER.error('Invalid config. Expected %s, %s and %s',
CONF_HOST, CONF_USERNAME, CONF_PASSWORD)
return False
# Setup connection with devices/cloud
hub = awesomelights.Hub(host, username, password)
# Verify that passed in config works
if not hub.is_valid_login():
_LOGGER.error('Could not connect to AwesomeLight hub')
return False
# Add devices
add_devices(AwesomeLight(light) for light in hub.lights())
class AwesomeLight(Light):
"""Represents an AwesomeLight in Home Assistant."""
def __init__(self, light):
"""Initialize an AwesomeLight."""
self._light = light
def update(self):
"""Fetch new state data for this light.
This is the only method that should fetch new data for Home Assitant.
"""
self._light.update()
def brightness(self):
"""Brightness of the light.
This method is optional. Removing it indicates to Home Assistant
that brightness is not supported for this light.
"""
return self._light.brightness
def is_on(self):
"""If light is on."""
return self._light.is_on()
```
## {% linkable_title Allowing your platform to be discovered %}

View File

@ -31,8 +31,10 @@ This page contains a list of people who have contributed in one way or another t
- [Brad Buran](https://github.com/bburan)
- [Bruno Adele](https://github.com/badele)
- [Carlo Costanzo](https://github.com/CCOSTAN)
- [Charles Spirakis](https://github.com/srcLurker)
- [Chris Mulder](https://github.com/chrisvis)
- [Christian Braedstrup](https://github.com/LinuxChristian)
- [Dan Cinnamon](https://github.com/Cinntax)
- [Daniel Iversen](https://github.com/danielhiversen)
- [Dan Smith](https://github.com/kk7ds)
- [Daren Lord](https://github.com/Xorso)
@ -44,6 +46,7 @@ This page contains a list of people who have contributed in one way or another t
- [Fabian Affolter](https://github.com/fabaff)
- [Finbarr Brady](https://github.com/fbradyirl)
- [Flavio Castelli](https://github.com/flavio)
- [Florian Holzapfel](https://github.com/florianholzapfel)
- [Geoff Norton](https://github.com/kangaroo)
- [goir](https://github.com/goir)
- [gottsman](https://github.com/gottsman)
@ -63,6 +66,7 @@ This page contains a list of people who have contributed in one way or another t
- [John McLaughlin](https://github.com/loghound)
- [John Williams](https://github.com/Jaidan)
- [Jon Maddox](https://github.com/maddox)
- [joopert](https://github.com/joopert)
- [Joseph Hughes](https://github.com/joshughes)
- [Joseph Piron](https://github.com/eagleamon)
- [Julien Danjou](https://github.com/jd)
@ -86,7 +90,7 @@ This page contains a list of people who have contributed in one way or another t
- [Nick Touran](https://github.com/partofthething)
- [Nick Waring](https://github.com/nickwaring)
- [Nolan Gilley](https://github.com/nkgilley)
- [Oliver van Porten](https://github.com/mcdeck))
- [Oliver van Porten](https://github.com/mcdeck)
- [Pascal Bach](https://github.com/bachp)
- [Per Sandström](https://github.com/persandstrom)
- [Philip Lundrigan](https://github.com/philipbl)
@ -107,11 +111,12 @@ This page contains a list of people who have contributed in one way or another t
- [Teemu Patja](https://github.com/tpatja)
- [Theb-1](https://github.com/Theb-1)
- [Theodor Lindquist](https://github.com/theolind)
- [tilutza](https://github.com/tilutza)
- [toddeye](https://github.com/toddeye)
- [Tom Duijf](https://github.com/tomduijf)
- [trollkarlen](https://github.com/trollkarlen)
- [vitorespindola](https://github.com/vitorespindola)
- [w1ll1am23](https://github.com/w1ll1am23)
- [William Scanlon](https://github.com/w1ll1am23)
- [wind-rider](https://github.com/wind-rider)
- [Zac Mrowicki](https://github.com/zmrow)

View File

@ -375,7 +375,7 @@ The result will include any changed states that changed while the service was be
</p>
#### {% linkable_title POST /api/template %}
Render a Home Assistant template. [See template docs for more information.](/getting-started/templating/)
Render a Home Assistant template. [See template docs for more information.](/topics/templating/)
```json
{

View File

@ -72,7 +72,6 @@ User=pi
[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.
@ -82,7 +81,6 @@ You need to reload systemd to make the daemon aware of the new configuration. En
$ 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.
@ -97,7 +95,6 @@ $ sudo systemctl status home-assistant -l
CGroup: /system.slice/home-assistant.service
└─8557 /usr/bin/python3.4 -m homeassistant
[...]
```
To get Home Assistant's logging output, simple use `journalctl`.

View File

@ -13,11 +13,10 @@ Home Assistant will be able to automatically discover and configure any Google C
See the [components overview page](/components/) to find installation instructions for your devices and services. If you can't find support for your favorite device or service, [consider adding support](/developers/add_new_platform/).
Usually every entity needs its own entry in the `configuration.yaml` file. There are two kinds of style for multiple entries:
Usually every entity needs its own entry in the `configuration.yaml` file. There are two styles for multiple entries:
#### {% linkable_title Style 1 %}
Collect every entity under the "parent".
#### {% linkable_title Style 1: Collect every entity under the "parent" %}
```yaml
sensor:
@ -34,23 +33,23 @@ switch:
- platform: vera
```
#### {% linkable_title Style 2 %}
#### {% linkable_title Style 2: List each device separately %}
If you prefer to place your entries somewhere in the `configuration.yaml` file then you just choose this style. You need to append numbers (see example below) or strings (like `media_player livingroom:` or `media_player kitchen:`) to differentiate the entries. The appended number or string must be unique.
You need to append numbers or strings to differentiate the entries, as in the example below. The appended number or string must be unique.
```yaml
media_player 1:
media_player livingroom:
platform: mpd
server: IP_ADDRESS
media_player 2:
media_player kitchen:
platform: plex
camera:
camera 1:
platform: generic
media_player 3:
platform: sonos
camera 2:
platform: mjpeg
```
<p class='note note'>
@ -59,10 +58,11 @@ If your devices are not showing up in the frontend then check the entries in you
### {% linkable_title Grouping devices %}
Once you have 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).
Once you have a bunch of devices set up, it is time to organize them into 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 (second icon).
```yaml
# Example configuration.yaml entry
# Example configuration.yaml entry showing two styles
group:
living_room: light.table_lamp, switch.ac
bedroom:
@ -74,9 +74,12 @@ For more details please check the [Group](https://home-assistant.io/components/g
### {% 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 configuration to the `homeassistant:` section.
By default, all of your devices will be visible and have a default icon determined by their domain. You can customize the look and feel of your front page by altering some of these parameters. This can be done by adding the following configuration inside the `homeassistant:` section.
`entity_pictures`, badges, `device_tracker` pictures, etc. can either be a URL or `/local/file.jpg`, which points to directory `www` in the HASS configuration directory.
Devices that you dont want to have visible can be hidden with `hidden`.
`entity_picture`entries, badges, `device_tracker` pictures, etc. can either be external URLs (e.g. `http://example.com/example.jpg`) or of the form `/local/filename.jpg`, where `/local` represents the directory `www` in the HASS configuration directory. You may have to create the `www` directory yourself as it is not made automatically.
You can also use `icon` and refer to any icon from [MaterialDesignIcons.com](http://MaterialDesignIcons.com).
```yaml
# Example configuration.yaml entry
@ -85,10 +88,17 @@ homeassistant:
# Add this to your existing configuration
# Only the `entity_id` is required. All other options are optional.
customize:
some.entity_id:
sensor.living_room_motion:
hidden: true
entity_picture: http://placehold.it/200x200
friendly_name: My better name
thermostat.family_roomfamily_room:
entity_picture: https://dl.dropboxusercontent.com/u/12345/images/nest.jpg
friendly_name: Nest
switch.wemo_switch_1:
friendly_name: Toaster
entity_picture: /local/toaster.jpg
switch.wemo_switch_2:
friendly_name: Kitchen kettle
icon: mdi:kettle
```
### [Next step: Setting up presence detection &raquo;](/getting-started/presence-detection/)

View File

@ -284,11 +284,16 @@ For additional help, in addition to this site, there are four sources:
- [Gitter Chatroom](https://gitter.im/balloob/home-assistant) for general Home Assistant discussions and questions.
- [GitHub Page](https://github.com/balloob/home-assistant/issues) for issue reporting.
### What's next
### {% linkable_title Updating %}
To update Home Assistant to the latest release run: `pip3 install --upgrade homeassistant`
You have to restart Home Assistant (`hass` itself or with the help of the autostarting daemon if you use any) for the changes to take effect.
### {% linkable_title What's next %}
If you want to have Home Assistant start on boot, autostart instructions can be found [here](/getting-started/autostart/).
To see what Home Assistant can do, launch demo mode: `hass --demo-mode` or visit the [demo page](/demo).
To update Home Assistant to the latest release run: `pip3 install --upgrade homeassistant`
### [Next step: Configuring Home Assistant &raquo;](/getting-started/configuration/)

View File

@ -0,0 +1 @@
<script>document.location = '/topics/templating/';</script>

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -0,0 +1,20 @@
---
layout: page
title: "Advanced Topics"
description: "Documentation about the more advanced features in Home Assistant."
date: 2016-03-12 12:00 -0800
sidebar: false
comments: false
sharing: true
footer: true
regenerate: true
hide_github_edit: true
---
Home Assistant is built from many small building blocks that together offer a powerful and customizable system. This page is a collection of the more advanced topics.
{% assign topics = site.topics | sort: 'title' %}
{% for topic in topics %}
* [{{topic.title}}]({{topic.url}})
{% endfor %}