Google Travel Time to multiple destinations or from multiple origins

Hi,

From the configuration flow on the Google Maps Travel Time integrations, I quote:

When specifying the origin and destination, you can supply one or more locations separated by the pipe character, in the form of an address, latitude/longitude coordinates, or a Google place ID.

The problem is that I can not set multiple destinations nor multiple origins. I already tried the following ways:

  • -20.815314,-49.452360 | -20.817893,-49.379239 | -20.786214,-49.360268 (with and without spaces)
  • zone.clube_montelibano | zone.colegio_santo_andre | zone.ifsp_rio_preto
  • device_tracker.a30 | device_tracker.s21ultra

In all configurations, I get an Unknown error occurred message, and the log shows messages similar to the following:

2022-02-03 00:57:28 ERROR (SyncWorker_17) [homeassistant.helpers.location] Unable to find entity -20.815314,-49.452360|-20.817893,-49.379239|-20.786214,-49.360268|-20.805313,-49.405028
2022-02-03 00:57:28 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
resp = await request_handler(request)
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 504, in _handle
resp = await handler(request)
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 117, in impl
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 98, in forwarded_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 79, in ban_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 219, in auth_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 137, in handle
result = await result
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 164, in post
return await super().post(request, flow_id)
File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 62, in wrapper
result = await method(view, request, *args, **kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 111, in post
result = await self._flow_mgr.async_configure(flow_id, data)
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 252, in async_configure
result = await self._async_handle_step(flow, cur_step["step_id"], user_input)
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 325, in _async_handle_step
result: FlowResult = await getattr(flow, method)(user_input)
File "/usr/src/homeassistant/homeassistant/components/google_travel_time/config_flow.py", line 130, in async_step_user
if await self.hass.async_add_executor_job(
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/google_travel_time/helpers.py", line 15, in is_valid_config_entry
distance_matrix(client, origin, destination, mode="driving")
File "/usr/local/lib/python3.9/site-packages/googlemaps/distance_matrix.py", line 90, in distance_matrix
"destinations": convert.location_list(destinations)
File "/usr/local/lib/python3.9/site-packages/googlemaps/convert.py", line 128, in location_list
return "|".join([latlng(location) for location in as_list(arg)])
File "/usr/local/lib/python3.9/site-packages/googlemaps/convert.py", line 128, in <listcomp>
return "|".join([latlng(location) for location in as_list(arg)])
File "/usr/local/lib/python3.9/site-packages/googlemaps/convert.py", line 79, in latlng
normalized = normalize_lat_lng(arg)
File "/usr/local/lib/python3.9/site-packages/googlemaps/convert.py", line 105, in normalize_lat_lng
raise TypeError(
TypeError: Expected a lat/lng dict or tuple, but got NoneType

It looks like the multiple destinations are being handled as a single one.

What am I doing wrong for setting multiple origin/destination?

I’m also unable to get pipe-separated origin and destination to work. In the developer-tools/state UI I can see that the senor has weird comma-only values in the destination_addresses and origin_addresses attributes, as if it recognized that there were multiple origins/destinations (hence the commas) but couldn’t populate them.

@dclobato did you ever get this working?

I’m also unable to get multiple locations working. Anyone have luck with this or is it broken?