mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-22 00:36:49 +00:00
Allow templates for enabling conditions (#32771)
This commit is contained in:
parent
89f1c4764f
commit
b580d022c7
@ -711,3 +711,37 @@ condition:
|
|||||||
entity_id: sun.sun
|
entity_id: sun.sun
|
||||||
state: "above_horizon"
|
state: "above_horizon"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Conditions can also be disabled based on limited templates or blueprint inputs.
|
||||||
|
|
||||||
|
{% raw %}
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
blueprint:
|
||||||
|
input:
|
||||||
|
input_boolean:
|
||||||
|
name: Boolean
|
||||||
|
selector:
|
||||||
|
boolean:
|
||||||
|
input_number:
|
||||||
|
name: Number
|
||||||
|
selector:
|
||||||
|
number:
|
||||||
|
min: 0
|
||||||
|
max: 100
|
||||||
|
|
||||||
|
trigger_variables:
|
||||||
|
_enable_number: !input input_number
|
||||||
|
|
||||||
|
condition:
|
||||||
|
- condition: state
|
||||||
|
entity_id: sun.sun
|
||||||
|
state: "above_horizon"
|
||||||
|
enabled: !input input_boolean
|
||||||
|
- condition: state
|
||||||
|
entity_id: sun.sun
|
||||||
|
state: "below_horizon"
|
||||||
|
enabled: "{{ _enable_number < 50 }}"
|
||||||
|
```
|
||||||
|
|
||||||
|
{% endraw %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user