Skip to content

Commit a034d4b

Browse files
flowolffrenck
authored andcommitted
truth table for condition sun (home-assistant#3961)
* added truth table to illustrate sunset condition truth table illustrates sunset condition with and without offsets * ✏️ Small typo fix.
1 parent 797fd4a commit a034d4b

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

source/_docs/scripts/conditions.markdown

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,23 @@ condition:
114114
after_offset: "-1:00:00"
115115
```
116116

117+
Here is a truth table to clarify the parameters with and without offset:
118+
119+
| command | night | at sunrise | daytime | at sunset |
120+
| ---------------------------------- | ------------ |:-----------:| ------- |:----------:|
121+
| `after: sunset` | True | ⇒ | False | ⇒ |
122+
| + `after_offset: "01:00:00"` | True | ⇒ | False | **+1h** |
123+
| + `after_offset: "-01:00:00"` | True | ⇒ | False | **-1h** |
124+
| `before: sunset` | False | ⇒ | True | ⇒ |
125+
| + `before_offset: "01:00:00"` | False | ⇒ | True | **+1h** |
126+
| + `before_offset: "-01:00:00"` | False | ⇒ | True | **-1h** |
127+
| `after: sunrise` | False | ⇒ | True | ⇒ |
128+
| + `after_offset: "01:00:00"` | False | **+1h** | True | ⇒ |
129+
| + `after_offset: "-01:00:00"` | False | **-1h** | True | ⇒ |
130+
| `before: sunrise` | True | ⇒ | False | ⇒ |
131+
| + `before_offset: "01:00:00"` | True | **+1h** | False | ⇒ |
132+
| + `before_offset: "-01:00:00"` | True | **-1h** | False | ⇒ |
133+
117134
### {% linkable_title Template condition %}
118135

119136
The template condition will test if the [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'.
@@ -146,7 +163,7 @@ condition:
146163
```
147164

148165
Valid values for `weekday` are `mon`, `tue`, `wed`, `thu`, `fri`, `sat`, `sun`.
149-
Time condition windows can span across the midnight threshold. In the example above, the condition window is from 3pm to 2am.
166+
Time condition windows can span across the midnight threshold. In the example above, the condition window is from 3pm to 2am.
150167

151168
### {% linkable_title Zone condition %}
152169

0 commit comments

Comments
 (0)