Displaying Historical Mobile Locations on a Table or Map

I’m looking for assistance with the following challenge:

I have integrated several iPhones into Home Assistant using the “Mobile App” (Companion App) integration. Each iPhone exposes multiple entities, including the Geocoded Location sensor (sensor.iphone_geocoded_location), which provides the phone’s location. This sensor has several attributes like location (longitude & latitude), zones (based on Home Assistant zones), etc.

What I’d like to achieve is displaying a table on a dashboard with the historical data from this sensor, showing a chronological list of the phone’s locations, for example, over the last 10 days. The table should have one row for each location change (i.e., each time the sensor state changes). The first column should show the date and time, the second column the zone (from the zones attribute), and the third column the location itself. Ideally, the most recent entry would appear at the top, with older entries below. How can I achieve this?

Alternatively, it would be even better to display these locations as points on a map.
It would be particularly helpful if the map could allow for selecting a custom time range, similar to how you can view an entity’s history over a specified period.

I’ve tried searching various forums but haven’t found a solution yet. Can anyone guide me on how to create the table, or better yet, the map?

Thanks in advance for your help!

Place a device_tracker entity on a Map card.

As for a table: you can store coords with a time in Google sheets in some automation triggered by a change of a corr. device_tracker.

Thanks.

Map solution: I am afraid this is not yet what I am looking for. Just placing a device_tracker on a Map card would show the current location of the device. However, as stated above I would like to see and track the historical locations of eg the last few days. Ideally, I could specify the relevant time range (eg via a slider or some dropdown).

Table solution: How can I store the coords with time in Google sheets? I am new to this and would appreciate some advise on storing and showing such a table on a dashboard.

Check docs for Map card - “hours_to_show”

Great. This is what I was looking for. :+1:

Tow more questions:

  • Is there any chance to just show a particular time frame (ie just the day before yesterday instead the full last 72 hours until now).
  • For how long does HA store the historic coordinates? Where can I find/adjust this?

Use a custom map-card

10 days by default.
Controlled by purge_keep_days

Maybe this will help as well: Home Assistant: Exploring location history - Userbag.co.uk