Allow templates for enabling automation triggers (#32662)

This commit is contained in:
Matthias Alphart 2024-05-16 09:23:09 +02:00 committed by GitHub
parent 05f95b1648
commit ae8aae8d5a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1035,3 +1035,35 @@ automation:
- platform: time
at: "15:32:00"
```
Triggers can also be disabled based on limited templates or blueprint inputs. These are only evaluated once when the automation is loaded.
{% 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
trigger:
- platform: sun
event_type: sunrise
enabled: !input input_boolean
- platform: sun
event_type: sunset
enabled: "{{ _enable_number < 50 }}"
```
{% endraw %}