Is it possible to set up multiple “actions” for an automation depending on the condition?
For example;
- alias: 'Notify Presence'
trigger:
platform: state
entity_id:
- device_tracker.first_device
- device_tracker.second_device
- device_tracker.third_device
- device_tracker.fourth_device
from: not_home
to: home
condition:
- condition: time
after: '08:00:00'
before: '20:00:00'
action:
# How do I only notify this person if they're home too?
- service: notify.person_a
data_template:
title: "Someone's home!"
message: "{{ trigger.to_state.name }} is now home"
# How do I only notify this person if they're home too?
- service: notify.person_b
data_template:
title: "Someone's home!"
message: "{{ trigger.to_state.name }} is now home"
I see that there is support for conditional actions, but it stops the whole action chain when a condition fails instead of just skipping the next action, which means that if person A wasn’t home then it wouldn’t check person B’s presence or send them a message either.
No but you could just create a script for person_a and person_b add a condition at the top of the script then pass the trigger.to_state.name into the script.