Posted in

Smart Travel Time Notifications in Home Assistant

Knowing when someone will arrive home can be surprisingly useful in a smart home. With a commute of over an hour, I like to keep my partner up to date about my expected arrival time. It definitely helps with timing dinner. 😉

In my setup I use Home Assistant together with the Google Travel Time integration to calculate travel time from my current location to home. If you’re also tracking where you parked on the way back, I’ve got a separate guide on tracking your car’s parking location in Home Assistant.

The Google API has usage limits though. Continuously updating the travel time sensor every minute burns through those limits fast. So instead I built a small system that only updates while I’m actually travelling home and have accurate estimates without wasting API calls.

What You Need

  • Google Travel Time integration set up with your home and work locations
  • Zones defined in Home Assistant, at minimum zone.home and your work zone
  • An input_boolean helper; I named mine travelling_peter, but you can call it whatever makes sense for your setup

How the Travel Time System Works

The idea is simple:

  1. When I leave work, Home Assistant updates the travel time to my home.
  2. A notification is sent with my expected arrival time.
  3. A helper boolean (travelling_peter) is turned on.
  4. While the boolean is on, the travel time refreshes every five minutes.
  5. When I arrive home, the system stops updating automatically.
  6. The dashboard shows my expected arrival time and current location.

This prevents unnecessary API calls while keeping the arrival estimate up to date throughout the journey.

Detecting When I Leave Work

The first automation triggers when I leave the work zone. It updates the travel time sensor, sends a notification with my estimated arrival, and enables the travelling boolean. Make sure the input_boolean helper exists before adding this and swap zone.werk for whatever your work zone is named.

- id: travel_to_home
  alias: "Travel: On the way home"
  initial_state: 'on'
  trigger:
    - platform: zone
      entity_id: person.peter
      zone: zone.werk
      event: leave
  condition:
    - condition: time
      after: '14:00:00'
      before: '19:00:00'
  action:
    - service: homeassistant.update_entity
      target:
        entity_id: sensor.travel_time_peter

    - delay: "00:00:10"

    - service: notify.all_devices
      data:
        title: "Peter is on the way home!"
        message: >
          Peter has a travel time of {{ states('sensor.travel_time_peter') }} minutes.
          He will arrive around
          {{ (as_timestamp(now()) + 60 * states('sensor.travel_time_peter') | float(0))
          | timestamp_custom('%H:%M') }}.

    - service: input_boolean.turn_on
      target:
        entity_id: input_boolean.travelling_peter

The 10-second delay gives the sensor time to update before the notification fires, so the message always shows a fresh travel time rather than a stale one.

Updating Travel Time Every Five Minutes

Traffic can change a lot over an hour-long commute. This automation refreshes the sensor every five minutes, but only when the travelling boolean is active so nothing runs in the background when I’m not on the road.

- id: travel_update_peter
  alias: "Travel: Update travel time Peter"
  initial_state: 'on'
  trigger:
    - platform: time_pattern
      minutes: "/5"
  condition:
    - condition: state
      entity_id: input_boolean.travelling_peter
      state: "on"
  action:
    - service: homeassistant.update_entity
      target:
        entity_id: sensor.travel_time_peter

Detecting When I Arrive Home

Once I enter the home zone, a simple automation turns off the travelling boolean and the updates stop.

- id: travel_arrived_home
  alias: "Travel: Arrived home"
  initial_state: 'on'
  trigger:
    - platform: zone
      entity_id: person.peter
      zone: zone.home
      event: enter
  action:
    - service: input_boolean.turn_off
      target:
        entity_id: input_boolean.travelling_peter

Showing the Arrival Time on the Dashboard

On my dashboard I display the expected arrival time using a Markdown card, but only while the travelling boolean is active so it stays out of the way the rest of the time.

type: markdown
content: |
  ## Hello {{ user }}
  
  {% if is_state('input_boolean.travelling_peter', 'on') %}
    <ha-icon icon="mdi:car-sports"></ha-icon> Peter will be home around **{{ (as_timestamp(states.sensor.travel_time_peter.last_updated) + 60 * states('sensor.travel_time_peter') | float(0)) | timestamp_custom('%H:%M') }}**
  {% endif %}

Because the travel time sensor refreshes every five minutes, the dashboard automatically updates with the latest estimate as the journey progresses.

Manually Sending a Travel Notification

Sometimes I’m travelling from somewhere other than work, or I just want to send an update manually. For that I added a dashboard button that triggers the same automation directly. It bypasses the zone condition so it works from anywhere.

type: conditional
conditions:
  - condition: state
    entity: person.peter
    state_not: "home"
card:
  type: button
  entity: automation.travel_to_home
  show_icon: false
  name: Send travel time notification
  tap_action:
    action: perform-action
    perform_action: automation.trigger
    data:
      skip_condition: true
    target:
      entity_id: automation.travel_to_home

I’ve also been thinking about adding an NFC tag in the car to trigger this without even opening the dashboard.

Showing My Location on a Map

Finally, I added a map card that shows my current position relative to home. Like the ETA card, it only appears while I’m travelling, so the dashboard stays clean the rest of the time.

type: conditional
conditions:
  - entity: input_boolean.travelling_peter
    state: "on"
card:
  type: map
  auto_fit: true
  entities:
    - person.peter
    - zone.home

Why This Approach Works Well

This has turned out to be one of the more practical automations in my setup. The API usage stays low, the arrival time is accurate enough to actually plan around, and the whole thing is self-contained, it starts when I leave work and stops when I get home without any manual intervention.

It’s also easy to extend. Because the travel time is available as a sensor, you can build other automations on top of it, turn on lights when I’m 10 minutes away, start the coffee machine, or adjust the heating. Distance-based automations work too, but basing them on travel time tends to be more reliable in practice.

Related: Track your car parking location in Home Assistant

4 thoughts on “Smart Travel Time Notifications in Home Assistant

  1. Thanks for making this post! I really want to try out something similar. But what about the costs of this Google Travel Time service? Because I read before that people got surprised because of it.

  2. Winners don’t overthink. They play. Your chance is here! Play Now Here -> is.gd/27Vfed

  3. Payment systems are crucial for modern financial ecosystems.
    They enable money to move swiftly and securely across borders.
    Popular examples are credit cards, e-wallets, and bank transfers.
    Each method offers a unique balance between convenience, cost, and security.
    https://beauty.whitesneaker.ru/GGWALPfJ1zOb/
    Choosing the best payment option relies on the customer’s needs and location.
    Good payment systems safeguard sensitive data and prevent fraud.
    Ultimately, reliable transaction processing is the backbone of online business and fintech.

Leave a Reply

Your email address will not be published. Required fields are marked *