I’ve been using OwnTracks for a little bit, but have found I often do not get location updates as often as I think I should. I think this could either an OwnTracks App or other issue, but unsure.
So I’m curious what other solutions others may be using and was just looking at the Google Timeline available of where you have been. I’m not sure how often that time line gets updated though, but could be a possible solution.
Ideally, I would love a nice web page, etc that shows the location history of the device that is accessible from within OH2. Anyone have a thoughts on the best way to implement?
It has been a LOOOONG time since I’ve used OwnTracks but I vaguely remember there being settings in the app or talk of adding settings in the app to control how often and under what circumstances it reports.
I use gpsgate as a server based car tracker. But I’ve not looked to see if it’s got an API. But I do get emails/tweets on certain locations which I assume you could integrate
I’m not a coder (which I was), but was just thinking out great it would be to actually have HabDroid or another OH2 app that had built in support for location and geofencing.
Ie, Directly in HabDroid or other, you can send location updates to home server running OpenHab and then do what you want with it.
Maybe someday we can see something like that build directly into a OH2 app for your phone, etc. Here’s a link/info i came across which got me thinking on it. And it would then solve the issue of needing Owntracks or another method, etc.
If you are already using Owntracks then check out recorder. Written by the Owntracks guys and easy to setup on a Pi or local machine. It provides a web UI for viewing tracks and location points as well as a live location map.
They have just (in the last 12 hours) added support for tracking regions/geofences instead of relying on the Owntracks app. You can add your own LUA hook which is called for each region enter/leave event.
JP Mens has a little utility for drawing regions and generating the appropriate JSON which can be used to populate the recorder region DB.
I recently took a trip from tampa, fl to where I grew up in VA. then to DC. over to west VA. used owntracks the whole trip and had recorder running. When I got back I had a great trip tracker
I have the Owntracks Recorder (that @ben_jones12 mentioned above) web page embedded in my OH2 sitemap for each of my Owntracks users. This shows a nice google maps with dots (or line depending on which parameters are set) showing the movement of the person throughout the day, directly in my OH sitemap.
That sounds interesting! Would you be able to provide a short tutorial showing setup and result?
I and probably many other users might be interested in that!
Sure but unfortunately not for a week or so, as I am going on a trip abroad tomorrow. If anyone is still interested, I can do a short write up when I get back.
For those that don’t want to wait, the basic steps are:
Obviously, make sure Owntracks is working!
Install Owntracks Recorder (https://github.com/owntracks/recorder) and make sure that it is working/links to your Owntracks. It has its own web server, and so once it is up and running, you can go its main page and see your Owntracks devices etc. There are links on that page to go to the map page for each device. Note the links url. They should be of the format http://otrecorder:8083/map/index.html?user=test&device=s6edge&format=geojson&from=2017-02-09T00:00:00, where otrecorder is the name of the server that you’ve installed on, test is the name of the owntracks user and s6edge is the owntracks device name.
On your OH server, create a simple html page and put into your conf/html folder. The page just needs an iframe calling your otrecorder link that you noted from the previous step.
In your sitemap, add a webview element, pointing to the html file you created in the previous step.
That’s basically it. If you want to make it a bit nicer, you can (a) update the html page and make it more generic, such that you can pass user names/devices it from your sitemap and (b) use ajax/rest to monitor a switch item that can turn on/off the line display instead of the dots.