good day,
I have this automation that checks if any windows, doors or gates are open when my security is armed and when we leave home. However, there’s about 18 windows, doors or gates so when the automation fires, it would be a bit ambiguous as to which sensor is open. Would it be possible to include the friendly name (or tag/id) of the sensor that failed the conditions in the tts notify? thanks
alias: Gate, door or window is opened warning when leaving or arming the house
description: >-
Let you know if a gate, door or window is opened when you leave the house or
arm the system.
trigger:
- platform: state
entity_id:
- group.somebody_home
for:
hours: 0
minutes: 3
seconds: 0
from: home
to: not_home
id: left the house
- platform: state
entity_id:
- alarm_control_panel.partition1
from: disarmed
to: armed
id: armed the house
condition:
- condition: state
entity_id:
- binary_sensor.back_door_2
- binary_sensor.basement_bedroom_windowl_2
- binary_sensor.basement_bedroom_windowr_2
- binary_sensor.basement_fam_room_winl_2
- binary_sensor.basement_fam_room_winr_2
- binary_sensor.front_door_2
- binary_sensor.garage_door_2
- binary_sensor.dining_room_window
- binary_sensor.leonardo_s_bedroomn_window_2
- binary_sensor.living_room_window_2
- binary_sensor.master_bedroom_window_2
- binary_sensor.valentina_s_bedroom_window_2
- binary_sensor.lumi_lumi_sensor_magnet_aq2_opening_2
- binary_sensor.lumi_lumi_sensor_magnet_aq2_opening_3
- binary_sensor.lumi_lumi_sensor_magnet_aq2_opening_4
- binary_sensor.gate_front_door_side_2
- binary_sensor.gate_garage_side_2
state: "on"
action:
- choose:
- conditions:
- condition: trigger
id: armed the house
sequence:
- service: notify.mobile_app_sony_xperia_zx1
data:
title: >-
You {{trigger.id}}, but the outside gate, door or window is
opened.
message: Something Left Open
- service: notify.mobile_app_iphone
data:
title: >-
You {{trigger.id}}, but the outside gate, door or window is
opened.
message: Something Left Open
- service: tts.cloud_say
data:
entity_id:
- media_player.nesthub9c87
- media_player.kitchen_display
- media_player.family_room_display
- media_player.basement_family_room
- media_player.bonus_room_display
message: >-
You {{trigger.id}}, but the outside gate, door or window is
opened.
- conditions:
- condition: trigger
id: left the house
sequence:
- service: notify.mobile_app_sony_xperia_zx1
data:
title: >-
You {{trigger.id}}, but the outside gate, door or window is
opened.
message: Something Left Open
- service: notify.mobile_app_iphone
data:
title: >-
You {{trigger.id}}, but the outside gate, door or window is
opened.
message: Something Left Open
default: []
mode: single