I’m trying to use a “nearhome” zone (same coords as home, but a with a larger radius) to trigger/check in some automations. I want to use this zone to trigger an automation as a person arrives home (eg enters nearhome from the “outside”), as well as suppress another automation if someone happens to be in that zone at the time of triggering.
I have questions which I can’t seem to answer with experimentation (testing a moving location is hard):
Are nearhome and home mutually exclusive? That is, if I am in home, will I also be in nearhome?
If not, how can I check/trigger in which direction nearhome was entered (eg leaving home vs arriving)?
As nearhome is just for automations, I’ve marked it as passive. As such, its state is always 0. Can I still check if a specific person is in nearhome during an automation?
Seems they are not (you will be in both), except as Near Home is passive, its count will always be 0.
Not relevant, as you can only enter “from the outside” anyway.
You cannot check if a person is in a passive zone. Which although makes sense, does make it more difficult to use in automations in the way I want. “Passive zones can still be used in automations” therefore seems a bit imprecise. I think what is meant was “Entering and exiting passive zones can still be used as triggers”. At which point I wonder what the benefit of passive zones are apart from hiding them from the map?
We live in a gated community with only one way in/out, so I set up a gate zone and a home zone which do not touch or overlap. This may be a solution for you depending on how you access your home from ‘away’. If you have just one approach into your community that would be pretty easy. It does get more complicated (more passive zones) if ther are multiple approach routes.
I’ve got a similar setup and am struggling to make sense of the passive zones.
How did you get this to work?
I have a passive zone that covers a 600m radisu around my home. And a home zone which is active and inside the passive zone.
I want to be able to toggle my alarm on when I leave the house, but leave some devices on. However, if I leave the local area zone (600m radius one) I want to turn off those extra devices as I’m likely away from home for a longer time and not just on a walk or at a shop.
It sounds like a passive zone should work for you? What’s the issue you’re seeing?
I personally gave up on passive zones (or indeed any zone that’s centred on “home”) and use a proximity sensor based off of home instead. Then the automation just waits for a distance to hit a certain level.
This has the benefit of the zones being “virtual”, dynamic and per user (I have an automation that “grows” a zone for return as the target gets further away for example).
You do lose the count per zone however, but I think the root issue here are using zones for non-physical concepts like “near”, so I don’t really need a count anyway.
I think I worked out what was going wrong and how to use passive zones. When I was testing I wasn’t getting any meaningful data that I could make sense of. E.g. passive zones don’t state the number of people in them, they don’t get attached as a zone name to a person state.
They way I’ve got it working now is to use
trigger: zone
entity_id: person.***
zone: zone.local_area
event: leave #could be leave or enter
This seems to trigger when ever the person leaves the passive zone of zone.local_area.
In the case of having two overlapping zones, 1. active home zone and 2. a passive local area zone. I’ve decided to trigger when a person state changes from home to not_home. And then use a wait_for_trigger to wait until the person triggers the zone.local_arealeave event. This way the two zones can overlap and work concurrently as active and passive and allow them to be used in a logical way in automations and scripts.
triggers:
- trigger: state
entity_id:
- person.*****
from: home
to: not_home
for:
hours: 0
minutes: 1
seconds: 30
conditions: []
actions:
- wait_for_trigger:
- trigger: zone
entity_id: person.***
zone: zone.local_area
event: leave #could be leave or enter
for:
hours: 0
minutes: 3
seconds: 0
continue_on_timeout: false
timeout:
hours: 0
minutes: 5
seconds: 0
milliseconds: 0
I didn’t. I was trying to understand what the values of zone states would be in the Dev Tools. Or by using a zone as a trigger and then inspecting the trigger variables. But they were behaving in a way that made sense to me at first.