I have a list of actions in an automation.
action:
- service 1
- service 2
- service 3
Is it possible to conditionally execute service 2, e.g. skip the execution of service 2 depending on a condition?
I have a list of actions in an automation.
action:
- service 1
- service 2
- service 3
Is it possible to conditionally execute service 2, e.g. skip the execution of service 2 depending on a condition?
I am getting an error in the line using “conditions:” “mapping values are not allowed here”. Note that this is in a blueprint.
action:
- service: camera.snapshot
target:
entity_id: !input 'motion_camera'
data:
filename: '{{ folder }}{{ filename }}'
- choose:
- alias "If e-mail notification is enabled send e-mail notification"
conditions:
- '{{ notify_email }}'
sequence:
- service: script.email_snapshot
data:
snapshot_target: !input email
snapshot_title: '{{ title }}'
snapshot_message: '{{ message }}'
snapshot_file: '{{ folder }}{{ filename }}'
You are missing the colon after - alias
.
I am embarrassed. “choose” works perfectly now. Thanks Tom.