Hi,
I’m currently thinking about a Home Assistant–based solution to replace Google Maps Timeline, because all the information is already available in HA. Over the last few days, I’ve been looking for existing solutions in the community. Now I’ve realized that the timeline is basically already there (map cards with the “hours to show” configuration), BUT it only covers the last 10 days. After 10 days, the purge removes all sensor data that is not of type measurement, total, or total_increase (as described in the documentation: Recorder - Home Assistant).
The second thing I understand is that there is currently no option to configure the purge per entity. So there is no way to delete all sensor data in HA after day 10 except the data for my mobile phone’s device_tracker. If I read the documentation correctly, this could become a problem in the future when the database grows with all the data from my device_tracker. That’s why the purge exists in the first place and why the other data is stored as (aggregated) long-term statistics in the database.
So far so good. Now my idea is to build a custom solution with what is already available in HA. I’d like to ask what you think about my approach and whether there are better ways to achieve this. ![]()
My idea:
- Save the data of my
device_trackeronce a day via a blueprint automation to a separate SQL database.
Maybe it’s possible to use the purge event to trigger the automation, otherwise I’d just define a fixed time for it to run. - Create a template sensor that uses the SQL integration to read the
device_trackerdata from the external SQL database (created in step 1). - Display this new template sensor on a dashboard in a map card. Maybe I’ll need a new map card here to configure the date range I want to show.
Has anyone had similar ideas and can share hints on how to best store the data in an external SQL database (step 1)? Has anyone tried something like this and can say whether it works well and is a good idea? ![]()
Regards,
Tobias