Location Based Automation doesn't Trigger When Not_Home

Hey!

This location based automation isn’t working as it should. I want to turn off the Camera Privacy Mode when I’m not home (i.e: inside other zones or away). I’m using “not_home” but it doesn’t trigger, only when I arrive at an “Away Zone” (that is not marked on my map). What am I doing wrong?

Automation Code:
Code

Device History Location:
History

Last Triggered:

Thank you!

Do you have remote access to your HA installation?
Without it HA have no way of knowing that your are not at home, unless you make some automation that react to a sensor that can detect you are not there anymore.
The sensor could be a button you press when you leave, a sensor that looks for your phone on the network and when it is not responding for some time, then setting you as away or it could be presence detection systems, just to list a few options.

Yes, I have!

But even when I turn on Wi-Fi and open HA application on my device (iphone_13_mendonca), this automation doesn’t trigger. I’ve an identical automation, to turn on Privacy Mode when I arrive home and it triggers when I arrive home. :slight_smile:

I think, the issue here is not with the automation, but with your setup.
The way you describe the events when you leave and arrive is typical for a setup where the companion app do not communicate with HA correctly when being away.
HA do not get an update when the device is going away, because the connection is not working, so the message is never received by HA.
HA do get an update when the device is coming back home, because the connection of the WiFi will trigger it and since WiFi is connected, then the message can be delivered to HA.

You say that it works at an “Away Zone”.
What internet connection do you have there? WiFi or still 4G/5G wireless?

When I leave home and go to an Away Zone, It worked with Cellular and Wi-Fi Networks.

So you have WiFi there.
Is there a rule in your router at home to specifically allow connection from that Away Zone’s internet connection into your home network?

I have a couple of questions

  • Can you see in the history for that device_tracker entity if the state ever gets set to ‘not_home’?
  • Do you have any overlapping zones?
  • what happens if you manually change the state of that device_tracker entity to be ‘not_home’.

I found a solution: Tried ‘not_to: home’ instead of ‘to: not_home’ and it worked.
Thanks to Tim0#2666 on Home Assistants’s Discord Server!

1 Like