Hello!
I’m new here and a beginner in Home Assistant and am just about to gradually migrate from HomeKit to Home Assistant because, among other things, the unreliability & problems that HomeKit and especially Siri have since IOS/TVOS 16 just gets on my nerves. Currently I’m struggling with a presence automation and would be very happy about a tip …
I want to lock the front door when the last person leaves the house - since there is apparently no person group in HA which would make the whole thing much easier and I have not managed to create a person group manually via yaml I have created two automations… one is that the front door will be locked when I leave the zone of our house with the condition that my wife’s smartphone is not at home and the second automation is the other way around… The HA app is installed on our smartphones and the location of both smartphones is shared.
Unfortunately the automation does not trigger and I don’t know what the reason is and if I have a mistake in thinking… the one automation:
alias: Michael leaves the apartment
description: “”
trigger:
- platform: device
device_id: xxx
domain: device_tracker
entity_id: device_tracker.xxx_von_michael
type: leaves
zone: zone.home
condition: - condition: device
device_id: xxx
domain: device_tracker
entity_id: device_tracker.xxx
type: is_not_home
action: - device_id: xxx
domain: lock
entity_id: lock.nuki_wohnungstur_schloss_lock
type: lock - service: notify.xxx_von_michael
data:
message: the apartment door was locked! - service: scene.turn_on
target:
entity_id: scene.general_all_lamps_out_actions
metadata: {}
mode: single
Regards!
Michael