Merge branch 'current' into next
This commit is contained in:
commit
14898ed5e3
23 changed files with 438 additions and 58 deletions
13
source/_cookbook/configuration_yaml_by_aneisch
Normal file
13
source/_cookbook/configuration_yaml_by_aneisch
Normal file
|
@ -0,0 +1,13 @@
|
|||
---
|
||||
layout: page
|
||||
title: "Configuration.yaml by aneisch"
|
||||
description: ""
|
||||
date: 2017-2-23 20:27
|
||||
sidebar: true
|
||||
comments: false
|
||||
sharing: true
|
||||
footer: true
|
||||
ha_category: Example configuration.yaml
|
||||
ha_external_link: https://github.com/aneisch/home-assistant/
|
||||
---
|
||||
|
|
@ -16,37 +16,23 @@ This recipe will turn on a light when there is motion and turn off the light whe
|
|||
|
||||
```yaml
|
||||
automation:
|
||||
alias: Turn on kitchen lights when there is movement
|
||||
- alias: Turn on kitchen light when there is movement
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: sensor.motion_sensor
|
||||
to: 'on'
|
||||
platform: state
|
||||
entity_id: sensor.motion_sensor
|
||||
to: 'on'
|
||||
action:
|
||||
service: homeassistant.turn_on
|
||||
entity_id: script.timed_lamp
|
||||
entity_id: light.kitchen
|
||||
|
||||
script:
|
||||
timed_lamp:
|
||||
alias: "Turn on lamp and set timer"
|
||||
sequence:
|
||||
# Cancel ev. old timers
|
||||
- service: script.turn_off
|
||||
data:
|
||||
entity_id: script.timer_off
|
||||
- service: light.turn_on
|
||||
data:
|
||||
entity_id: light.kitchen
|
||||
# Set new timer
|
||||
- service: script.turn_on
|
||||
data:
|
||||
entity_id: script.timer_off
|
||||
|
||||
timer_off:
|
||||
alias: "Turn off lamp after 10 minutes"
|
||||
sequence:
|
||||
- delay:
|
||||
minutes: 10
|
||||
- service: light.turn_off
|
||||
data:
|
||||
entity_id: light.kitchen
|
||||
- alias: Turn off kitchen light 10 minutes after last movement
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: sensor.motion_sensor
|
||||
to: 'off'
|
||||
for:
|
||||
minutes: 10
|
||||
action:
|
||||
service: homeassistant.turn_off
|
||||
entity_id: light.kitchen_light
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue