mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-19 07:17:14 +00:00
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:
parent
cd69cc7f10
commit
1f6eb376b7
@ -36,3 +36,40 @@ automation:
|
||||
service: homeassistant.turn_off
|
||||
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'
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user