For location, I found that the easiest and most privacy-friendly way of doing this without wrecking the battery of my main phone was to get a cheap used Android phone with dual GPS (a Xiaomi Mi 11 Lite 5G) on which I have PhoneTrack [2] installed and then pipe the GPS points to a PostGIS database on my local network [3] when I am home.
[1]: https://en.wikipedia.org/wiki/Memex [2]: https://f-droid.org/en/packages/net.eneiluj.nextcloud.phonet... [3]: https://github.com/gitc23/phonetrack-server