Skip to content

Commit f97d518

Browse files
Humanarsaboo
authored andcommitted
Provide an example of how to make a 'when dark' condition by ORing sunrise and sunset conditions. (home-assistant#4652)
See issue#12308 at home-assistant/core#12308
1 parent 8226c05 commit f97d518

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

source/_docs/scripts/conditions.markdown

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,16 @@ condition:
114114
after_offset: "-1:00:00"
115115
```
116116

117+
```yaml
118+
condition:
119+
condition: or # 'when dark' condition: either after sunset or before sunrise
120+
conditions:
121+
- condition: sun
122+
after: sunset
123+
- condition: sun
124+
before: sunrise
125+
```
126+
117127
Here is a truth table to clarify the parameters with and without offset:
118128

119129
| command | night | at sunrise | daytime | at sunset |

0 commit comments

Comments
 (0)