What is everyone else using for vehicle arrival detection?

I have been using Zigbee for my arrival sensor. I started with SmartThings Arrival sensor. It got discontinued and has a few issues with battery.

I end up make my own arrival sensor with Zigbee as the protocol. It also double up to help secure my car because I added microwave radar and vibration sensor. Here is a short video.

I have posted my project here.

1 Like

My system is pretty simple. I put an ESP8266-01 (with a tiny buck voltage converter) in each car. In Home Assistant, for example, I look for sensor.jeep_status that only goes true if the Jeep is connected to my local WiFi. The reason I do this is because I can open or close my garage doors from Alexa, and I didn’t want Alexa to open a door if the car isn’t in the vicinity.

Are you using Tasmota or ESPHome on your ESP8266-01’s?

You don’t have to use multiple zones if you use ‘High accuracy mode trigger range for zone (meters)’. That will turn on high accuracy when the device is within XX meters of zone.home (or whatever zones you have created).

They have ESPHome flashed on them.

Hi,
about zone.home_expanded, with your same settings no way to find this entity!
Any suggest to get it ?
I read many time this doc without success.

Thanks

Just create a new zone in HA called Home Expanded with the same latitude & longitude as your home zone but with a larger circle.

OK, thanks.
Is this trick good to get this behaviour?

The expanded zone I created in HA was called zone.hamilton. I picked both zone.home & zone.hamilton and had set High accuracy mode trigger range for zone (meters) to 100. I can see now that was incorrect as the app creates an internal expanded zone that is 200m bigger than both of my zones and high accuracy mode is only enabled when inside the expanded zone yet outside zone.home. Which explains now why I was seeing high accuracy mode True but then False when I got closer to home! I’m not sure if the docs have been rewritten since I read them of if I just misunderstood how zone.expanded worked. I moved away from using app location as a tracking method for arriving home and opening garage door as I never could get it working right 100% or even 80% of the time, but I might now though, armed with new understanding! I likely only need zone.hamilton for high accuracy mode and high accuracy mode trigger range " " but that would depend on what the app does when I enter another zone within a zone…

I just played with background location settings, and I could not get High Accuracy Mode to turn on while in zone.home. I had to also pick zone.hamilton. HA shows 1 person in zone.home & 0 in zone.hamilton but the app may behave differently. I now need to see what happens when I leave zone.home but remain inside zone.hamilton. I may need to get rid of zone.hamilton and just use a larger zone.home…

UPDATE
So I made a “beer run” earlier and monitored settings. I was outside zone.home AND zone.hamilton yet High Accuracy mode remained enabled despite the setting to enabling "and"ing BT Connected and zone. HA showed 0 in zone.hamilton and 0 in zone.home. As I drove home, zone.hamilton changed to 1 and when I entered zone.home (radius 25), zone.hamilton changed to 0 and zone.home changed to 1. High accuracy mode finally turned off when I disconnected from car BT. So my last hurdle is resolving why High Accuracy mode stayed on while connected to car BT yet outside both zones…

New Update

So far, 6 out of 6 trips have resulted in my garage door opening while I can see it and early enough that I do not have to sit and wait, and high accuracy mode turns off when car BT disconnects.
These are my settings…
zone.home: configuration.yaml override:

zone:
  - name: Home
    latitude: <redacted>
    longitude: <redacted>
    radius: 30
    icon: mdi:home

zone.hamilton with a radius of 300 meters with center being my home coordinates.
Automation trigger: when device_tracker.my_phone changes from: zone.hamilton to: zone.home

Companion App settings:
Location Sensors
Background Location: Enabled
Sensor Settings:

  • High accuracy mode: Enabled
  • High mode only when connected to BT devices: Kona
  • High accuracy mode only when entering zone: zone.home
  • High accuracy mode trigger range for zone (meters): 500 (I am going to try 300m)
  • High accurace mode update interval (seconds): 5
  • High accuracy mode enabled only when in zone and connected to BT: Enabled
  • Minimum accuracy: 200
  • Location Sent: exact
1 Like

My android sensors setup:

  • range activation trigger: 2000m (this means zone.expanded … I suppose)
  • high accurancy when: zone.home
  • no option regarding Bluetooth activated (all BT disabled)

These options should (zone.expanded MINUS home.zone - see doc above):

  1. trigger high accurancy when I go toward home (distance < 2000m)
  2. disable accurancy when I am in zone.home

In addition these values should:

  1. trigger high accurancy when I leave home (within 2000m)
  2. disable it whan I am over the 2000m from home

I will reply here when I tested all this…

@HeyImAlex
Can this code be modified to run a rpi 4 versus a pi zero?

It will run on any Linux system with a Bluetooth chip, including the Pi4.

1 Like

@dbrunt mind sharing your automation YAML/steps for this? Curious if you set it up using zone triggers or something else. Thanks for sharing your method and updates in a clear and easy to understand post!

Edit

Ah… Figured out that the device_tracker entity actually reports the zone as it’s state! Docs FTW :slight_smile:

“If you’re using a presence detection method that includes coordinates then when it’s in a zone the state will be the name of the zone (case sensitive). When a device isn’t at home and isn’t in any zone, the state will be 'not_home' .”
Device tracker - Home Assistant

1 Like

You can also add a condition in the automation’s that checks if a tracked device is still in the zone after it enters it as well before an automation is scheduled to run.

i.e Trigger is Phone being home or away via choose and in choose options the condition it will validate that its inside the zone since it last entered it and say Android Auto sensor is set to on in the companion app so it knows you are in the car.

Adjust the Home radius size via the config file using

zone:
  -name: Home
   latitude:
   longitude:
   radius:
   icon: mdi:account-multiple

The radius you can set to how small in meters you want the primary home zone size to be since there is no other way to change it at the moment, then you can add another zone with the same coordinates that is adjustable if you want an external passive zone for more granular control of what zones each trigger is on.

Should be handy for many others since I figured this out myself.

1 Like

I’ve read through most of this, and I’m having a bit of difficulty figuring out why the need for all this BLE and proximity detection and all that.

Do zones not work for you? Automating my garage door was like the first or second thing I did with Home Assistant, and it’s been pretty rock-solid ever since.

Phone location goes from “away” to “home”? Open the garage door. It opens when I’m close enough that I can see it opening, and I don’t have to wait when I pull in my driveway.

On the off chance that I forget to close it when I leave, HA will automatically close it when my phone disconnects from my home WiFi network.

Easy.

Zone arrival into a small home zone has been my most responsive detection…

and is now my only one…

I would say that the use of zones is a given but your assumption that everyone can use phone location is not always the case.

For example, I have 4 vehicles and 4 drivers (phones) at my house. Two of those drivers don’t have they’re phones in HA which makes things difficult. Not to mention that it’s not a 1 for 1 when it comes to each phone only being used in a single vehicle. Then there’s the fact that 2 vehicles are in the garage and 2 are parked in the driveway.

Some sort of arrival sensor in each car is probably best for my use case but I have yet to find a descent enough solution to pull the trigger on anything.

Today I just made use of iOS shortcuts. I need 4 total shortcuts. Will see how well it works. I have done several variations of the proximity automations above with variable performance.

  1. Phone connects to specific car bluetooth → write global variable “connected to xxx”
  2. Phone leaves small home geofence ->. if global variable “connected to xxx” run HA Action- “Garage-Closed-Scene”
  3. Phone arrives to large home geofence-> If global variable “connected to xxx” run HA Action “Garage-Open-Scene”
  4. Phone disconnects from BT → global variable write " not connected to xxx"

In Home Assistant, the Garage Open/Closed Scenes literally only have the garage door state in the scene- although many different states could be added. This is also car specific, so that when I am in my wife’s car and drive away with my phone nothing happens.

Could you explain what you mean by IoS shortcuts (for those of us who are only "android-literate) and also “write global variable”?