What would be the best way to skip a service in a action or script?
I know you can use Conditions, but that will prevent further execution.
Right now I’m using this to achieve what I want. I have 3 Switches, depending on which switches are “On”, send email to those people.
action:
- service_template: >
{% if is_state("input_boolean.notify_person1", "on") %}
notify.email
{% endif %}
data:
target: [email protected]
title: "(Automated Message)"
message: "Msg for Person1"
- service_template: >
{% if is_state("input_boolean.notify_person2", "on") %}
notify.email
{% endif %}
data:
target: [email protected]
title: "(Automated Message)"
message: "Msg for Person2"
- service_template: >
{% if is_state("input_boolean.notify_person3", "on") %}
notify.email
{% endif %}
data:
target: [email protected]
title: "(Automated Message)"
message: "Msg for Person3"
This works, although you do get a error in the log. “homeassistant.helpers.service: Template rendered invalid service:”
So I was wondering if this is the best approach or is there something better?