mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-23 17:27:19 +00:00
Merge pull request #137 from philipbl/sun-condition
Add documentation for new sun condition
This commit is contained in:
commit
c7a9ef3262
@ -242,6 +242,19 @@ automation:
|
|||||||
state: not_home
|
state: not_home
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### {% linkable_title Sun condition %}
|
||||||
|
|
||||||
|
The sun condition can 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).
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
automation:
|
||||||
|
condition:
|
||||||
|
platform: sun
|
||||||
|
after: sunset
|
||||||
|
# Optional offset value
|
||||||
|
after_offset: "-1:00:00"
|
||||||
|
```
|
||||||
|
|
||||||
#### {% linkable_title Template condition %}
|
#### {% linkable_title Template condition %}
|
||||||
|
|
||||||
The template condition will test if [given template][template] renders a value equal to true. This is achieved by having the template result in a true boolean expression or by having the template render 'true'.
|
The template condition will test if [given template][template] renders a value equal to true. This is achieved by having the template result in a true boolean expression or by having the template render 'true'.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user