TLDR: I was using ios companion app via GPS tracking to close and open my car gate based on entering or leaving two zones (one wider zone for arrival, one narrower zone for leaving the house). For 1,5 year I never had any single issue, not one unwanted gate opening. For an unkown reason GPS accuracy became terrible recently, and my phone is “jumping” between zones with 1 second differences, causing an automation nightmare, gate opening, stopping halfway, then closing, stopping, opening again, you can imagine, became completely unusable. I’d like to put a time based condition on the trigger, so when I enter the zone in which I’d like to close the gate, I have to be there/or let’s say, not leave it for 5 second, before firing the action, closing the gate. I need your help to achieve it, my current automation is at the end of this post.
Background:
I received so much help from this community and I have a great hope for the community to step in once more to help me solve my issue.
I have two location based automations to contol my car gate door. I have 2 extra zones set up for this purpose besides my home zone: a wider “neighbourhood” zone for opening the gate, covering several streets in the neighborhood, this way the gate has enough time to fully open, and I just slip through like Michael Douglas as Van Orton in The Game (don’t know why, but this scene as he pushes his 7er Bimmer through the gates stuck in my mind ) ; and one narrower “leaving” zone for leaving the house: this ensures that the gate starts to close as soon as I’m a couple houses past my home.
This setup worked flawlessly for 1.5 years, not failing on me once, never had any unwanted gate event, and I freakin’ enjoyed the luxury high life HA granted me
But all this went away, and now unwanted state changes occur constantly. Honestly I don’t know what happened or changed, any update or so, it just started to happen: leaving the house automation still works 100%, but arriving just became a nightmare, for the following reason: when I enter neighbourhood zone, gate starts to open, while I’m approaching my house GPS inaccuracy throws me into Home zone for a few seconds, and as I get closer during these seconds, then it puts me into the narrower “leaving” zone, thus immediately closes the gate just as I arrive to the gate. Sounds frustrating, uh? You can’t imagine, it kills me every time.
(To add a top layer 1st world misery on this cake: as I’m close to the house, my phone starts picking up and loosing my home wifi in a loop (signal is weak at the gate), and as I try to open the gate in Home app, I just get unresponsive devices because of the constant network changes So I’m stuck at the gate for a couple of minutes until I manage to finally open that freakin’ gate.)
Tried to search on the problem, but after reading a lot of similar GPS inaccuracy reports I’m surprised now how it was working for me at all super flawlessly for the past 1,5 years, so I thought about putting a time based condition on the leaving-close-gate automation, to avoid these accidental zone enter-exit changes.
So, I’d like to ask a little automation condition config help how to properly achieve this:
- trigger: when zone “leaving” entered
- condition: be in/or did not leave zone “leaving” for 5 seconds
- action: ONLY THEN close the gate.
If anyone has any other smarter/simpler solution to the problem, please don’t hold it back, share with me!
My automation in it’s current form:
alias: Close the gates after I leave
description: ''
trigger:
- platform: zone
entity_id: device_tracker.iphone12pro
zone: zone.leaving
event: leave
condition: []
action:
- device_id: c976348e0df011ebb15c356dbb4e5d0c
domain: cover
entity_id: cover.frontgate
type: close
- device_id: b05dceae0df011ebafa47188d05deb72
domain: cover
entity_id: cover.garage
type: close
mode: single
Thanks in advance for anyone trying to help!