Automation on leaving home zone I can't get it to work

Hi All. New here - first post. Current Hubitat user previous SmartThings - dabbling in HA now.

I have been TRYING to get HA to send a notification when I leave the home zone - doing simple testing so I can have it do more … but I can’t get it to work.

I have the HA app on my phone IOS

Location settings to always allow.

do I require some kind of 3rd party location tracker in HA to make this work? Do I require a cloud subscription?

In the example I am attaching I want it to simply send a notification and then turn on a switch (just so I can track and see if it works). Been trying different things for a week no success.

Attaching screen shot of the automation … this is just one of several approaches I have tried without success.


1 Like

Why are you using not_home (“Away”) as the from state? Do you have nested zones or something similar?

Also, please follow Community Guideline #11 by sharing automation configuration as properly-formatted text, not images.

Just trying ANYTHING to get an example working. Yes I DO have nested zones - I may have not done this correctly. I have the default Home zone - then an AWAY zone that is larger (about 2 mile dia) and yet another vacation one about 50 mi dia. Should I change this?

Nested zones can sometimes cause issues, you would likely be better off setting up a Proximity sensor instead of the 2 large zones.

However, the issue might just be the name of your 2 mile zone. When using the Automation editor, it will provide “friendly” frontend representations for certain states depending on the entity type and class. For persons and device trackers, the state not_home has a frontend representation “Away”. So, selecting “Away” might not be choosing what you thought it was choosing… try changing the name of your 2 mile zone to something other than “Away” and then retest.

Other important docs:

Thanks so much. For now I just deleted the other 2 zones - makes testing easier. It is clear I probably need to better understand Zones in HA.

What I want is to trigger certain automations when I am … away from home - but lets say AWAY (for me) is outside a 2 mile radius. Is there a better way to handle this in HA.

I removed the away zone and vacation zone I am leaving soon so can test. I will modify the code so it (hopefully) messages me once I leave the home zone.

I removed the other 2 zones and changed the code so I am hoping it messages me and turns off this switch per the code here

alias: aa TEST tom AWAY from home
description: ""
  - platform: state
      - device_tracker.fred_flintstone_toms_iphone
    from: home
    to: not_home
condition: []
  - service: notify.notify
    metadata: {}
      message: Tom Away HA message test
  - type: turn_off
    device_id: c37416f6638e983c8f4f0cb98269a68c
    entity_id: 48a8d81ebde6a4dcf30747730240bf36
    domain: switch
mode: single

Well - still no luck getting ANY location automation to work. I simplified and deleted all zones except the home zone. I have the proximity app installed . I’ve tried a number of simple automations when I leave or enter the home zone to either send me a message and/or turn on a simple switch I MUST be missing something.

Does your device have external access to HA? Double check the device tracker entity’s history to make sure it is changing from home to not_home.

1 Like

It is NOT apparently changing to not_home. It shows I currently AM home, and my correct GPS location and address. And yesterday when I left it shows “exited” …

Someone on reddit posted I need HA cloud or some way like life360 or owntracks to track my location externally. I did just sign up for HA cloud I was going to test today or tomorrow and see if this works now.

If you have the HA companion app installed, you probably don’t need Life360 or OwnTracks.

You also do not need HA Cloud. What you need is a way to connect to your HA server from outside your home network. There are a number of options described in the Remote Access documentation. That being said, HA Cloud is recommended since it’s easy and supports the HA project.

1 Like