Hi all,
I have tried to set up an a simple automation to send a message to my phone once it recognises that I have left home. This is just a very basic automation to teach HA for myself.
I have searched other threads have tried to use others methods.
It is not working and I am hoping that someone can point me in the right direction.
The log files does not show anything to suggest that I have left home. Nor does the automation trace.
Here is the code for the automation:
alias: Leaving home
description: ''
trigger:
- platform: zone
entity_id: device_tracker.sm_s906e
zone: zone.home
event: leave
condition: []
action:
- service: notify.mobile_app_sm_s906e
data:
message: Leif has left home
mode: single
platform: device
device_id: c3c350836d270a6ab7f59a03403e1d18
domain: device_tracker
entity_id: device_tracker.richs_phone
type: leaves
zone: zone.home_2
'''
Use the device as a trigger, not the zone.
Literally works 100% of the time.
Your automation works fine for me. I use similar code without any issues. You can test it by amending the longitude/latitude of your device tracker in developer tools. Maybe check that your device tracker is reporting correctly…
alias: leave home
description: ''
trigger:
- platform: zone
entity_id: device_tracker.le2123
zone: zone.home
event: leave
condition: []
action:
- service: notify.notify
data:
message: you have left home
mode: single
Thank you very much for the feedback, much appreciated.
I will check my coordinates again.
Feedback like this makes me feel like I’m not totally hopeless.