From 3f66105c808491a4b8f0e59bd6a9337c95bb6e7d Mon Sep 17 00:00:00 2001 From: Carlo Costanzo Date: Tue, 22 Sep 2015 21:16:26 -0400 Subject: [PATCH] Updated automation example Updated to reflect the new single automation block using alias to define each rule within. --- source/components/automation.markdown | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/source/components/automation.markdown b/source/components/automation.markdown index 65039a51d46..fcbbd51f131 100644 --- a/source/components/automation.markdown +++ b/source/components/automation.markdown @@ -19,7 +19,7 @@ full configuration but only the relevant part. ```yaml # Example of entry in configuration.yaml automation: - alias: Light on in the evening +- alias: 'Rule 1 Light on in the evening' trigger: - platform: sun event: sunset @@ -37,11 +37,24 @@ automation: action: service: homeassistant.turn_on entity_id: group.living_room + +- alias: 'Rule 2 - Away Mode' + + trigger: + - platform: state + entity_id: group.all_devices + state: 'not_home' + + condition: use_trigger_values + condition: + action: + service: light.turn_off + entity_id: group.all_lights + ```

-All configuration entries have to be sequential. If you have automation:, -automation 2: and automation 4: then the last one will not be processed. +With the updated automation layout, you are now able to list all rules under on a single `automation:` entry. Use `-alias` to define the start of each rule.

- [Jump to conditions](#conditions)