Fix indentation and remove use_trigger_values (fixes #2306) (#2313)

This commit is contained in:
Fabian Affolter 2017-03-21 20:44:47 +01:00 committed by GitHub
parent 48084ee55e
commit e4246aa25a
3 changed files with 99 additions and 109 deletions

View file

@ -16,42 +16,37 @@ Turn on a light in the living room when it starts raining, someone is home, and
```yaml
automation:
alias: 'Rainy Day'
trigger:
- platform: state
entity_id: sensor.precip_intensity
state: 'rain'
- platform: state
entity_id: group.all_devices
state: 'home'
- platform: time
after: '14:00'
before: '23:00'
condition: use_trigger_values
action:
service: light.turn_on
entity_id: light.couch_lamp
- alias: 'Rainy Day'
trigger:
- platform: state
entity_id: sensor.precip_intensity
state: 'rain'
condition:
- platform: state
entity_id: group.all_devices
state: 'home'
- platform: time
after: '14:00'
before: '23:00'
action:
service: light.turn_on
entity_id: light.couch_lamp
```
And then of course turn off the lamp when it stops raining but only if it's within an hour before sunset.
```yaml
automation 2:
alias: 'Rain is over'
trigger:
- platform: state
entity_id: sensor.precip_intensity
state: 'None'
- platform: sun
event: 'sunset'
offset: '-01:00:00'
condition: use_trigger_values
action:
service: light.turn_off
entity_id: light.couch_lamp
- alias: 'Rain is over'
trigger:
- platform: state
entity_id: sensor.precip_intensity
state: 'None'
condition:
- condition: sun
after: 'sunset'
offset: '-01:00:00'
action:
service: light.turn_off
entity_id: light.couch_lamp
```