mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-23 01:06:52 +00:00
Update conditions.markdown
This commit is contained in:
parent
4ae0644122
commit
147513b7c7
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user