Update automation documentation

This commit is contained in:
Paulus Schoutsen 2015-06-13 10:05:40 -07:00
parent edabc798ff
commit b0d08f5032
2 changed files with 18 additions and 14 deletions

@ -1 +1 @@
Subproject commit 1f74908bdf147629f9b317058316714e2ffd1ec2
Subproject commit 7b44ce4deebc812e4fb978358d04cb0af15c44cd

View File

@ -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'
```
<p class='note'>
Use quotes around your values for <code>state_from</code> and <code>state_to</code> to avoid the YAML parser interpreting some values as booleans.
</p>
## 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