HA does a good job of capturing gps location of my Android phone at regular intervals.
I would love to be able to view the “tracks” of my activities such as walking/jogging/cycling to keep track of my various routes, especially when I am exploring a new place. Think of this as a poor man’s “MayMyRun”.
Is there any (easy) way to display the associated “tracks” in the Map dashboard widget for a specific time interval?
NOTE: for now, I have been using the following kluge to export the tracks & then import them into Google Earth for display.
- Export to csv file
(SENSOR=<tracker_metadata_id>; START=<start_timestamp>; END=<end_imestamp>; DB=/homeassistant/home-assistant_v2.db; sqlite3 $DB "SELECT DATETIME(last_updated_ts, 'unixepoch', 'localtime'), shared_attrs FROM states JOIN state_attributes ON(states.attributes_id = state_attributes.attributes_id) WHERE metadata_id = $SENSOR AND last_updated_ts >= $START AND last_updated_ts <= $END" | sed 's/\([^|]*\)|.*latitude":\([^,]*\).*longitude":\([^,]*\).*altitude":\([^,]*\).*/\2\t\3/') > route.csv
-
Convert to kml using the following online converter: https://www.gpsvisualizer.com/map?output_googleearth
-
Save the file and import into Google Earth https://earth.google.com/
Of course, I would prefer to do this automatically and native to HA as per the first part of my post…