mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-21 16:27:19 +00:00
Allow templates for enabling automation triggers (#32662)
This commit is contained in:
parent
05f95b1648
commit
ae8aae8d5a
@ -1035,3 +1035,35 @@ automation:
|
|||||||
- platform: time
|
- platform: time
|
||||||
at: "15:32:00"
|
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 %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user