I’m working on an automation that will detect when someone is on the road leaving home as well as another automation to detect when they are coming home. What I did was create two zones, one called Perimeter 1 and the other Perimeter 2 which encircle my house like so:
zone 5:
name: Perimeter 1
latitude: [Latitude of my house]
longitude: [Longitude of my house]
radius: 2500
passive: false
zone 6:
name: Perimeter 2
latitude: [Latitude of my house]
longitude: [Longitude of my house]
radius: 3500
passive: false
My automation looks like something like this:
alias: “Notify Joel is on his way out”
trigger:
platform: state
entity_id: device_tracker.jmricker_jmricker
from: ‘Perimeter 1’
to: ‘Perimeter 2’
action:
service: notify.pushbullet
data_template:
title: “Notification”
message: “Joel is on his way out.”
This is working pretty well. Next I would like to hide this from the map. According to the documentation, making a zone passive will only use the zone for automation and hide it from the UI and not use the zone for device tracker name. This is the part I’m stuck on. If I make the zone passive, the automation doesn’t trigger because the device doesn’t receive the zone name. If passive is mainly used for automations, how do I detect passive zones for triggers?
And then automate like this (the device_tracker.michael is my PING device_tracker which is used to double check I’m at home and avoid false triggers with GPS accuracy problems):
and I use this automation so I know when I’m not just doing things locally in our town (within 2km) by using a boolean for when I go outside the boundary (as I do different automations for that case):
Just looking back over your case and I can see you are using two zones but you can do what you want with one only by just using the states.proximity.perimeter_1.attributes.dir_of_travel I would guess but in any case my examples allow individual and group tracking inside and out of a perimeter so it might come in handy and allow you to do more complex things with your scripts.