Home Home Automation Google Home - Location Sharing: ETA & distance

Google Home – Location Sharing: ETA & distance

If the human-readable address isn't enough for you, here is the info about the distance and ETA

Google Home – Location sharing tutorial sparked a discussion about what other functions could be added to that system. The immediate response was to add the distance and ETA for each contact and this is the follow-up tutorial which will focus on just that. I would strongly recommend you to read the previous article or watch at least the showcase part of the video below.

Google Home – Location Sharing: ETA & distance

The formula is pretty simple. I’m asking Google Home to get me the location of my friend:

Hey Google, Where is Matt?
***Matt is at James st London, UK
Hey Google, Send directions to my phone!
***OK, check your Google Maps
Hey Google, what’s the distance and ETA?
***Matt is currently 200km away, with ETA of 2h and 6 min

In this part, I’m going to take care of the last question. Please bear in mind, that to keep things simple, I’m going to assume, that you are using a Google Home device, not the assistant on your phone. Trying to query the distances on the go, while it’s possible is not within the scope of this tutorial.

To enable the functionality, we will need the help of the IFTTT and Google Maps API. If you followed the previous tutorial, you have almost everything sorted.

IFTTT – ETA and Directions

To keep things simple, I’m not going to split the information about the distance and the ETA. It’s simple enough to do, I’m sure you will be able to figure it out yourself.  I just need a Google Assistant IFTTT applet liked to the Webhook and configured in the following way:


Commands: What's the distance and ETA
Answer: I'm checking it now for you


Url: https://NODERED_IP:1880/location/ETA
Method: POST
Content type: application/JSON

The HTTP POST request needs no data, as we only want to trigger the correct flow. You could ask directly about the distance and ETA without asking for the address, but you have to modify the flow accordingly. I’m trying to introduce as little changes as possible to the previous write-up.

NodeRED – Google Home – Location Sharing: ETA & distance

The Google Home notification node is no longer working, but you can use the cast node for the same effect. See theĀ node-red-contrib-cast for details.

The flow itself is very similar to what I have covered before. We have another Google Maps API link to compose and pass an HTTP GET request. To pass the URL, I’m configuring the function node:

var lat = global.get("locationLat");
var long = global.get("locationLong");
var locationHome = "HomeCoordsLAT,HomeCoordsLONG";

var GoogleKey = "Google Maps API"

msg.url = "https://maps.googleapis.com/maps/api/distancematrix/json?origins="+lat+","+long+"&destinations="+locationHome+"&key="+GoogleKey;
return msg;

Replace the red fields with appropriate values. I’m using stationary coordinates for the Google Home location, you can find them via Google Maps and searching for your location.

The URL is saved as msg.url – and passed to the HTTP GET node. I have reversed the destination/origin order, as I believe in most cases I would be interested in the ETA of my friend. If I want ETA to their location, I already have “Send direction to my phone” command. By default, the ETA and distance are calculated as a metric, driving directions. If you want to change it, please check the Google Maps API for the correct variables.

The HTTP GET request returns a string. This string is formatted as  JSON object, and to use it as such, we have to use the JSON node.

Lastly, I have to format the info stored in that JSON object and pass it as the Google Home response:

msg.name = global.get("locationName");
msg.payload.time = msg.payload.rows[0].elements[0].duration.text;
msg.payload.distance =msg.payload.rows[0].elements[0].distance.text;

return msg;

and use the template node

{{name}} is {{payload.distance}} away. The current ETA is {{payload.time}}

And pass it over to the Google Home node! There you have it!


You can see how to obtain information about the distance and ETA. You can modify the entire set up to give you that information independently, but in this tutorial, you have to query the address first to have the access to the distance and the ETA. I hope you find this helpful!

Project Download

Download project files here. Bear in mind that Patreon supporters have early access to project files and videos.


Nothing says "Thank you" better than keeping my coffee jar topped up!


Support me on Patreon and get an early access to tutorial files and videos.


Bitcoin (BTC)

Use this QR to keep me caffeinated in style with crypto-currency

Smart Ideas with

Automate your space in with these ecosystems and integrate it with other automation services

Learn NodeRED

NodeRED for beginners: 1. Why do you need a NodeRED server?

To server or not to server? That's a very silly question!

Best Automation Projects

ESP8266 WIFI lights under $5

Your Sonoff device can't do this!

Free wireless doorbell (Amazon Dash button hack)

The most terrifying situation I can imagine* is missing a parcel

New Amazon Dash Buttons

You can teach new buttons old tricks!

ESP8266 ceiling light – demo

Testing the ESP8266 as a WIFI light controller

Try Tasker and Raspberry Pi for your home automation needs!

Raspberry Pi can help you with your Tasker profiles

Smart Home

Testing 9 external antennas with CC2531 ZigBee coordinator

I have tested the range and the link quality of 9 external antennas with CC2531!

I have infinite buttons thanks to Aqara Opple

Gaming on Switch meets IoT - can you play games on Aqara Opple? Apparently you can! This and more uses of the connected wall switch

Smart lights won’t save you money

It's pretty clear how much power a smart light draws when turned on, but have you ever wonder how much do you pay to have it connected 24/7?

Alexa Routines: Setting volume on all Echos at once

Setting volumes on all Amazon Echo devices at once doesn't have to be a chore!

If Edison made smart lights: OEEONE ZigBee lightbulb

OEEONE ZigBee lightbulb may look vintage, but packs the latest ZigBee protocol