nathan-gs / ha-map-card

A Map Card for Home Assistant
https://community.home-assistant.io/t/map-card-a-slightly-improved-map-card/693088
MIT License
30 stars 9 forks source link

Longer term history options #59

Open thybag opened 3 months ago

thybag commented 3 months ago

Open question on potential approaches to making use of longer term location history data within the map card.

By default Home Assistant keeps state history for 10 days, which is what is currently used to drive the card. Unlike energy data, location information doesn't currently get populated into the long term statistics database, meaning once the limit is hit, the data ceases to be.

While you can increase the time stored via setting the recorders purge_keep_days, this has the downside of slowing down HA as a whole.

I would be interested to know if anyone has looked at any other options, and whether it'd be viable to integrate with the card. Two key things i've looked at so far are;

Interested to hear what others are doing, if there are any other integrations that could potentially cover this.

nathan-gs commented 3 months ago

I would hope HomeAssistant would get a better split of history handling, where current state comes from the main db, and history from a timeseries database such as Influx or DuckDB.

I currently run HA with a retention of 2 years on sqlite, resulting in a db size of 38gb.

Unfortunately I don't think this is something we can fix in this frontend plugin, except by adding a bit of docs.

ildar170975 commented 3 months ago

This would be the simplest option in terms of making the use of the data in the card, but doesn't seem to have gained much wider interest, https://community.home-assistant.io/t/recorder-retention-period-by-entity/267849

I have to admit that even number of votes for this FR (466 currently - which is rather high if compared with many other FRs) may not force HA core developers to give some attention to this functionality.