đźš— The "Is My Car Actually Home?" Problem: Layering Device Trackers, Frigate & Person Tracking

TL;DR: Single-source car presence detection fails. Device trackers ghost you when car’s off. Frigate can’t tell your car from neighbors’. Person tracking thinks you drove when you walked. Solution: Layer three unreliable sources with priority logic + 60-second delays. Zero false positives from walking.


The Problem

I wanted reliable “car at home” detection for automations (trip tracking, smart charging, security). Every single-source approach failed spectacularly:

Device Tracker (WiFi): Works when car is ON (5% of time). Otherwise? Home Assistant thinks my car drove to Iceland.

Frigate Object Detection: Sees a car. Could be mine, neighbor’s, delivery van. Can’t distinguish.

Person Tracking: False positives every time I walked to the store. Garage door closed on me while I was in the car because system thought it left when I walked outside.

Lesson: Trust no single source.


The Solution: Three-Layer Priority System

Architecture

Priority A: Device Tracker → If WiFi/phone says “home” → 100% reliable (car is ON)
Priority B: Frigate Zone Occupancy → If camera sees car in parking zone → Visual confirmation (car parked, OFF)
Priority C: Person Tracking Heuristics → Fallback logic:

  • Both people home → Car probably home
  • One person away → Ambiguous → Default “away” (safe)
  • Both away → Car definitely away

Why This Works

Each layer compensates for others’ weaknesses:

  • Device tracker fails (car OFF) → Frigate covers it
  • Frigate can’t see (dark/weather) → Person tracking fills in
  • Person tracking false-triggers (walking) → Device/Frigate override

The Code

Part 1: Hybrid Car Presence Sensor

Click to expand full sensor code
- trigger:
    # Force update every 5 min (prevents deadlock)
    - platform: time_pattern
      minutes: "/5"

    # Device trackers (car powered on)
    - platform: state
      entity_id: device_tracker.my_car_phone
    - platform: state
      entity_id: device_tracker.my_car_wifi

    # Frigate zone occupancy (car parked)
    - platform: state
      entity_id: binary_sensor.parking_zone_car_occupancy
    - platform: state
      entity_id: sensor.parking_zone_car_count
    - platform: state
      entity_id: sensor.parking_zone_car_active_count

    # Person trackers (deadlock prevention)
    - platform: state
      entity_id: person.me
    - platform: state
      entity_id: person.spouse

  binary_sensor:
    - name: "Car Home"
      unique_id: "my_car_home"
      device_class: presence
      icon: mdi:car-side

      state: >-
        {% set phone_home = is_state('device_tracker.my_car_phone', 'home') %}
        {% set wifi_home = is_state('device_tracker.my_car_wifi', 'home') %}

        {% if phone_home or wifi_home %}
          true
        {% else %}
          {% set frigate_zone = is_state('binary_sensor.parking_zone_car_occupancy', 'on') %}
          {% set frigate_count = states('sensor.parking_zone_car_count')|int(0) %}

          {% if frigate_zone or frigate_count > 0 %}
            true
          {% else %}
            {% set me_home = is_state('person.me', 'home') %}
            {% set spouse_home = is_state('person.spouse', 'home') %}
            {{ me_home and spouse_home }}
          {% endif %}
        {% endif %}

      attributes:
        decision_reason: >-
          {% set phone_home = is_state('device_tracker.my_car_phone', 'home') %}
          {% set wifi_home = is_state('device_tracker.my_car_wifi', 'home') %}
          {% if phone_home %}
            phone_tracker_home
          {% elif wifi_home %}
            wifi_tracker_home
          {% else %}
            {% set frigate_zone = is_state('binary_sensor.parking_zone_car_occupancy', 'on') %}
            {% set frigate_count = states('sensor.parking_zone_car_count')|int(0) %}
            {% if frigate_zone %}
              frigate_zone_occupancy_on
            {% elif frigate_count > 0 %}
              frigate_car_count_{{ frigate_count }}
            {% else %}
              {% set me_home = is_state('person.me', 'home') %}
              {% set spouse_home = is_state('person.spouse', 'home') %}
              {% if me_home and spouse_home %}
                both_persons_home_assume_car_home
              {% elif not me_home and not spouse_home %}
                both_persons_away_assume_car_away
              {% else %}
                one_person_away_assume_car_away
              {% endif %}
            {% endif %}
          {% endif %}

Key feature: decision_reason attribute logs why the decision was made. Essential for debugging false triggers.


Part 2: Trip Start (Robust with 60s Delay)

Click to expand automation code
alias: Car - Trip Start (Robust)
triggers:
  - entity_id: binary_sensor.my_car_home
    to: "off"
    for:
      seconds: 60  # Prevents false positives from walking
    trigger: state

conditions:
  - condition: state
    entity_id: input_boolean.car_trip_active
    state: "off"

  - condition: template
    value_template: >
      {{ not is_state('binary_sensor.my_car_home', 'on') 
         and (states('person.me') != 'home' or states('person.spouse') != 'home') }}

  - condition: template
    value_template: >
      {% set reason = state_attr('binary_sensor.my_car_home', 'decision_reason') %}
      {% set time_away = (as_timestamp(now()) - as_timestamp(states.binary_sensor.my_car_home.last_changed)) %}
      {{ (reason in ['both_persons_away_assume_car_away', 'one_person_away_assume_car_away']) 
         or time_away > 60 }}

actions:
  # Detect driver
  - choose:
      - conditions:
          - condition: template
            value_template: "{{ states('person.me') != 'home' and states('person.spouse') == 'home' }}"
        sequence:
          - action: input_select.select_option
            target:
              entity_id: input_select.car_driver
            data:
              option: me
      - conditions:
          - condition: template
            value_template: "{{ states('person.spouse') != 'home' and states('person.me') == 'home' }}"
        sequence:
          - action: input_select.select_option
            target:
              entity_id: input_select.car_driver
            data:
              option: spouse
      - conditions:
          - condition: template
            value_template: "{{ states('person.me') != 'home' and states('person.spouse') != 'home' }}"
        sequence:
          - action: input_select.select_option
            target:
              entity_id: input_select.car_driver
            data:
              option: both

  - action: input_boolean.turn_on
    target:
      entity_id: input_boolean.car_trip_active

  - action: logbook.log
    data:
      name: "Car Trip Started"
      message: >
        Driver: {{ states('input_select.car_driver') }},
        Reason: {{ state_attr('binary_sensor.my_car_home', 'decision_reason') }}

mode: restart

Trade-off: Lose ~1 km tracking at trip start (60s @ 60 km/h). Gain zero false positives from walking.


Part 3: Trip End (5 Min Delay)

Click to expand automation code
alias: Car - Trip End (Robust)
triggers:
  - entity_id: binary_sensor.my_car_home
    to: "on"
    for:
      minutes: 5
    trigger: state

conditions:
  - condition: state
    entity_id: input_boolean.car_trip_active
    state: "on"

  - condition: or
    conditions:
      - condition: state
        entity_id: person.me
        state: home
      - condition: state
        entity_id: person.spouse
        state: home

  - condition: template
    value_template: >
      {% set reason = state_attr('binary_sensor.my_car_home', 'decision_reason') %}
      {{ reason in [
        'phone_tracker_home',
        'wifi_tracker_home',
        'frigate_zone_occupancy_on',
        'frigate_car_count_1',
        'frigate_active_count_1'
      ]}}

actions:
  - action: logbook.log
    data:
      name: "Car Trip Ended"
      message: >
        Driver: {{ states('input_select.car_driver') }},
        Distance: {{ states('input_number.car_km_today') }} km

  - action: input_boolean.turn_off
    target:
      entity_id: input_boolean.car_trip_active

mode: restart

Why 5 minutes? Distance accumulation stops when GPS stops moving. Delay only affects “trip active” boolean flip.


Testing & Validation: What to Monitor

Here’s what you should test to validate it works in your environment:

Critical Metrics to Track

1. False Positive Rate (Walking/Public Transport)

# Track: How often does trip start when you walk?
# Method: Check logbook after each walk to store
# Target: 0 false starts in first week
# Fix: Increase delay if false starts occur

2. Decision Reason Distribution

# Track: Which data source makes decisions?
# Method: Log decision_reason on every state change
# Expected distribution:
#   - phone_tracker_home: ~10% (car powered on)
#   - frigate_zone_occupancy_on: ~60% (car parked)
#   - both_persons_home_assume: ~25% (heuristic fallback)
#   - one_person_away_assume: ~5% (ambiguous states)

3. Frigate Detection Reliability

# Track: How often does Frigate see your car?
# Method: Check when car is parked vs sensor state
# Known issues:
#   - Night/darkness → May need IR illumination
#   - Snow/rain → Detection drops 5-10%
#   - Camera angle → Adjust if <90% detection

4. Device Tracker Availability

# Track: Does device tracker connect reliably?
# Method: Monitor when car starts vs tracker home
# Common issues:
#   - WiFi range → Extend if needed
#   - Phone Bluetooth → Enable "stay connected"
#   - Car's WiFi hotspot → Ensure auto-start

5. Trip Start/End Timing

# Track: Does trip start/end at right times?
# Test scenarios:
#   âś“ Walk to mailbox (should NOT start trip)
#   âś“ Drive to store (SHOULD start trip after 60s)
#   âś“ Return home, park (SHOULD end after 5 min)
#   âś“ Quick stop at gas station (should keep trip active)

Edge Cases to Test

Week 1: Basic Validation

  • Walk around neighborhood → No false trip starts
  • Drive to nearby location → Trip starts correctly
  • Return home → Trip ends after 5 min
  • One person leaves (walk), other stays → Car stays “home”

Week 2: Edge Cases

  • Both take public transport → Car correctly stays “home”
  • Car borrowed by friend → Sensor shows “away” (expected)
  • Parking in garage vs driveway → Both locations detected
  • Night parking → Frigate still detects (or falls back to heuristics)

Week 3: Environmental

  • Rain/snow → Check Frigate detection rate
  • Fog/darkness → Validate fallback logic works
  • Strong wind (moving camera) → Adjust mounting if needed
  • Visitor parks in same spot → Check false positive rate

Week 4: Failure Scenarios

  • WiFi down → Person tracking compensates
  • Frigate offline → Device tracker + person logic works
  • Phone battery dead → Spouse’s phone keeps tracking
  • Both phones dead → Sensor stuck until return (acceptable)

Red Flags (Tune Settings If…)

:triangular_flag_on_post: False trip starts > 1/week → Increase delay to 90-120 seconds
:triangular_flag_on_post: Frigate detection < 85% → Adjust camera angle or add lighting
:triangular_flag_on_post: Device tracker never connects → Check car WiFi/Bluetooth setup
:triangular_flag_on_post: Trip end too slow → Reduce 5-min delay to 2-3 minutes
:triangular_flag_on_post: “One person away” > 20% decisions → Tighten person tracking zones

Success Criteria

After 2-4 weeks of testing, you should have:

  • :white_check_mark: Zero false trip starts from walking
  • :white_check_mark: >95% successful trip detection
  • :white_check_mark: Known failure modes documented
  • :white_check_mark: Delays tuned to your environment
  • :white_check_mark: decision_reason distribution understood

Then you can confidently build automations on top of this sensor.


Use Cases

:white_check_mark: Trip distance tracking - GPS-based km accumulation, feeds into battery SoC estimates
:white_check_mark: Smart EV charging - Start charging during cheap hours only when car confirmed home
:white_check_mark: Pre-heat/cool - Climate control before departure, only if car actually home
:white_check_mark: Security alerts - Notify if car leaves when you’re home (theft/teen driver)
:white_check_mark: Parking occupancy - Multi-car households, know which spot is free
:white_check_mark: Driveway lighting - Turn on lights on arrival, not when walking outside
:white_check_mark: Maintenance reminders - Oil change alerts based on actual driving
:white_check_mark: Cost tracking - Fuel/electricity cost per trip


Setup Requirements

Prerequisites:

  • Home Assistant with person tracking (Companion App)
  • Frigate NVR with car object detection configured
  • Device tracker for car (WiFi, Android Auto, Bluetooth)
  • Basic YAML skills

Required Helpers:

input_boolean:
  car_trip_active:
    name: "Car Trip Active"

input_select:
  car_driver:
    name: "Current Driver"
    options: [me, spouse, both]

Entity Mapping (replace with yours):

Generic Description Your Entity
device_tracker.my_car_phone Phone in car device_tracker.YOUR_PHONE
device_tracker.my_car_wifi Car WiFi tracker device_tracker.YOUR_CAR
binary_sensor.parking_zone_car_occupancy Frigate zone binary_sensor.YOUR_ZONE_car_occupancy
sensor.parking_zone_car_count Frigate count sensor.YOUR_ZONE_car_count
person.me Your person person.YOUR_NAME
person.spouse Partner person person.SPOUSE_NAME

Key Lessons

Trust No Single Source - Device trackers lie, Frigate hallucinates, person tracking assumes. Layer them.

Delays Prevent False Positives - 60s feels long when testing. It’s the difference between “works” and “broken”.

decision_reason is Gold - Saves hours of “why did it do that?” debugging. Log everything.

Validate in Critical Automations - High-stakes (charging, security) → Check decision_reason. Low-stakes (logging) → Accept any state.

False Positives > False Negatives - Missing 1 km? Fine. Starting trip when walking? Unacceptable.


Questions?

Solved this differently? Been betrayed by device trackers? Found ways to distinguish your car from neighbors’? Share in comments!

Pairs with my GPS battery monitoring for complete vehicle automation.

Tags: #presence-detection frigate automation #car-tracking #device-tracker #person-tracking

1 Like

TLDR : use a BLE tracker and the Composite integration.

Or you could throw a bluetooth tracker in the car and an esp bluetooth proxy nearby if bluetooth range is a problem. Is represented as a device tracker. Works flawlessly for home/away. I just switched from using a Tile to an Inkbird thermo/hygrometer. It also gives me the cabin temperature while it sits in the driveway, so I can better decide to preheat/cool before leave.

My car has reliable GPS, only not while driving for privacy reasons. Then it just says “driving”. Positions are given only when it is parked (or crashed) but that is enough. No ghosting. So BLE is a backup, but it is reliable on its own.

I use the composite integration to combine multiple trackers in one for added reliability and accuracy. It will eliminate the complexity from your automations and probably solve your ghosting problem too:

2 Likes

@Edwin_D Great idea about the BLE beacon approach! I’ve actually been researching exactly that - looking for a solar-powered BLE beacon that could go in the car as another layer in this detection system.

The challenge: I haven’t found a suitable device yet that doesn’t rely on constant battery replacement, especially given that car interior temperatures in Finland drop quite significantly during winter parking (-20°C to -30°C is common). Most consumer BLE beacons use coin cell batteries that don’t handle extreme cold well.

Solar BLE beacons exist (GAORFID, Lansitec, etc.) but they’re expensive industrial-grade devices (€100-400) and may still struggle with Nordic winter conditions where there’s limited daylight for solar charging.

Current alternatives I’m considering:

  1. Hardwired BLE beacon - Wire directly to car’s 12V system, but requires installation
  2. Regular BLE beacon with yearly battery swap - Accept the maintenance overhead
  3. Wait for better cold-weather solar beacons

The three-layer approach I described actually works well enough for my application as a dedicated car beacon - the device tracker (phone/car WiFi) + Frigate + person tracking covers most scenarios. But a reliable car-mounted BLE beacon would definitely strengthen the “Priority B” layer, especially for distinguishing your car from neighbors’ vehicles that Frigate might detect.

Have you found any cold-weather BLE beacons that work reliably in Nordic conditions? Would be interested to hear if anyone has solved this particular challenge!

Are you running the latest version of Frigate? You can now detect the License Plate/Number Plate. I have this working on my instance, which uses two cameras pointing out from the Garage and so far it’s been pretty accurate. Occasionality it picks up the wrong letters/numbers on cars that drive by, but I’m not interested in tracking them. I also have a camera in the Garage point down, so that I know which car is parked there.

Both cars are from BMW Group, so until recently I was just using the integration to track their location. But as that’s been removed for the time being, it’s an alternative for knowing which cars are at home.

1 Like

You could buy an ESP32 (ESP32 Development Board USB Dongle Bluetooth Gateway MicroPython ESPHome NEW | eBay.de) and flash a BLE-Beacon on it using ESPHome.
The ESP32 chip is specified for -40-85°C.
If you have a USB socket (always powered) in your car you could plug it in.
When you search for ESPHome and BLE Beacon you find lots of information how to do it.

1 Like

have you considered OpenALPR Cloud - Home Assistant
?

I would first try the Inkbird temperature sensor. If it does not pan out it can be put to other use. Yes, it is battery driven, AAA. But for that I would recommend lithium (not rechargeable Li-ion, but Lithium metal). They last long and do well in my freezer (albeit I have not tried setting that to -40 :slight_smile: The freezer does hit -30 at times in regular intervals. The cells can take up to -40 degrees Celcius and +60 in the sun.

https://lygte-info.dk/review/batteries2012/Energizer%20Ultimate%20Lithium%20AAA%20UK.html

This is what I have in my car (using exacly those cells):

Freezer with Inkbird thermometer (the version without hygrometer) and lithium cells, lasts longer than a year this way:

1 Like

I also use a BT temp sensor in my car for help tracking car presence and cabin temp.

I use a govee h5075 and some basic aaa rechargeables. I keep it out of direct sunlight, and it has lasted many months before needing batteries swapped, and several years over all. I have a handful of these devices, for around the house and in fridges/freezers.

My cabin temps have generally ranged from ~110 to ~20 F.

for battery monitoring and notifications, check out @ 🪫 Low Battery Notifications & Actions

1 Like

Thanks so much for all the ideas, everyone—this is exactly why I love this community! :smiley:

  • @Saoshen, your tip about dropping a BLE temp sensor in the car (e.g., Govee H5075) really clicked for me. I’m going to use it for two things:
    1. a “pre-heat ready” check in the morning (only notify once the cabin actually reaches the target temp on a scheduled warm-up), and
    2. a small extra heuristic layer for my “car home” logic (recent temp updates from the driveway are a nice soft signal alongside Frigate & trackers). Also, thanks for pointing to the Low Battery blueprint to keep cells in check—great combo!
  • @Edwin_D, the BLE + Composite integration angle is super helpful—it could simplify the messiness of fusing multiple trackers. I’ll check out an Inkbird with AAA lithium cells (good cold-weather behavior). Appreciate the link and the practical battery advice.
  • @juergenjw, love the DIY spirit—an ESP32 as a BLE beacon powered from a USB port (-40 to 85 °C spec) is a clever, low-cost path if I want a dedicated in-car signal. I might prototype this as a “persistent presence anchor”—I’ve got a couple of spare ESP32 boards lying around. :wink:
  • @Maximo, the heads-up on Frigate license plate recognition is noted! In my case the plate isn’t always visible to my cameras, so I’ll keep LPR as an optional confirmatory layer.
  • @checking12, thanks for the OpenALPR Cloud pointer—useful to compare against Frigate’s built-in options and see what’s most reliable with my camera angles.

I’ll probably keep the temp sensor as “Priority B2” in my stack—a helpful signal, but device trackers + Frigate + person logic still carry most of the weight.

Thanks again for the brainpower—all your answers gave me exactly the nudge I needed! :red_car:

2 Likes

glad you found it useful, I recently found this battery notes HACS addon that is pretty cool for battery tracking

edit: also the govee (or others I assume) can be directly used to determine if the car/device is home/in range via the bt signal strength (assuming you have reliable/close HA BT dongle)

1 Like