icloud3 icon indicating copy to clipboard operation
icloud3 copied to clipboard

Stationary zones & other device trackers

Open ehendrix23 opened this issue 2 years ago • 7 comments

I just discovered an issue where the creation of the stationary zones bu iCloud3 is creating an issue for other device trackers. For example,

I have a device tracker for the location of my car. Now the state of this device tracker is showing the stationary zone instead of not_home or away.

Not sure if there is something so that icloud3 can use the zones but they are then not used by anything else within HASS?

ehendrix23 avatar Jan 22 '22 00:01 ehendrix23

iCloud3 created the stationary zone by adding it to HA when you haven’t moved for a period of time. HA and the iOS App talk to each other so the iOS app gets the zone’s location, which lets the iOS app then send zone exit triggers, which are then picked up by iCloud3 to exit the zone. Your car’s tracker is picking up the same zone info. If you are in a stationary zone, you are obviously not home and away. Any automations or scripts set up to trigger on a zone enter/exit will have to be changed to exclude the stationary zone if that is a problem.

To not create a stationary zone with iCloud3, set the stationary_still_time parameter to a very large number (9999 hrs) and it will probably never be created.

gcobb321 avatar Jan 22 '22 01:01 gcobb321

The device tracker for the car is created by another component. Looking at the zone documentation, any zone created with flag passive will not be used by other device tracker entities etc. Not sure but are these stationary ones created as passive? If they are then any other device tracker would not be using them as a zone to set state to.

ehendrix23 avatar Jan 22 '22 01:01 ehendrix23

When the zone is created, it is non-passive so the iOS app will move into it and exit from it. The radius and location are also set. When the zone is exited, its location Is reset to a ‘base’ location that defaults to 1km north of your home zone with a radius of 1m so you will not drive into it later on and mess up zone enter/exit triggers from the iOS app. When it moves into the base location, it is set to passive.

gcobb321 avatar Jan 22 '22 01:01 gcobb321

So if I understand it correctly, the zone is set to non-passive to get triggers when the iOS app moves into or exits from it correct? Thus meaning that if a zone is passive the iOS app does not trigger anything when moving into or exiting from it?

According to this: https://github.com/home-assistant/iOS/pull/926 and https://github.com/home-assistant/iOS/issues/924 it would seem to me that this was changed in 2020 and it should trigger even when the zone is set to passive. Am I wrong in this?

ehendrix23 avatar Jan 22 '22 17:01 ehendrix23

I hadn’t seen those updates. I know there were issues Zack had been working on last year regarding gps accuracy, firing enter triggers when he got within 100m of a zone, regardless of its size and fitting enter/exit triggers when the gps accuracy was poor. If I remember, a passive zone does not appear on a map.

gcobb321 avatar Jan 24 '22 22:01 gcobb321

Would make sense for a passive zone not to appear on a map I would think, but it seems that it would trigger when entering or exiting a zone. Is this something we can check/try? And if so, how to check/try to make sure it does trigger when exiting the zone?

ehendrix23 avatar Jan 25 '22 16:01 ehendrix23

Easiest way is to set one of your regular zones to passive and restart HA. Then see if everything works as expected.

gcobb321 avatar Jan 27 '22 07:01 gcobb321