Allow templates for enabling conditions (#32771)

This commit is contained in:
Matthias Alphart 2024-05-15 21:05:08 +02:00 committed by GitHub
parent 89f1c4764f
commit b580d022c7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -711,3 +711,37 @@ condition:
entity_id: sun.sun
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 %}