What is everyone else using for vehicle arrival detection?

You’ll have to use a Pi Zero W, the Bluetooth chip and antenna is shared with the Wifi. The custom code is just a quick thing I wrote using the BlueZ stack API to get low level access to the chip and put it into an infinite BLE scan loop. It will then report any device it finds with extremely low latency (pretty much instant). The results are then transferred to HA over MQTT. We have a long driveway, so I had to put the unit into an external box next to the road. I guess I can dump to code to Github if anyone is interested.

Could you share your proximity.home_me_ft config?

I have configured proximity.home and my zone.home has a radius of 20 (which is meters I believe).
I just arrived home tonight and my automation did not trigger and cannot figure out why. Last night it did but my direction of travel at the moment of trigger was stationary so the door did not open. Not sure why the direction flip-flops so much between toward and stationary.

zone:
  - name: Home
    latitude: 49.175868
    longitude: -122.970652
    radius: 20
proximity:
  home:
    devices:
      - device_tracker.vog_l04
    tolerance: 50
    unit_of_measurement: ft
sensor:
  - name: "Direction of Travel"
    state: '{{ state_attr("proximity.home", "dir_of_travel") }}'
binary_sensor:
  - name: Close to Home
    state: '{{ states("proximity.home")|int < states("input_number.close_to_home_trigger")|int }}'

input_number.close_to_home_trigger is set to 500.

alias: Clarity Arrives - New
description: ''
trigger:
  - platform: state
    entity_id: binary_sensor.close_to_home
    to: 'on'
condition:
  - condition: state
    entity_id: cover.garage_door
    state: closed
  - condition: state
    entity_id: binary_sensor.clarity_in_garage
    state: 'off'
  - condition: state
    entity_id: binary_sensor.clarity_bluetooth
    state: 'on'
  - condition: or
    conditions:
      - condition: state
        entity_id: sensor.direction_of_travel
        state: towards
      - condition: state
        entity_id: sensor.direction_of_travel
        state: arrived
      - condition: state
        entity_id: sensor.direction_of_travel
        state: stationary
action:
  - service: cover.open_cover
    target:
      entity_id: cover.garage_door
    data: {}
  - service: notify.pushover
    data:
      title: Clarity is home
      message: |
        Triggered by {{ trigger.id }}
        from {{ trigger.from_state.state }}
        to {{ trigger.to_state.state }}
      data:
        priority: 0

1 Like

I for one am interested…

I’ve not played with those yet but would be interested to know more. Looks like quite a bit of “assembly is required”!

Hello,
I use a zone where we are obligated to go trough when coming back home to trigger my gate. But I understand that a gate and a garage door have not the same security level.

Also I have a Loop current under my pavement to trigger the gate when leaving. Depend of your door configuration but that can be also an idea.

That is usually a better option, trigger slightly early than at the exact position.
Then just use conditions to make sure you are not home and the door opens due to bad GPS.
Like only trigger if wifi is not connected, and if you have not been connected to wifi the past couple of minutes.

plug it into the 12v power (cig lighter with a 12v to usb converter)

I made a trip this morning and the garage door was open when I pulled up to it. I had added an additional or condition=stationary and the automation triggered at 11:33:24 when close_to_home became < 500. At that moment, direction_of_travel was stationary and had been for 44 seconds.

It’s pretty basic.(EDIT: sorry that wasn’t meant be snide. just noting that the config wasn’t anything special…)

I have two from different sources in case one isn’t working:

proximity:
  home_me_ft: 
    devices:
      - device_tracker.life360_me
    tolerance: 50
    unit_of_measurement: ft
  home_me_ft_mobile: 
    devices:
      - device_tracker.me_mobile_app
    tolerance: 50
    unit_of_measurement: ft

What are your companion app > sensors > location sensors set to?
I have
Background Location: Enabled

  • High accuracy mode: enabled
  • High accuracy mode only when connected to BT devices: [HandsFreeLink]
  • High accuracy mode only when entering zone: zone.home_expanded, zone.home]
  • High accuracy mode trigger range for zone (meters): 100
  • High accuracy mode update interval (seconds): 5
  • Minimum Accuracy - 200

High Accuracy Mode - false
Location Zone - Enabled
Single Accurate Location - Enabled

I’ve uploaded it onto Github with a short explanation on how to use it. It’s something I did for myself and priority was reliability and performance, not user friendliness :wink: But once it’s configured right, it’s a fire and forget thing. I might do a more detailed post about the setup when I find some time.

4 Likes

Trying the D1 Mini since proximity sensor has been unreliable for me.

The WeMos is working for me but a little bit on the slower side. I’ve added back my BLE device tracker and the Clarity Wi-Fi ping sensor as automation triggers. So far after one trip:

image

@Hellis81 FYI you just reveal your address on the Internet.

I appreciate your concern but I do not live in a gas station :wink:

2 Likes

@finity, I’m curious why you have used an OR condition. Wouldn’t you want it as an AND? have you ever had it operate while you were driving away?

Somehow during editing that condition got messed up.

here is the correct one:

 condition:
      - condition: or
        conditions:
          - "{{ state_attr('proximity.home_me_ft', 'dir_of_travel') == 'towards' }}"
          - "{{ state_attr('proximity.home_me_ft_mobile', 'dir_of_travel') == 'towards' }}"
      - "{{ '84:DD:20:62:FA:FE' in state_attr('sensor.me_mobile_app_bluetooth_connection', 'connected_paired_devices') }}"
      - condition: state
        entity_id: cover.north_garage_door
        state: 'closed'

The ‘or’ was supposed to be for two proximity sensors I set up to increase reliability of the condition.

the two condiitions as shown in the original code was indeed supposed to be ‘and’

It would be nice to figure out why my trips keep triggering stationary especially when close to home.
This trip there were 2 or 3 short stationary periods near the beginning but the last half or more there were zero stops…

what do you mean

its only going to work when the D1 mini joins the networks

when the car is switch off or leave the network ← this we DONT know which but I DONT want to know that I just want to know when the car join the network and it open the garge that all i use it for
I use differance logic for tracking person

this was my mark 1

until I updated my MQTT could not get it to work so that when I did the esphome one

for faster join to the net work give a static IP

unreliable for me = proximity sensor!
The D1 mini is working as well as my Clarity’s Wi-Fi ping sensor does but both make me sit and wait a bit for the door to open and so far the ping sensor has beaten it. Today I added back the proximity sensor and it was first to trigger such that I only had to slow down a little as the door was opening.
I now have 6 entities triggering the automation and keep track of the trigger id with an input_text helper: WeMos D1 mini=on, BLE dongle=home, Clarity Wi-Fi ping=on, direction of travel=arrived, close to home=on if < 500.
Good suggestion about using static IP! I am setting that now…