I want to get a notification when my wife leaves the house for work - but I can’t seem to get it working right. I have set a ‘leaving window’ schedule which is a two hour period in a morning which is when my wife typically leaves which acts as the trigger. Then a series of triggers must be met:
I must have already left.
Lights must be off in the house
Front door must have just closed
My wife’s iPhone doest seem to report location…that would have been the simplest option. This method uses the state of lights and front door opening to infer that she has left.
Here is my code which doesn’t seem to work. Am I using the right approach?
Thanks everyone!
alias: Home - Has Left Notification
description: ""
trigger:
- platform: state
entity_id:
- schedule.leaving_window
to: "on"
action:
- wait_template: |2-
- wait_template: {{ not is_state('person.me', 'home') }}" and
- wait_template: {{ is_state('light.kitchen', 'off') }}" and
- wait_template: {{ is_state('light.living_room', 'off') }}" and
- wait_template: {{ is_state('binary_sensor.hallway_frontdoor', 'Open') }}"
continue_on_timeout: false
- wait_for_trigger:
- platform: state
entity_id:
- binary_sensor.hallway_frontdoor_opener
from: "on"
to: "off"
continue_on_timeout: false
timeout:
hours: 2
minutes: 0
seconds: 0
milliseconds: 0
enabled: false
- service: notify.mobile_app_phone
data:
message: xxx has left the house
title: Home Notification
mode: single