Update conditions.markdown

This commit is contained in:
Erik Montnemery 2019-05-10 15:13:02 +02:00 committed by GitHub
parent 4ae0644122
commit 147513b7c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -119,7 +119,7 @@ condition:
```
### {% linkable_title Sun condition %}
#### Sun state condition
#### {% linkable_title Sun state condition %}
The sun state can be used to test if the sun has set or risen.
```yaml
@ -136,9 +136,10 @@ condition:
state: 'below_horizon'
```
#### Sun elevation condition
#### {% linkable_title Sun elevation condition %}
The sun elevation can be used to test if the sun has set or risen, it is dusk, it is night etc. when a trigger occurs.
For an in depth explanation of sun elevation see [sun trigger][sun_trigger].
For an in depth explanation of sun elevation see [sun elevation trigger][sun_elevation_trigger].
[sun_elevation_trigger]: /docs/automation/trigger/#sun-elevation-trigger
```yaml
condition:
@ -156,7 +157,7 @@ condition:
value_template: {% raw %}'{{ states.sun.sun.attributes.elevation < -6 }}'{% endraw %}
```
#### Sunset/sunrise condition
#### {% linkable_title Sunset/sunrise condition %}
The sun condition can also test if the sun has already set or risen when a trigger occurs. The `before` and `after` keys can only be set to `sunset` or `sunrise`. They have a corresponding optional offset value (`before_offset`, `after_offset`) that can be added, similar to the [sun trigger][sun_trigger].
[sun_trigger]: /docs/automation/trigger/#sun-trigger