commit
3351200999
16 changed files with 332 additions and 62 deletions
|
@ -14,19 +14,27 @@ featured: false
|
|||
|
||||
The Alexa component allows you to integrate Home Assistant into Alexa/Amazon Echo. This component will allow you to query information within Home Assistant by using your voice. There are no supported sentences out of the box as of now, you will have to define them all yourself. This component does not yet allow the control of devices connected to Home Assistant.
|
||||
|
||||
<p style='text-align: center;'>
|
||||
<iframe width="560" height="315" src="https://www.youtube.com/embed/1Ke3mtWd_cQ" frameborder="0" allowfullscreen></iframe>
|
||||
</p>
|
||||
|
||||
|
||||
### Requirements before using
|
||||
Amazon requires the endpoint of a skill to be hosted via SSL. Self-signed certificates are ok because our skills will only run in development mode. Read more on [our blog][blog-lets-encrypt] about how to set up encryption for Home Assistant. If you are unable to get https up and running, consider using [this AWS Lambda proxy for Alexa skills](https://forums.developer.amazon.com/forums/thread.jspa?messageID=18604).
|
||||
|
||||
[blog-lets-encrypt]: https://home-assistant.io/blog/2015/12/13/setup-encryption-using-lets-encrypt/
|
||||
|
||||
To get started with Alexa skills:
|
||||
- log in to [Amazon developer console](https://developer.amazon.com)
|
||||
|
||||
- Log in to [Amazon developer console](https://developer.amazon.com)
|
||||
- Go to Apps & Services => Alexa => Alexa Skill Kit - Get Started
|
||||
- Add a new skill
|
||||
- Name: Home Assistant
|
||||
- Invocation name: home assistant (or be creative, up to you)
|
||||
- Version: 1.0
|
||||
- Endpoint: https / https://YOUR_HOST/api/alexa?api_password=YOUR_API_PASSWORD
|
||||
- Endpoint:
|
||||
- https
|
||||
- https://YOUR_HOST/api/alexa?api_password=YOUR_API_PASSWORD
|
||||
|
||||
### Configuring your Amazon Alexa skill
|
||||
|
||||
|
@ -69,9 +77,11 @@ This means that we can now ask Alexa things like:
|
|||
|
||||
### Configuring Home Assistant
|
||||
|
||||
Out of the box, the component will do nothing. You have to teach it about all intents you want it to answer to. The way it works is that the answer for each intent is based on a templates that you define. Each template will have access to the existing state as per the `states` variable but will also have access to all variables defined in the intent.
|
||||
Out of the box, the component will do nothing. You have to teach it about all intents you want it to answer to. The way it works is that the answer for each intent is based on [templates] that you define. Each template will have access to the existing states via the `states` variable but will also have access to all variables defined in the intent.
|
||||
|
||||
The values of `speech/text`, `card/title` and `card/content` will be parsed as a template.
|
||||
You can use [templates] for the values of `speech/text`, `card/title` and `card/content`.
|
||||
|
||||
[templates]: /getting-started/templating/
|
||||
|
||||
Configuring the Alexa component for the above intents would look like this:
|
||||
|
||||
|
@ -88,8 +98,8 @@ alexa:
|
|||
is_state('device_tracker.anne_therese', 'home') -%}
|
||||
You are both home, you silly
|
||||
{%- else -%}
|
||||
Anne Therese is at {{ states("device_tracker.anne_therese") }} and
|
||||
Paulus is at {{ states("device_tracker.paulus") }}
|
||||
Anne Therese is at {{ states("device_tracker.anne_therese") }} and
|
||||
Paulus is at {{ states("device_tracker.paulus") }}
|
||||
{% endif %}
|
||||
|
||||
LocateIntent:
|
||||
|
@ -97,7 +107,7 @@ alexa:
|
|||
type: plaintext
|
||||
text: >
|
||||
{%- for state in states.device_tracker -%}
|
||||
{%- if state.name[:4].lower() == User.lower() -%}
|
||||
{%- if state.name.lower() == User.lower() -%}
|
||||
{{ state.name }} is at {{ state.state }}
|
||||
{%- endif -%}
|
||||
{%- else -%}
|
||||
|
|
|
@ -147,6 +147,17 @@ automation:
|
|||
offset: '-00:45:00'
|
||||
```
|
||||
|
||||
#### {% linkable_title Template trigger %}
|
||||
|
||||
Template triggers work by evaluating a [template] on each state change. The trigger will fire if the state change caused the template to render 'true'. This is achieved by having the template result in a true boolean expression (`{% raw %}{{ is_state('device_tracker.paulus', 'home') }}{% endraw %}`) or by having the template render 'true' (example below).
|
||||
|
||||
```yaml
|
||||
automation:
|
||||
trigger:
|
||||
platform: template
|
||||
value_template: '{% raw %}{% if is_state('device_tracker.paulus', 'home') %}true{% endif %}{% endraw %}'
|
||||
```
|
||||
|
||||
#### {% linkable_title Time trigger %}
|
||||
|
||||
Time can be triggered in many ways. The most common is to specify `after` and trigger at a specific point in time each day. Alternatively, you can also match if the hour, minute or second of the current time has a specific value. For example, by only setting minutes in the config to 5 it will trigger every hour when it is 5 minutes past whole. You cannot use `after` together with hour, minute or second.
|
||||
|
@ -215,6 +226,8 @@ automation:
|
|||
# At least one of the following required
|
||||
above: 17
|
||||
below: 25
|
||||
# Optional
|
||||
value_template: '{% raw %}{{ state.attributes.battery }}{% endraw %}'
|
||||
```
|
||||
|
||||
#### {% linkable_title State condition %}
|
||||
|
@ -229,6 +242,20 @@ automation:
|
|||
state: not_home
|
||||
```
|
||||
|
||||
#### {% linkable_title Template condition %}
|
||||
|
||||
The template condition will test if [given template][template] renders a value equal to true. This is achieved by having the template result in a true boolean expression or by having the template render 'true'.
|
||||
|
||||
|
||||
```yaml
|
||||
automation:
|
||||
condition:
|
||||
platform: template
|
||||
value_template: '{% raw %}{{ state.attributes.battery > 50 }}{% endraw %}'
|
||||
# Or value_template could be:
|
||||
# {% raw %}{% if state.attributes.battery > 50 %}true{% else %}false{% endif %}{% endraw %}
|
||||
```
|
||||
|
||||
#### {% linkable_title Time condition %}
|
||||
|
||||
The time condition can test if it is after a specified time, before a specified time or if it is a certain day of the week
|
||||
|
@ -302,3 +329,5 @@ INFO [homeassistant.components.automation] Initialized rule Rain is over
|
|||
The Logbook component will show a line entry when an automation is triggered. You can look at the previous entry to determine which trigger in the rule triggered the event.
|
||||
|
||||

|
||||
|
||||
[template]: /getting-started/templating/
|
|
@ -33,6 +33,9 @@ light:
|
|||
brightness_command_topic: "office/rgb1/brightness/set"
|
||||
rgb_state_topic: "office/rgb1/rgb/status"
|
||||
rgb_command_topic: "office/rgb1/rgb/set"
|
||||
state_value_format: "{% raw %}{{ value_json.state }}{% endraw %}"
|
||||
brightness_value_format: "{% raw %}{{ value_json.brightness }}{% endraw %}"
|
||||
rgb_value_format: "{% raw %}{{ value_json.rgb | join(',') }}{% endraw %}"
|
||||
qos: 0
|
||||
payload_on: "ON"
|
||||
payload_off: "OFF"
|
||||
|
@ -63,6 +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_format** (*Optional*): Defines a [template](/getting-started/templating/) to extract the state value.
|
||||
- **brightness_value_format** (*Optional*): Defines a [template](/getting-started/templating/) to extract the brightness value.
|
||||
- **rgb_value_format** (*Optional*): Defines a [template](/getting-started/templating/) to extract the RGB value.
|
||||
- **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".
|
||||
- **payload_off** (*Optional*): The payload that represents disabled state. Default is "OFF".
|
||||
|
|
|
@ -35,12 +35,16 @@ Once loaded, the `notify` platform will expose a service that can be called to s
|
|||
| `title` | yes | Title of the notification. Default is `Home Assistant`.
|
||||
| `target` | yes | Some platforms will allow specifying a recipient that will receive the notification. See your platform page if it is supported.
|
||||
|
||||
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/
|
||||
|
||||
### {% linkable_title Test if it works %}
|
||||
|
||||
A simple way to test if you have set up your notify platform correctly is to use **Call Service** from the **Developer Tools** to call your notify service. Choose your service (*notify/xyz*) from the list of **Available services:** and enter something like the sample below into the **Service Data** field and hit **CALL SERVICE**.
|
||||
|
||||
```json
|
||||
{
|
||||
"message": "A simple test message from HA."
|
||||
"message": "The sun is {% raw %}{% if is_state('sun.sun', 'above_horizon') %}up{% else %}down{% endif %}{% endraw %}!"
|
||||
}
|
||||
```
|
||||
|
|
|
@ -25,6 +25,7 @@ sensor:
|
|||
monitored_variables:
|
||||
- name: temperature
|
||||
unit_of_measurement: '°C'
|
||||
value_template: '{% raw %}{{ value | round(1) }}{% endraw %}'
|
||||
- name: humidity
|
||||
unit_of_measurement: '%'
|
||||
pins:
|
||||
|
@ -43,6 +44,7 @@ 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.
|
||||
- **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.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
layout: component
|
||||
title: "Dweet.io sensor"
|
||||
title: "Dweet.io"
|
||||
description: "Instructions how to integrate Dweet.io sensors within Home Assistant."
|
||||
date: 2015-12-10 10:15
|
||||
sidebar: true
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
layout: component
|
||||
title: "Efergy sensor"
|
||||
title: "Efergy"
|
||||
description: "Instructions how to integrate Efergy devices within Home Assistant."
|
||||
date: 2015-07-11 0:15
|
||||
sidebar: true
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
layout: component
|
||||
title: "Eliqonline sensor"
|
||||
title: "Eliqonline"
|
||||
description: "Instructions how to integrate Eliqonline devices within Home Assistant."
|
||||
date: 2015-07-11 0:15
|
||||
sidebar: true
|
||||
|
|
|
@ -20,9 +20,9 @@ To enable this sensor, add the following lines to your `configuration.yaml` file
|
|||
sensor:
|
||||
platform: rest
|
||||
resource: http://IP_ADDRESS/ENDPOINT
|
||||
value_template: '{% raw %}{{ value_json.thermostat }}{% endraw %}'
|
||||
method: GET
|
||||
name: REST GET sensor
|
||||
value_template: '{% raw %}{{ value_json.x }}{% endraw %}'
|
||||
unit_of_measurement: "°C"
|
||||
```
|
||||
|
||||
|
@ -34,7 +34,7 @@ sensor:
|
|||
platform: rest
|
||||
resource: http://IP_ADDRESS/ENDPOINT
|
||||
method: POST
|
||||
value_template: '{% raw %}{{ template }}{% endraw %}'
|
||||
value_template: '{% raw %}{{ value_json.thermostat }}{% endraw %}'
|
||||
payload: '{ "device" : "heater" }'
|
||||
name: REST POST sensor
|
||||
unit_of_measurement: "°C"
|
||||
|
@ -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** (*Required*): Defines a [template](/getting-started/templating/) to extract the value.
|
||||
- **value_template** (*Optional*): Defines a [template](/getting-started/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.
|
||||
|
|
49
source/_components/sensor.torque.markdown
Normal file
49
source/_components/sensor.torque.markdown
Normal file
|
@ -0,0 +1,49 @@
|
|||
---
|
||||
layout: component
|
||||
title: "Torque (OBD2)"
|
||||
description: "Instructions how to integrate Torque sensors into Home Assistant."
|
||||
date: 2015-12-20 18:00
|
||||
sidebar: true
|
||||
comments: false
|
||||
sharing: true
|
||||
footer: true
|
||||
ha_category: Sensor
|
||||
---
|
||||
|
||||
The `torque` platform will allow you to monitor [Torque](http://torque-bhp.com/) data relayed from a bluetooth OBD2 stick via the Torque mobile application.
|
||||
|
||||
## {% linkable_title Configuration %}
|
||||
To use Torque sensors with your installation, you must configure both the Torque mobile application and Home Assistant.
|
||||
|
||||
### {% linkable_title Torque application %}
|
||||
|
||||
In **Settings** -> **Data Logging & Upload**:
|
||||
|
||||
Under the **Logging Preferences** header:
|
||||
|
||||
- Touch **Select what to log**, activate the menu in the upper right, and select **Add PID to log**.
|
||||
- Select items of interest.
|
||||
|
||||
Under the **Realtime Web Upload** header:
|
||||
|
||||
- Check **Upload to webserver**.
|
||||
- Enter `http://HOST:PORT/api/torque?api_password=YOUR_PASSWORD` as the **Webserver URL**, where `HOST` and `PORT` are your externally-accessible Home Assistant HTTP host and port and YOUR_PASSWORD is your password.
|
||||
- Enter an email address in **User Email Address**.
|
||||
- Optionally set the **Web Logging Interval**. The 2-second default may quickly fill up the Home Assistant history database.
|
||||
|
||||
### {% linkable_title Home Assistant %}
|
||||
|
||||
Add the following to your `configuration.yaml` file:
|
||||
|
||||
```yaml
|
||||
# Example configuration.yaml entry
|
||||
sensor:
|
||||
platform: torque
|
||||
name: Your Vehicle Name
|
||||
email: your_configured@email.com
|
||||
```
|
||||
|
||||
Configuration variables:
|
||||
|
||||
- **name** (*Required*): Vehicle name (your choice).
|
||||
- **email**: Email address configured in Torque application.
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
layout: component
|
||||
title: "Twitch sensor"
|
||||
title: "Twitch"
|
||||
description: "Instructions how to integrate Twitch sensors into Home Assistant."
|
||||
date: 2015-12-19 09:00
|
||||
sidebar: true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue