mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-23 17:27:19 +00:00
🔨 Fix indents on conditions page (#10061)
This commit is contained in:
parent
a55a950163
commit
b844165f80
@ -120,16 +120,16 @@ The sun state can be used to test if the sun has set or risen.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
condition:
|
||||||
condition: state # 'day' condition: from sunrise until sunset
|
condition: state # 'day' condition: from sunrise until sunset
|
||||||
entity_id: sun.sun
|
entity_id: sun.sun
|
||||||
state: 'above_horizon'
|
state: 'above_horizon'
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
condition:
|
||||||
condition: state # from sunset until sunrise
|
condition: state # from sunset until sunrise
|
||||||
entity_id: sun.sun
|
entity_id: sun.sun
|
||||||
state: 'below_horizon'
|
state: 'below_horizon'
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Sun elevation condition
|
#### Sun elevation condition
|
||||||
@ -141,18 +141,18 @@ For an in depth explanation of sun elevation see [sun elevation trigger][sun_ele
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
condition:
|
||||||
condition: and # 'twilight' condition: dusk and dawn, in typical locations
|
condition: and # 'twilight' condition: dusk and dawn, in typical locations
|
||||||
conditions:
|
conditions:
|
||||||
- condition: template
|
- condition: template
|
||||||
value_template: {% raw %}'{{ state_attr("sun.sun", "elevation") < 0 }}'{% endraw %}
|
value_template: {% raw %}'{{ state_attr("sun.sun", "elevation") < 0 }}'{% endraw %}
|
||||||
- condition: template
|
- condition: template
|
||||||
value_template: {% raw %}'{{ state_attr("sun.sun", "elevation") > -6 }}'{% endraw %}
|
value_template: {% raw %}'{{ state_attr("sun.sun", "elevation") > -6 }}'{% endraw %}
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
condition:
|
||||||
condition: template # 'night' condition: from dusk to dawn, in typical locations
|
condition: template # 'night' condition: from dusk to dawn, in typical locations
|
||||||
value_template: {% raw %}'{{ state_attr("sun.sun", "elevation") < -6 }}'{% endraw %}
|
value_template: {% raw %}'{{ state_attr("sun.sun", "elevation") < -6 }}'{% endraw %}
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Sunset/sunrise condition
|
#### Sunset/sunrise condition
|
||||||
@ -177,22 +177,22 @@ condition:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
condition:
|
||||||
condition: or # 'when dark' condition: either after sunset or before sunrise - equivalent to a state condition on `sun.sun` of `below_horizon`
|
condition: or # 'when dark' condition: either after sunset or before sunrise - equivalent to a state condition on `sun.sun` of `below_horizon`
|
||||||
conditions:
|
conditions:
|
||||||
- condition: sun
|
- condition: sun
|
||||||
after: sunset
|
after: sunset
|
||||||
- condition: sun
|
- condition: sun
|
||||||
before: sunrise
|
before: sunrise
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
condition:
|
||||||
condition: and # 'when light' condition: before sunset and after sunrise - equivalent to a state condition on `sun.sun` of `above_horizon`
|
condition: and # 'when light' condition: before sunset and after sunrise - equivalent to a state condition on `sun.sun` of `above_horizon`
|
||||||
conditions:
|
conditions:
|
||||||
- condition: sun
|
- condition: sun
|
||||||
before: sunset
|
before: sunset
|
||||||
- condition: sun
|
- condition: sun
|
||||||
after: sunrise
|
after: sunrise
|
||||||
```
|
```
|
||||||
|
|
||||||
A visual timeline is provided below showing an example of when these conditions will be true. In this chart, sunrise is at 6:00, and sunset is at 18:00 (6:00 PM). The green areas of the chart indicate when the specified conditions will be true.
|
A visual timeline is provided below showing an example of when these conditions will be true. In this chart, sunrise is at 6:00, and sunset is at 18:00 (6:00 PM). The green areas of the chart indicate when the specified conditions will be true.
|
||||||
@ -253,18 +253,18 @@ condition:
|
|||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
condition:
|
||||||
- condition: numeric_state
|
- condition: numeric_state
|
||||||
entity_id: sun.sun
|
entity_id: sun.sun
|
||||||
value_template: '{{ state.attributes.elevation }}'
|
value_template: '{{ state.attributes.elevation }}'
|
||||||
below: 1
|
below: 1
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: light.living_room
|
entity_id: light.living_room
|
||||||
state: 'off'
|
state: 'off'
|
||||||
- condition: time
|
- condition: time
|
||||||
before: '23:00:00'
|
before: '23:00:00'
|
||||||
after: '14:00:00'
|
after: '14:00:00'
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: script.light_turned_off_5min
|
entity_id: script.light_turned_off_5min
|
||||||
state: 'off'
|
state: 'off'
|
||||||
```
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user