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.homeand your work zone - An
input_booleanhelper; I named minetravelling_peter, but you can call it whatever makes sense for your setup
How the Travel Time System Works
The idea is simple:
- When I leave work, Home Assistant updates the travel time to my home.
- A notification is sent with my expected arrival time.
- A helper boolean (
travelling_peter) is turned on. - While the boolean is on, the travel time refreshes every five minutes.
- When I arrive home, the system stops updating automatically.
- 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_peterThe 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_peterDetecting 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_peterShowing 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_homeI’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.homeWhy 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.
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.
Hi! See https://www.home-assistant.io/integrations/google_travel_time/
There are about 10.000 free requests a month, so thats a bit more than 300 requests a day. If you manually update the travel time, you can kinda figure out if you will be reaching that limit.
For me personally, I dont travel more than 2 hours a day in which my travel need to be updated. So with a 5 minute gap, that’s only 24 requests a day 🙂
Winners don’t overthink. They play. Your chance is here! Play Now Here -> is.gd/27Vfed
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.