Added timed lights with multiple triggers (#6314)

A single sensor is often not enough when it comes to motion sensors so here's an example for multiple sensors
This commit is contained in:
Rick van Hattem 2018-09-19 14:04:44 +02:00 committed by Fabian Affolter
parent cd69cc7f10
commit 1f6eb376b7

View File

@ -36,3 +36,40 @@ automation:
service: homeassistant.turn_off service: homeassistant.turn_off
entity_id: light.kitchen_light entity_id: light.kitchen_light
``` ```
Or in the case of multiple sensors/triggers:
```yaml
automation:
- alias: Turn on hallway lights when the doorbell rings, the front door opens or if there is movement
trigger:
- platform: state
entity_id: sensor.motion_sensor, binary_sensor.front_door, binary_sensor.doorbell
to: 'on'
action:
- service: homeassistant.turn_on
data:
entity_id:
- light.hallway_0
- light.hallway_1
- service: timer.start
data:
entity_id: timer.hallway
- alias: Turn off hallway lights 10 minutes after trigger
trigger:
platform: event
event_type: timer.finished
event_data:
entity_id: timer.hallway
action:
service: homeassistant.turn_off
data:
entity_id:
- light.hallway_0
- light.hallway_1
timer:
hallway:
duration: '00:10:00'
```