From 53472d530ebb2c845c84866c18574de107e452b0 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sat, 7 May 2016 12:40:16 -0700 Subject: [PATCH] Add 0.19 blog post --- source/_components/mqtt.markdown | 2 + source/_components/sensor.fitbit.markdown | 19 +++ .../sensor.google_travel_time.markdown | 28 ++++ ...5-07-empowering-scripts-and-alexa.markdown | 158 ++++++++++++++++++ .../platform_options.markdown} | 18 +- source/_topics/templating.markdown | 1 + .../scripts-conditions.markdown | 30 ++++ 7 files changed, 254 insertions(+), 2 deletions(-) create mode 100644 source/_components/sensor.fitbit.markdown create mode 100644 source/_components/sensor.google_travel_time.markdown create mode 100644 source/_posts/2016-05-07-empowering-scripts-and-alexa.markdown rename source/{_cookbook/customize_polling_interval.markdown => _topics/platform_options.markdown} (61%) diff --git a/source/_components/mqtt.markdown b/source/_components/mqtt.markdown index 966b96ca453..df2adc25741 100644 --- a/source/_components/mqtt.markdown +++ b/source/_components/mqtt.markdown @@ -39,6 +39,8 @@ Configuration variables: - **username** (*Optional*): The username to use with your MQTT broker. - **password** (*Optional*): The corresponding password for the username to use with your MQTT broker. - **certificate** (*Optional*): Certificate to use to encrypt communication with the broker. +- **client_key** (*Optional*): Client key (example: `/home/user/owntracks/cookie.key`) +- **client_cert** (*Optional*): Client certificate (example: `/home/user/owntracks/cookie.crt`) - **protocol** (*Optional*): Protocol to use: 3.1 or 3.1.1. By default it connects with 3.1.1 and falls back to 3.1 if server does not support 3.1. ## {% linkable_title Picking a broker %} diff --git a/source/_components/sensor.fitbit.markdown b/source/_components/sensor.fitbit.markdown new file mode 100644 index 00000000000..30fdba8603b --- /dev/null +++ b/source/_components/sensor.fitbit.markdown @@ -0,0 +1,19 @@ +--- +layout: page +title: "Fitbit" +description: "Instructions how to integrate Fitbit devices within Home Assistant." +date: 2015-07-11 0:15 +sidebar: true +comments: false +sharing: true +footer: true +logo: +ha_category: Sensor +ha_iot_class: "Cloud Polling" +ha_release: 0.19 +--- + +```yaml +sensor: + platform: fitbit +``` diff --git a/source/_components/sensor.google_travel_time.markdown b/source/_components/sensor.google_travel_time.markdown new file mode 100644 index 00000000000..be06fb1d94b --- /dev/null +++ b/source/_components/sensor.google_travel_time.markdown @@ -0,0 +1,28 @@ +--- +layout: page +title: "Google Maps Travel Time" +description: "Instructions on how to add Google Maps travel time to Home Assistant." +date: 2016-03-28 10:19 +sidebar: true +comments: false +sharing: true +footer: true +logo: +ha_category: Sensor +ha_iot_class: "Cloud Polling" +ha_release: 0.19 +--- + +Sensor to provide travel time from Google maps api. + +Get an api key [here](https://github.com/googlemaps/google-maps-services-python#api-keys). + +```yaml +# Example entry for configuration.yaml +sensor: + platform: google_travel_time + api_key: XXXX_XXXXX_XXXXX + origin: Trondheim, Norway + destination: Paris, France + travel_mode: bicycling # can be ["driving", "walking", "bicycling", "transit"] +``` diff --git a/source/_posts/2016-05-07-empowering-scripts-and-alexa.markdown b/source/_posts/2016-05-07-empowering-scripts-and-alexa.markdown new file mode 100644 index 00000000000..cd9ba085571 --- /dev/null +++ b/source/_posts/2016-05-07-empowering-scripts-and-alexa.markdown @@ -0,0 +1,158 @@ +--- +layout: post +title: "0.19: Empowering scripts and Alexa" +description: "The new release of Home Assistant includes a lot of upgrades to how we handle scripts and make them available in a wide range of new components including automation and alexa." +date: 2016-05-07 11:06:00 -0700 +date_formatted: "May 7, 2016" +author: Paulus Schoutsen +author_twitter: balloob +comments: true +categories: Talks +og_image: /images/blog/2016-05-openiot/preview-video.png +--- + +This release is big. Until now, our automations and scripts have been very static. Starting today it should all be a bit more dynamic. + +**Scripts** are now available in automations and when responding to Alexa/Amazon Echo. Both of these components will now expose data to be used in script templates (including `from_state` !). Passing data to script entities is available by passing the data to the script services. + +```yaml +automation: + trigger: + platform: mqtt + topic: some/notify/topic + action: + service: notify.notify + data_template: + message: {{ trigger.payload }} + +automation 2: + trigger: + platform: state + entity_id: light.hue + action: + service: notify.notify + data_template: + message: {{ trigger.to_state.name }} is now {{ trigger.to_state.state }} +``` + +**Entity Namespaces** allow you to influence the entity ids for a specific platform. For example you can turn `light.living_room` into `light.holiday_home_living_room` with the following config: + +```yaml +light: + platform: hue + entity_namespace: holiday_home +``` + + + + - Automation: allow [script syntax] for action ([@balloob]) + - Automation: expose [`trigger` variable][trigger-variable] to script templates ([@balloob]) + - Script: allow passing variables for script templates in the [script service calls] ([@balloob]) + - Alexa/Amazon Echo: allow [script syntax] for action ([@balloob]) + - Alexa/Amazon Echo: [expose intent variables] to script templates ([@balloob]) + - Script syntax: [conditions now supported] to interrupt execution ([@balloob]) + - Automation: use [new condition syntax] ([@balloob]) + - Script syntax: two new conditions [`and`][con-and] and [`or`][con-or] to combine conditions ([@balloob]) + - Any platform: Allow setting [entity namespace] to prefix entity_ids. ([@balloob]) + - Switch: [Raspberry Pi generic 433 Mhz GPIO adapters][rpi-rf] now supported ([@milaq]) + - Z-Wave: use more sane defaults ([@danieljkemp]) + - Media Player: [Snapcast] now supports picking a source ([@happyleavesaoc]) + - MySensors: major cleanup ([@MartinHjelmare]) + - Binary Sensor: [Command line sensor] now supports classes ([@fabaff]) + - MQTT: [allow client key authentication] ([@timharton]) + - Sensor: [Forecast.io] now supports minutely, hourly and daily summaries ([@aceat64]) + - Media Player: [Pioneer AVR] now supported ([@kylehendricks]) + - Switch: [Acer Projectors] now supported ([@deisi]) + - New [HVAC component] added with Z-Wave support ([@turbokongen]) + - Support added for [OctoPrint] ([@w1ll1am23]) + - Configuration.yaml can now refer to environment variables using `!envvar` ([@bah2830]) + - Lock: [Z-Wave][lock.zwave] now supported ([@devdelay]) + - New [Dweet component] to export data ([@fabaff]) + - Media Player now supports stop command + initial kodi support ([@hmronline]) + - Zigbee: push updates now supported ([@flyte]) + - Wink devices with battery level will now show these ([@w1ll1am23]) + - Templates: new [`as_timestamp`] method now available ([@srcLurker]) + - API: Add [`/api/discovery_info`] with basic instance info ([@robbiet480]) + - Sensor: [Google Maps travel time] added ([@Danielhiversen]) + - HTTP: Allow adding [CORS headers] ([@robbiet480]) + - Sensor: Fitbit support added (@robbiet480) + - Bug fixes and tweaks by [@turbokongen], [@danieljkemp], [@Danielhiversen], [@TheRealLink], [@persandstrom], [@sander76], [@fabaff], [@ishults], [@Bart274], [@robbiet480], [@Cinntax], [@blackdog70], [@gwendalg], [@JshWright], [@kylehendricks], [@bradsk88], [@shaftoe], [@molobrakos], [@bah2830], [@nkgilley] + +[script syntax]: /getting-started/scripts/ +[trigger-variable]: /getting-started/automation-templating/#available-trigger-data +[script service calls]: /components/script/#passing-parameters-in-service-calls +[expose intent variables]: /components/alexa/#configuring-home-assistant +[conditions now supported]: /getting-started/scripts-conditions/ +[new condition syntax]: /getting-started/scripts-conditions/ +[con-and]: /getting-started/scripts-conditions/#and-condition +[con-or]: /getting-started/scripts-conditions/#or-condition +[entity namespace]: /topics/platform_options/#entity-namespace +[rpi-rf]: /components/switch.rpi_rf/ +[Forecast.io]: /components/sensor.forecast/ +[Snapcast]: /components/media_player.snapcast/ +[Command line sensor]: /components/sensor.command_line/ +[allow client key authentication]: /components/mqtt/ +[Pioneer AVR]: /components/media_player.pioneer/ +[Acer Projectors]: /components/switch.acer_projector/ +[HVAC component]: /components/hvac/ +[OctoPrint]: /components/octoprint/ +[Z-Wave]: /components/zwave/ +[lock]: /components/lock/ +[lock.zwave]: /components/lock.zwave/ +[Dweet component]: /components/dweet/ +[`as_timestamp`]: /topics/templating/#home-assistant-template-extensions +[Google Maps travel time]: /components/sensor.google_travel_time/ +[CORS headers]: /components/http/ +[@balloob]: https://github.com/balloob/ +[@milaq]: https://github.com/milaq/ +[@danieljkemp]: https://github.com/danieljkemp/ +[@happyleavesaoc]: https://github.com/happyleavesaoc/ +[@MartinHjelmare]: https://github.com/MartinHjelmare/ +[@fabaff]: https://github.com/fabaff/ +[@timharton]: https://github.com/timharton/ +[@aceat64]: https://github.com/aceat64/ +[@kylehendricks]: https://github.com/kylehendricks/ +[@deisi]: https://github.com/deisi/ +[@turbokongen]: https://github.com/turbokongen/ +[@w1ll1am23]: https://github.com/w1ll1am23/ +[@bah2830]: https://github.com/bah2830/ +[@devdelay]: https://github.com/devdelay/ +[@hmronline]: https://github.com/hmronline/ +[@flyte]: https://github.com/flyte/ +[@srcLurker]: https://github.com/srcLurker/ +[@robbiet480]: https://github.com/robbiet480/ +[@Danielhiversen]: https://github.com/Danielhiversen/ +[@TheRealLink]: https://github.com/TheRealLink/ +[@persandstrom]: https://github.com/persandstrom/ +[@sander76]: https://github.com/sander76/ +[@ishults]: https://github.com/ishults/ +[@Bart274]: https://github.com/Bart274/ +[@Cinntax]: https://github.com/Cinntax/ +[@blackdog70]: https://github.com/blackdog70/ +[@gwendalg]: https://github.com/gwendalg/ +[@JshWright]: https://github.com/JshWright/ +[@bradsk88]: https://github.com/bradsk88/ +[@shaftoe]: https://github.com/shaftoe/ +[@molobrakos]: https://github.com/molobrakos/ +[@nkgilley]: https://github.com/nkgilley/ + +### Deprecations + - Conditions in automations should now specify which condition to use with `condition:` instead of `platform:`. For example `condition: state`. + - RFXtrx has a new config format. + +Old RFXtrx config format: + +```yaml + devices: + 123efab1: + name: My DI.0 light device + packetid: 1b2200000890efab1213f60 +``` + +New RFXtrx config format: + +```yaml + devices: + 1b2200000890efab1213f60: + name: My DI.0 light device +``` diff --git a/source/_cookbook/customize_polling_interval.markdown b/source/_topics/platform_options.markdown similarity index 61% rename from source/_cookbook/customize_polling_interval.markdown rename to source/_topics/platform_options.markdown index ef73095c114..eb8f1300c22 100644 --- a/source/_cookbook/customize_polling_interval.markdown +++ b/source/_topics/platform_options.markdown @@ -1,15 +1,29 @@ --- layout: page -title: "Customize polling interval for any component" +title: "Entity component platform options" description: "Shows how to customize polling interval for any component via configuration.yaml." date: 2016-02-12 23:17 -0800 sidebar: true comments: false sharing: true footer: true -ha_category: Customize Defaults --- +Any component that is based on the entity component allows various extra options to be set per platform. + +### {% linkable_title Entity namespace %} + +By setting an entity namespace, all entities will be prefixed with that namespace. That way `light.bathroom` can become `light.holiday_house_bathroom`. + +```yaml +# Example configuration.yaml entry +light: + platform: hue + entity_namespace: holiday_house +``` + +### {% linkable_title Scan Interval %} + Platforms that require polling will be polled in an interval specified by the main component. For example a light will check every 30 seconds for a changed state. It is possible to overwrite this scan interval for any platform that is being polled by specifying a `scan_interval` config key. In the example below we setup the Philips Hue lights but tell Home Assistant to poll the devices every 10 seconds instead of the default 30 seconds. ```yaml diff --git a/source/_topics/templating.markdown b/source/_topics/templating.markdown index 5bc4c9ea59b..5211753d2a4 100644 --- a/source/_topics/templating.markdown +++ b/source/_topics/templating.markdown @@ -69,6 +69,7 @@ Home Assistant adds extensions to allow templates to access all of the current s - Filter `round(x)` will convert the input to a number and round it to `x` decimals. - `now` will be rendered as current time in your time zone. - `utcnow` will be rendered as UTC time. + - `as_timestamp` will convert datetime object or string to UNIX timestamp - `distance()` will measure the distance in meters between home, entity, coordinates. - `closest()` will find the closest entity. diff --git a/source/getting-started/scripts-conditions.markdown b/source/getting-started/scripts-conditions.markdown index f99b8816726..3ee0d281bd2 100644 --- a/source/getting-started/scripts-conditions.markdown +++ b/source/getting-started/scripts-conditions.markdown @@ -11,6 +11,21 @@ footer: true Conditions can be used within a script or automation to prevent further execution. A condition will look at the system right now. For example a condition can test if a switch is currently turned on or off. +#### {% linkable_title AND condition %} + +Test multiple conditions in 1 condition statement. Passes if all embedded conditions are valid. + +```yaml +condition: and +conditions: + - condition: state + entity_id: 'device_tracker.paulus' + state: 'home' + - condition: numeric_state + entity_id: 'sensor.temperature' + below: '20' +``` + #### {% linkable_title Numeric state condition %} This type of condition attempts to parse the state of specified entity as a number and triggers if the value matches all of the above or below thresholds. @@ -28,6 +43,21 @@ below: 25 value_template: {{ float(state.state) + 2 }} ``` +#### {% linkable_title OR condition %} + +Test multiple conditions in 1 condition statement. Passes if any embedded conditions is valid. + +```yaml +condition: or +conditions: + - condition: state + entity_id: 'device_tracker.paulus' + state: 'home' + - condition: numeric_state + entity_id: 'sensor.temperature' + below: '20' +``` + #### {% linkable_title State condition %} Tests if an entity is a specified state.