I am trying to create an automation that, if all residents leave (or when the final resident leaves rather so occupancy becomes zero) based on HA app geo location or all phones leaving the homes wifi/SSID, and if the door is left unlocked, then it will send me a notification.
I can not get any automation to work. Any help is appriciated.
alias: Notification When Everyone Leaves And Door Is Unlocked
description: ""
trigger:
- platform: state
entity_id:
- zone.home
to: "0"
from: null
condition:
- condition: device
device_id: 94bb955a91608334e7018cadb5ede0bd
domain: lock
entity_id: 58dae9b95bffc5d65cc84a41775700b2
type: is_unlocked
action:
- service: notify.notify
data:
message: 🔒🚨FRONT DOOR LEFT UNLOCKED🚨🔒
title: 🔒🚨FRONT DOOR LEFT UNLOCKED🚨🔒
mode: single
Hi Frank. Thank you for the reply. I am kindof new and still learning HA. I just searched for a trigger called “person leaving” and do not see it. Is this option available in the GUI?
As I said, I use SSID - so I simply use the device tracker entity of the mobile of that
person and if that goes from home to not_home I consider the person gone.
I think this is perfect! What was messing up for me was that when ANY trigger occurred, meaning ANYONE left, then it triggered even if people were still home. I did not think of correcting this issue with conditions. Will try this! Thanks so much!