I have a group of presence sensors e.g. binary_sensor.dad_home, binary_sensor.mum_home, binary_sensor.guest_smartthings etc and some device trackers from owntracks and my unifi APs. I’ve created automations that are triggered by someone arriving/leaving etc, but how do I add the actual person or sensor to the alert?
e.g
- alias: 'Heating, Hot Water on and Alarm off when someone arrives'
trigger:
- platform: state
entity_id: group.presence
from: 'off'
to: 'on'
- platform: state
entity_id: group.all_devices
from: 'not_home'
to: 'home'
condition:
condition: or
conditions:
- condition: state
entity_id: group.presence
state: 'off'
- condition: state
entity_id: group.all_devices
state: 'not_home'
action:
- service: climate.set_operation_mode
entity_id: climate.hive_heating
data:
operation_mode: "SCHEDULE"
- service: climate.set_operation_mode
entity_id: climate.hive_hotwater
data:
operation_mode: "SCHEDULE"
- service: notify.html5
data:
title: "Welcome Home!"
message: "{{ as_timestamp(now()) | timestamp_custom('%I:%M%p', true) }} Alarm disarmed and Central Heating set to Schedule"
- service: alarm_control_panel.alarm_disarm
entity_id: alarm_control_panel.house
How do I modify the above automation to include the actual presence device or device tracker that triggered it?
Thanks in advance