A Blueprints Exchange author has posted two linked Home Assistant blueprints for one stubborn job: getting a driveway gate to be open when the car arrives, not before and not after. Both are posted on the Home Assistant Community forum. Neither is a product, and we have not run them. Here is what they do and what to check before borrowing the ideas.
The problem they solve
According to the author, the companion app reports location every 40 to 120 seconds while driving. A 400 m zone can be crossed between two reports, so a plain zone trigger fires with the car already waiting at a shut gate. The author logs one case where the trigger came 55 seconds late.
Timing cuts the other way too. The author’s gate auto-closes on a fixed cycle of about 20 seconds opening, 90 seconds open and 20 seconds closing. Pulse too early and it is closing as you arrive. The gate uses one relay for open, close and stop, so a pulse while it is moving stops it part-open.
Blueprint one: open on approach
The gate blueprint starts watching at 1600 m by default and pulses at 550 m. If the gate auto-closes before arrival, it pulses again, but only after the gate has read closed for 15 seconds. A shared lock stops two people arriving together from double-pulsing. It needs a person, a distance-to-home sensor in metres, an away timer, a cover for the gate and an input_boolean. The author says the repo has an example package with all of these.
Two details worth stealing. The distance sensor measures to the zone centre, not the gate, so calibrate against where the car actually waits. And on an imperial system, do not give a template distance sensor the distance device class, because Home Assistant converts it to feet and every threshold is silently wrong.
Blueprint two: high accuracy only when needed
The Android companion turns the app’s high-accuracy location on about 8 km out and off again once you have been home 5 minutes. It sets a 15 second interval before switching on, so the phone never runs at the app’s 5 second default. It also turns off if you drive away, after 45 minutes at most, and after a Home Assistant restart. Commands go at high priority with a time-to-live of zero, because the author found normal-priority pushes can be held while a phone dozes.
It is Android only. The commands do nothing on an iPhone. It needs a person, a distance sensor and the phone’s notify service name. The author also says the app can do something similar itself, but the setting is buried in the app.
What it means for an installed system
- Check your gate controller first. Everything here assumes a momentary relay where a mid-travel pulse stops the gate. Confirm yours behaves that way before copying the “gate is closed” guard logic.
- Keep a physical backup. Phone GPS is a convenience layer. The author notes a zone trigger still opens the gate, just late, if samples are sparse.
- Mind the battery trade. The author calls high accuracy the app’s main battery drain, which is why it is limited to the last few miles.
- Version and tuning. Both blueprints list a minimum Home Assistant version of 2024.10.0. All the distances were tuned on one install, so expect to re-tune for your road, gate and cycle times.
- Safety. Automatic gates can injure people and vehicles. If you are changing how one is triggered, keep the gate’s own safety sensors and edges working and have it checked by a qualified installer.
This is a community project from a single contributor, so treat it as a well-documented starting point, not a certified solution.
