Add new example for restricting motion sensor lights based on time and using transitions (#6512)

This commit is contained in:
Brian J King 2018-10-04 12:52:47 -05:00 committed by Franck Nijhof
parent 746b3cb303
commit 6c1fc639f7

View File

@ -73,3 +73,36 @@ timer:
hallway:
duration: '00:10:00'
```
You can also restrict lights from turning on based on time of day and implement transitions for fading lights on and off.
```yaml
- alias: Motion Sensor Lights On
trigger:
platform: state
entity_id: binary_sensor.ecolink_pir_motion_sensor_sensor
to: 'on'
condition:
condition: time
after: '07:30'
before: '23:30'
action:
service: homeassistant.turn_on
entity_id: group.office_lights
data:
transition: 15
- alias: Motion Sensor Lights Off
trigger:
- platform: state
entity_id: binary_sensor.ecolink_pir_motion_sensor_sensor
to: 'off'
for:
minutes: 15
action:
- service: homeassistant.turn_off
entity_id: group.office_lights
data:
transition: 160
```