From b0d08f5032f4cdb38fe8acb4cb493d03a15eb779 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sat, 13 Jun 2015 10:05:40 -0700 Subject: [PATCH] Update automation documentation --- _deploy | 2 +- source/components/automation.markdown | 30 +++++++++++++++------------ 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/_deploy b/_deploy index 1f74908bdf1..7b44ce4deeb 160000 --- a/_deploy +++ b/_deploy @@ -1 +1 @@ -Subproject commit 1f74908bdf147629f9b317058316714e2ffd1ec2 +Subproject commit 7b44ce4deebc812e4fb978358d04cb0af15c44cd diff --git a/source/components/automation.markdown b/source/components/automation.markdown index 54fdefc8c70..74ac93b01bb 100644 --- a/source/components/automation.markdown +++ b/source/components/automation.markdown @@ -21,8 +21,8 @@ automation: # Type of trigger and information for the trigger platform: state state_entity_id: sun.sun - state_from: above_horizon - state_to: below_horizon + state_from: 'above_horizon' + state_to: 'below_horizon' # Action to be done when trigger activated execute_service: notify.notify @@ -53,25 +53,29 @@ Here are some example values: This allows you to trigger actions based on state changes of any entity within Home Assistant. You can omit the `state_from` and `state_to` to match all. ``` -# Match when the sun sets + # Match when the sun sets platform: state state_entity_id: sun.sun - state_from: above_horizon - state_to: below_horizon + state_from: 'above_horizon' + state_to: 'below_horizon' # Match when a person comes home platform: state state_entity_id: device_tracker.Paulus_OnePlus_One - state_from: not_home - state_to: home + state_from: 'not_home' + state_to: 'home' # Match when a light turns on platform: state state_entity_id: light.Ceiling - state_from: off - state_to: on + state_from: 'off' + state_to: 'on' ``` +

+ Use quotes around your values for state_from and state_to to avoid the YAML parser interpreting some values as booleans. +

+ ## Setting up the action Currently the only supported action is calling a service. Services are what devices expose to be controlled, so this will allow us to control anything that Home Assistant can control. @@ -100,8 +104,8 @@ automation: platform: state state_entity_id: sun.sun - state_from: above_horizon - state_to: below_horizon + state_from: 'above_horizon' + state_to: 'below_horizon' execute_service: notify.notify service_data: {"message":"The sun has set"} @@ -121,8 +125,8 @@ automation 3: platform: state state_entity_id: device_tracker.Paulus_OnePlus - state_from: not_home - state_to: home + state_from: 'not_home' + state_to: 'home' execute_service: homeassistant.turn_on service_entity_id: group.Study_Room