- 2015-12-22T04:36:27+00:00
+ 2015-12-22T09:41:30+00:00https://home-assistant.io/
@@ -13,6 +13,67 @@
Octopress
+
+
+
+ 2015-12-22T09:30:00+00:00
+ https://home-assistant.io/blog/2015/12/22/amazon-echo-icloud-and-templates
+ Alrighty, it’s time for Home Assistant 0.10. A lot amazing things have changed and sadly we also had to introduce a bunch of backwards incompatible changes. I would like to give a big shoutout to Philip Lundrigan (@philipbl) who put a lot in effort in helping the migration to move towards using templates for a wide variety of platforms.
+
+
This release introduces templates. This will allow you to parse data before it gets processed or create messages for notifications on the fly based on data within Home Assistant. The notification component and the new Alexa/Amazon Echo component are both using the new template functionality to render responses. A template editor has been added to the developer tool section in the app so you can get instant feedback if your templates are working or not.
+
+
+
The temperature at home is {{ states('sensor.temperature') }}.
+
Templates will now be the only way to extract data from ‘raw’ sources like REST, CommandSensor or MQTT. This will replace any specific option that used to do this before. This means that precision, factor, attribute or json_path etc will no longer work.
+
+]]>
+
+
@@ -1961,130 +2022,6 @@ PubSubClient client(ethClient);
-]]>
-
-
-
-
-
- 2015-08-09T18:01:00+00:00
- https://home-assistant.io/blog/2015/08/09/mqtt-raspberry-pi-squeezebox-asuswrt-support
- It’s time for the August release and there is some serious good stuff this time. The core of Home Assistant has gone some serious clean up and a bump in test coverage thanks to @balloob. If you’re a developer, make sure you read up on the deprecation notices. @fabaff did another great round of documentating all the various components.
-
-
MQTT Support
- The big new addition in this release is the support for the MQTT protocol by @fabaff with some help from @balloob. It will now be possible to integrate any IoT device that talks via MQTT. For the initial release we support connecting Home Assistant to a broker (no TLS yet). Components can now subscribe and publish to MQTT topics (see the example) and also support for the automation component has been added. For more information, see the MQTT component page.
-
-
-
# Example configuration.yaml entry
-mqtt:
- broker: IP_ADDRESS_BROKER
- # All the other options are optional:
- port: 1883
- keepalive: 60
- qos: 0
- username: your_username
- password: your_secret_password
-
-
-
-
-
-
-
Raspberry PI GPIO Support
-@gbarba has contributed support to use the general purpose input and output pins on a Raspberry PI as switches inside Home Assistant.
-
-
-
# Example configuration.yaml entry
-switch:
- platform: rpi_gpio
- ports:
- 11: Fan Office
- 12: Light Desk
-
-
-
-
-
ASUSWRT based routers
-@persandstrom has contributed support to do prescence detection using ASUSWRT based routers.
Logitech Squeezebox media player support
-@persandstrom also contributed support for the Logitech Squeezebox media player. This allows you to control your Logitech Squeezebox from Home Assistant.
Slack notification support
-@jamespcole has contributed a Slack platform for the notification platform. This allows you to deliver messages to any channel.
RFXtrx sensor support
-@danielhiversen has contributed support for RFXtrx sensors. It supports sensors that communicate in the frequency range of 433.92 MHz.
@@ -339,12 +346,6 @@ Support for Temper temperature sensors has been contributed by
- 0.9: Rollershutters, locks, binary sensors and InfluxDB
-
-
-
diff --git a/blog/2015/08/17/verisure-and-modern-tp-link-router-support/index.html b/blog/2015/08/17/verisure-and-modern-tp-link-router-support/index.html
index 5591ed08ef..af5ecef695 100644
--- a/blog/2015/08/17/verisure-and-modern-tp-link-router-support/index.html
+++ b/blog/2015/08/17/verisure-and-modern-tp-link-router-support/index.html
@@ -61,6 +61,7 @@
Alrighty, it’s time for Home Assistant 0.10. A lot amazing things have changed and sadly we also had to introduce a bunch of backwards incompatible changes. I would like to give a big shoutout to Philip Lundrigan (@philipbl) who put a lot in effort in helping the migration to move towards using templates for a wide variety of platforms.
This release introduces templates. This will allow you to parse data before it gets processed or create messages for notifications on the fly based on data within Home Assistant. The notification component and the new Alexa/Amazon Echo component are both using the new template functionality to render responses. A template editor has been added to the developer tool section in the app so you can get instant feedback if your templates are working or not.
+
+
+
The temperature at home is {{ states('sensor.temperature') }}.
+
Templates will now be the only way to extract data from ‘raw’ sources like REST, CommandSensor or MQTT. This will replace any specific option that used to do this before. This means that precision, factor, attribute or json_path etc will no longer work.
diff --git a/blog/categories/release-notes/atom.xml b/blog/categories/release-notes/atom.xml
index 7ed11a6619..639ea3cda0 100644
--- a/blog/categories/release-notes/atom.xml
+++ b/blog/categories/release-notes/atom.xml
@@ -4,7 +4,7 @@
- 2015-12-22T04:36:27+00:00
+ 2015-12-22T09:41:30+00:00https://home-assistant.io/
@@ -13,6 +13,67 @@
Octopress
+
+
+
+ 2015-12-22T09:30:00+00:00
+ https://home-assistant.io/blog/2015/12/22/amazon-echo-icloud-and-templates
+ Alrighty, it’s time for Home Assistant 0.10. A lot amazing things have changed and sadly we also had to introduce a bunch of backwards incompatible changes. I would like to give a big shoutout to Philip Lundrigan (@philipbl) who put a lot in effort in helping the migration to move towards using templates for a wide variety of platforms.
+
+
This release introduces templates. This will allow you to parse data before it gets processed or create messages for notifications on the fly based on data within Home Assistant. The notification component and the new Alexa/Amazon Echo component are both using the new template functionality to render responses. A template editor has been added to the developer tool section in the app so you can get instant feedback if your templates are working or not.
+
+
+
The temperature at home is {{ states('sensor.temperature') }}.
+
Templates will now be the only way to extract data from ‘raw’ sources like REST, CommandSensor or MQTT. This will replace any specific option that used to do this before. This means that precision, factor, attribute or json_path etc will no longer work.
+
+]]>
+
+
@@ -164,45 +225,6 @@ This makes more sense as most people run Home Assistant as a daemon
Also, the media player was extended by @maddox to support the play media command. This has been implemented for the iTunes platform.
-]]>
-
-
-
-
-
- 2015-10-05T21:49:00+00:00
- https://home-assistant.io/blog/2015/10/05/home-assistant-goes-geo-with-owntracks
- A few weeks have past and it is time again for another release: version 0.7.4. This time we’re very glad to be able to introduce brand new integration with OwnTracks to allow tracking of people on a map. The geo support consists of three different parts:
-
-
Alrighty, it’s time for Home Assistant 0.10. A lot amazing things have changed and sadly we also had to introduce a bunch of backwards incompatible changes. I would like to give a big shoutout to Philip Lundrigan (@philipbl) who put a lot in effort in helping the migration to move towards using templates for a wide variety of platforms.
I recently learned about the ESP8266, a $5 chip that includes WiFi and is Arduino compatible. This means that all your DIY projects can now be done for a fraction of the price.
-
-
For this tutorial, I’ll walk through how to get going with ESP8266, get the temperature and humidity and report it to MQTT where Home Asssistant can pick it up.
-
-
-
-Picture of the final setup (+ 2 LED for decoration)
-
-
-
-
-Home Assistant will keep track of historical values and allow you to integrate it into automation.
-
I recently learned about the ESP8266, a $5 chip that includes WiFi and is Arduino compatible. This means that all your DIY projects can now be done for a fraction of the price.
+
+
For this tutorial, I’ll walk through how to get going with ESP8266, get the temperature and humidity and report it to MQTT where Home Asssistant can pick it up.
+
+
+
+Picture of the final setup (+ 2 LED for decoration)
+
+
+
+
+Home Assistant will keep track of historical values and allow you to integrate it into automation.
+
It’s time for the August release and there is some serious good stuff this time. The core of Home Assistant has gone some serious clean up and a bump in test coverage thanks to @balloob. If you’re a developer, make sure you read up on the deprecation notices. @fabaff did another great round of documentating all the various components.
-
-
MQTT Support
- The big new addition in this release is the support for the MQTT protocol by @fabaff with some help from @balloob. It will now be possible to integrate any IoT device that talks via MQTT. For the initial release we support connecting Home Assistant to a broker (no TLS yet). Components can now subscribe and publish to MQTT topics (see the example) and also support for the automation component has been added. For more information, see the MQTT component page.
-
-
-
# Example configuration.yaml entry
-mqtt:
- broker: IP_ADDRESS_BROKER
- # All the other options are optional:
- port: 1883
- keepalive: 60
- qos: 0
- username: your_username
- password: your_secret_password
-
It’s time for the August release and there is some serious good stuff this time. The core of Home Assistant has gone some serious clean up and a bump in test coverage thanks to @balloob. If you’re a developer, make sure you read up on the deprecation notices. @fabaff did another great round of documentating all the various components.
+
+
MQTT Support
+ The big new addition in this release is the support for the MQTT protocol by @fabaff with some help from @balloob. It will now be possible to integrate any IoT device that talks via MQTT. For the initial release we support connecting Home Assistant to a broker (no TLS yet). Components can now subscribe and publish to MQTT topics (see the example) and also support for the automation component has been added. For more information, see the MQTT component page.
+
+
+
# Example configuration.yaml entry
+mqtt:
+ broker: IP_ADDRESS_BROKER
+ # All the other options are optional:
+ port: 1883
+ keepalive: 60
+ qos: 0
+ username: your_username
+ password: your_secret_password
+
Home Assistant has learned a new trick to get the latest information from the server: streaming updates. No longer will the frontend poll every 30 seconds for updates but instead it will keep a connection open and get the latest changes pushed as soon as they happen.
-
-
A new toggle has been added ot the sidebar to turn streaming updates on and off. This preference will be saved on a per-browser basis using local storage. The toggle will also indicate when there is an error setting up a stream after which it will fall back to use polling.
Home Assistant has learned a new trick to get the latest information from the server: streaming updates. No longer will the frontend poll every 30 seconds for updates but instead it will keep a connection open and get the latest changes pushed as soon as they happen.
+
+
A new toggle has been added ot the sidebar to turn streaming updates on and off. This preference will be saved on a per-browser basis using local storage. The toggle will also indicate when there is an error setting up a stream after which it will fall back to use polling.
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.
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 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.
-
To get started with Alexa skills:
- - log in to Amazon developer console
- - 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
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.
Configuring the Alexa component for the above intents would look like this:
@@ -186,8 +202,8 @@ WhereAreWeIntent where we are
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:
@@ -195,7 +211,7 @@ WhereAreWeIntent where we are
type: plaintexttext: >
{%- 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 -%}
diff --git a/components/arduino/index.html b/components/arduino/index.html
index fc68b986ef..85dcedcdb3 100644
--- a/components/arduino/index.html
+++ b/components/arduino/index.html
@@ -61,6 +61,7 @@
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 ({{ is_state('device_tracker.paulus', 'home') }}) or by having the template render ‘true’ (example below).
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.
@@ -333,6 +347,8 @@
# At least one of the following requiredabove: 17below: 25
+ # Optional
+ value_template: '{{ state.attributes.battery }}'
@@ -351,6 +367,21 @@
+
Template condition
+
+
The template condition will test if given 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’.
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.
+
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.
{
- "message": "A simple test message from HA."
+ "message": "The sun is {% if is_state('sun.sun', 'above_horizon') %}up{% else %}down{% endif %}!"
}
The torque platform will allow you to monitor Torque data relayed from a bluetooth OBD2 stick via the Torque mobile application.
+
+
Configuration
+
To use Torque sensors with your installation, you must configure both the Torque mobile application and Home Assistant.
+
+
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.
+
+
+
Home Assistant
+
+
Add the following to your configuration.yaml file:
+
+
+
# 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.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/components/sensor.transmission/index.html b/components/sensor.transmission/index.html
index 52303f5c7f..5068be9d83 100644
--- a/components/sensor.transmission/index.html
+++ b/components/sensor.transmission/index.html
@@ -61,6 +61,7 @@
-The result will include any changed states that changed while the service was being executed, even if their change was the result of something else happening in the system.
+The result will include any changed states that changed while the service was being executed, even if their change was the result of something else happening in the system.
The template helper enables one to mathematically manipulate values, use variables to extract values from JSON, and create customized messages to send with the notification component. If the entity has template support then the value_template key can be set and used (eg. message: in data: of an automation rule) in the configuration.yaml file.
+
+This is an advanced feature of Home Assistant. You need a basic understanding of the Home Assistant architecture, especially states.
+
+
+
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:
+
+
+
Formatting outgoing messages in, for example, the notify and alexa components.
Templating in Home Assistant is powered by the Jinja2 templating engine. This means that we are using their syntax and make some custom Home Assistant variables available to templates during rendering. We will not go over the basics of the syntax, as Jinja2 does a lot better job at this in their Jinja2 documentation.
+
+
+The frontend has a template editor developer tool to help develop and debug templates.
+
+
+
Templates can get pretty big pretty fast. To keep a clear overview, consider using YAML multiline strings to define your templates:
-
value_template: '{{ value.x }}'
+
script:
+ msg_who_is_home:
+ sequence:
+ - service: notify.notify
+ data:
+ message: >
+ {% if is_state('device_tracker.paulus', 'home') %}
+ Ha, Paulus is home!
+ {% else %}
+ Paulus is at {{ states('device_tracker.paulus')) }}.
+ {% endif %}
-
To check your templates on-the-fly checkout the Template Editor from the Developer Tools.
The variables are handled the same way as in Python.
-
-
-
-
-
Method
-
description
-
-
-
-
-
{{ value.x }} or {{ value.['x'] }}
-
Normal value
-
-
-
{{ value_json.x }}
-
JSON value
-
-
-
-
-
The evaluation leads to an empty string if it’s unsuccessful and printed or iterated over.
-
-
The states variable
-
-
The template support has a special states variable:
+
Home Assistant adds extensions to allow templates to access all of the current states:
Iterating states will yield each state sorted alphabetically by entity id
Iterating states.domain will yield each state of that domain sorted alphabetically by entity id
states.sensor.temperature returns state object for sensor.temperature
+
states('device_tracker.paulus') will return the state string (not the object) of given entity or unknown if it doesn’t exist.
+
is_state('device_tracker.paulus', 'home') will test if given entity is specified state.
+
Filter multiply(x) will convert input to number and multiply it with x
+
Filter round(x) will convert input to number and round it to x decimals.
-
Example templates and what they could result in:
-
-
-
-
-
Template
-
Output
-
-
-
-
-
{{ states.device_tracker.paulus.state }}
-
home
-
-
-
{% for state in states.sensor %}{{ state.entity_id }}={{ state.state }}, {% endfor %}
-
senor.thermostat=24, sensor.humidity=40,
-
-
-
-
-
Mathematical functions
-
-
The mathematical methods convert strings to numbers automatically before they are doing their job. This could be useful if you recieve data in the wrong unit of measurement and want to convert it. They are used like the standard Jinja2 filters.
-
-
-
-
-
Method
-
description
-
-
-
-
-
multiply(x)
-
Multiplies the value with x
-
-
-
round(x)
-
Maximal number x of decimal places for the value
-
-
-
-
-
A sample sensor entry for your configuration.yaml file could look like this:
+# Next two statements result in same value if state exists
+# Second one will result in an error if state does not exist
+{{ states('device_tracker.paulus') }}
+{{ states.device_tracker.paulus.state }}
+
+# Print an attribute if state is defined
+{% if states.device_tracker.paulus %}
+{{ states.device_tracker.paulus.attributes.battery }}
+{% else %}
+??
+{% endif %}
+
+# Print out a list of all the sensor states
+{% for state in states.sensor %}
+ {{ state.entity_id }}={{ state.state }},
+{% endfor %}
+
+{% if is_state('device_tracker.paulus', 'home') %}
+ Ha, Paulus is home!
+{% else %}
+ Paulus is at {{ states('device_tracker.paulus')) }}.
+{% endif %}
+
+{{ states.sensor.temperature | multiply(10) | round(2) }}
+
+{% if states('sensor.temperature') | float > 20 %}
+ It is warm!
+{%endif %}
+
Processing incoming data
+
+
The other part of templating is processing incoming data. It will allow you to modify incoming data and extract only the data that you care about. This will work only for platforms and components that mentioned support for this in their documentation.
+
+
It depends per component or platform but it is common to be able to define a template using the value_template configuration key. When a new value arrives, your template will be rendered while having access to the following values on top of the usual Home Assistant extensions:
+
+
+
+
+
Variable
+
Description
+
+
+
+
+
value
+
The incoming value.
+
+
+
value_json
+
The incoming value parsed as JSON.
+
+
+
+
+
+
# Incoming value:
+{"primes": [2, 3, 5, 7, 11, 13]}
+
+# Extract third prime number
+{{ value_json.primes[2] }}
+