What is everyone else using for vehicle arrival detection?

I’ve tried several things. Currently I have BT Beacon plugged into my USB port. I’m using Passive BLE monitor and the beacon + integration triggers my departure automation quick enough to auto open the garage door but arrival detection is slow. My car also has Wi-Fi and I have configured a ping sensor for its IP. My automation is usually triggered by the ping sensor before the BLE beacon but still on the slow side. Just curious what anyone else might be doing…

My iPhone can tell when I’m driving (or rather, in a car that’s moving). I can get to the activity sensor for that via the HA app. I open my gate when I break the geofence around my home. There are more details to ensure good security, but that’s basically it. It’s been working well for 2 years. Sometimes I’ll be at the gate for a few seconds before it starts to open and other times it will be open halfway or more when I arrive at the gate. That’s roughly the range.

I’m here to share, but also hear others’ ideas.

You can go more expensive using cameras and number plate detection.

I’ve also tried to use the state of my phone connected to the car’s Bluetooth as a sensor, but iOS “automations” for things like this prompts before running, which is less than ideal.

I also combine my current automation with the state of the house’s alarm and vehicle sensors in the garage to know which cars aren’t there. It also only triggers during what I consider safe times.

I use the phones GPS and when the Bluetooth connection to the phone disconnects use device_tracker.see to set the position of the car the same as the phone.
Simple and works 95% of the times I believe.

The HA app location geofence did not prove quick enough for me but I’m willing to give it another go. My phone is Android…

Oh… I think I misunderstood the question.
I thought you meant knowing where the car is parked.

This is the accuracy we get on our Android phones wit high accuracy mode on:

My phone connection to BT is connected until I turn the car off,
device_tracker.see?? I am not familiar with that… How are you triggering the service?
I need to trigger upon arrival…

What I want to trigger is open garage when the car arrives in front of it! I am almost there with the BLE tracker and ping sensor but not always!

I could reach up and press the open garage button in my car’s overhead console but why???

As I said I think I misunderstood.
But use high accuracy mode when connected to Bluetooth device then.
I have mine configured to send new update every five seconds.

Doesn’t that work for you?

Using device_tracker.huawei_p30_pro?? I’ve had it change to away while I am home and then back to home thus triggering open garage door at any old time…

BLE and ping have been more reliable (100%), just not quick enough 99% of the time…

There are conditions you know…
Like condition phone not connected to wifi.
Condition phone is connected to Bluetooth.

My current automation is:

alias: Clarity Arrives
description: ''
trigger:
  - platform: state
    entity_id: binary_sensor.clarity_wi_fi_ping
    to: 'on'
  - platform: state
    entity_id: device_tracker.ble_tracker_dc0d3003512d
    to: home
condition:
  - condition: state
    entity_id: cover.garage_door
    state: closed
  - condition: state
    entity_id: binary_sensor.clarity_in_garage
    state: 'off'
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
  - wait_for_trigger:
      - platform: state
        entity_id: binary_sensor.clarity_bluetooth
        id: Clarity Bluetooth
        to: 'off'
      - platform: state
        entity_id: binary_sensor.clarity_wi_fi_ping
        to: 'off'
        id: Clarity Wi-Fi
    timeout: '00:02:00'
    continue_on_timeout: false
  - condition: state
    entity_id: cover.garage_door
    state: open
  - service: cover.close_cover
    target:
      entity_id: cover.garage_door
    data: {}
  - service: alarm_control_panel.alarm_disarm
    target:
      entity_id: alarm_control_panel.alexa_guard_da03a
    data: {}
  - service: switch.turn_on
    data: {}
    target:
      entity_id: switch.node_50
mode: single
max: 10
max_exceeded: silent
1 Like

Set up a zone where the garage should open.
Trigger in that zone if Bluetooth connected to the car, wifi is not connected and has not had a state change last 10 minutes.
And enable high accuracy mode when the phone is connected to the car Bluetooth.
That is my advice

2 Likes

This is what I use:

  - id: gd_auto_open_north_garage_door
    alias: GD Auto Open North Garage Door
    trigger:
      - platform: template
        value_template: "{{ states('proximity.home_me_ft') | int < 1000 }}"
    condition:
      - condition: or
        conditions:
          - "{{ state_attr('proximity.home_me_ft', 'dir_of_travel') == 'towards' }}"
      - "{{ '84:DD:20:62:FA:EE' in state_attr('sensor.me_mobile_app_bluetooth_connection', 'connected_paired_devices') }}"
      - condition: state
        entity_id: cover.north_garage_door
        state: 'closed'
    action:
      - service: script.open_gdn

I set up the proximity sensor to get feet from home using my mobile app as the input.

Works pretty much every time.

@dbrunt I came here to say this too: You could always create a zone a little bigger than your home zone. Also have a look at the proximity integration (it’s what finity referred to too).

1 Like

Thanks everybody! I did have high accuracy enabled while connected to car BT and when entering zone.home but the radius was quite small so I’ve added zone.home_expanded to also trigger high accuracy sooner. Also giving the Proximity integration a whirl - that one is new for me.

BLE beacons in the cars, on a USB outlet. On the receiver side an RPI Zero W powered over PoE in a waterproof box next to our driveway. Running some custom code that accesses the Pi’s BT controller on a low level and puts it into constant hardware BLE scanning mode. This allows for extremely fast detection, a car passing by is detected within milliseconds it enters and exits the detection range. The range can be fine tuned using signal strength thresholds. I’m using -100dBm, which reliably detects the cars starting from about 10 meters of the scanner box. The system was deployed almost exactly two years ago and as far as I’m aware, it never missed a car. Not even mine when I speed by a lot faster than what I reasonably should…

The beacon: DSD Tech SHA10, one per car.
image

The receiver box:

We used to have two detectors in order to determine direction of travel, but this was deemed overkill and I removed one.

2 Likes

I have a Feasycom BLE beacon in the car but my BT adapter is plugged into my HA box where I run the Passive BLE integration. Guess I will be looking into a Pi-Zero. What’s the custom code you’re using?

I have a wemos d1 mini in car
with this script on it

wifi:
  networks:
    ssid: "IOT"
    password: "nottellingyou"


substitutions:
  devicename: mr2
  friendly_name: MR2
  

esphome:
  name: $devicename
  platform: ESP8266
  board: d1_mini

ota:


logger:
  level: VERBOSE
  logs:
    mqtt.component: DEBUG
    mqtt.client: ERROR




mqtt:
  broker: 192.168.blabla
  port: 1883
  username: mqttuser
  password: letmein2herePlease

text_sensor:
  - platform: wifi_info
    ip_address:
      name: ${friendly_name} Ipaddress 


binary_sensor:
  - platform: status
    name: ${friendly_name}

which create

- id: Cars Here Open Door
  alias: Cars Here Open Door
  initial_state: true
  trigger:
  - entity_id: binary_sensor.mr2 , binary_sensor.hrv
    platform: state
    to: 'on'
  condition:
  - condition: state
    entity_id: input_boolean.ok_open_g_door
    state: 'on'
  - condition: state
    entity_id: binary_sensor.garage_door
    state: 'off'
  action:
  - service: cover.open_cover
    entity_id: cover.garage_door

to make a bit smarter i have
a helper input_boolean.ok_open_g_door

which get turn off for 8mins
reason for that is if i close the garge door or open the side door
and I then start the car (as its out side) dont want the garge dor to open

- id: 'Dont Open Garage Door'
  initial_state: true
  alias: Dont Open Garage Door
  trigger:
  - entity_id: binary_sensor.garage_side_door
    platform: state
    to: 'on'
  - entity_id: binary_sensor.garage_door
    platform: state
    to: 'off'
  condition: []
  action:
  - data:
      entity_id: input_boolean.ok_open_g_door
    service: input_boolean.turn_off
  - delay: 00:08:00
  - data:
      entity_id: input_boolean.ok_open_g_door
    service: input_boolean.turn_on
4 Likes