[RELEASE] OwnTracks Presence

UPDATE: I still loosely maintain this driver; Geofency is my daily driver as we are an Apple household. My OwnTracks integration very basic and requires manual setup on each device and for each user - this has been confusing for many, hence the plug for the other integration @lpakula has built that has a simplified enrollment workflow for not only you, but for the users you're wanting to track. If you're looking to replace Life360 because they are turning into MyQ, @ipakula's integration is the one you should probably be using.

I currently use Geofency as an input into my presence (shameless plug for Combined Presence where you can use multiple factors to determine final presence), however this app is iOS only. I saw mention of another option (OwnTracks) that is both iOS and Android. I've also recently converted someone who is Android-only over to Hubitat, and they've been having issues with Presence, thus here we are.

This app uses OwnTracks app to keep your location data private. It uses a webhook on your device to call back to Hubitat and sync your presence status. You can have any number of regions and link to those any number of people (i.e. Home-Brian vs. Home-Spawn1, or Work-Brian). This integration will also report battery status, battery percentage, SSID and BSSID of the device (fully supported on iOS, partially supported on Android but coming soon).

Easiest way to install is via HPM, then create a virtual presence device for each person & location you wish to monitor.

Installation Instructions are here: https://github.com/bdwilson/hubitat/tree/master/OwnTracks-Presence

Features Missing from OwnTracks MQTT: There are no plans at this time to duplicate the functionality of OwnTracks MQTT. Feel free to add this and submit any change requests if you need this.

Version Changes: 1.1.2

  1. Shows battery (charging/unplugged/full) - not yet supported by Android, but it's coming. Will show N/A if not supported.
  2. SSID/BSSID will show if you're on wifi, if you're not or not on iOS, it'll change/show to N/A. I opened an enhancement request for OwnTracks on Android and they have said they will implement it.
  3. Debug mode will auto-disable after an hour.
  4. Debug mode also enables checking location updates from OwnTracks to see what regions you're "in" and updates those. This only happens in debug mode because otherwise your location would be updated unnecessarily as the transition events from OwnTracks is what details an actual change.
  5. Cleaned up instructions (github) & directions (during app install/configuration). If you notice something that needs to be communicated better, let me know, or send me a pull request.
22 Likes

Sadly for me... I could not get this to work. Probably something I am missing in the instructions. I tried twice and while I had it partially working the first time but it quickly stopped. Second attempt was an utter failure as I could not get it to register present/not present. I did succeed in draining my phone battery at an enormously fast rate for both attempts.

But to be fair, I haven’t found a presence sensor that works with hubitat and my phone yet. It is consistently hit or miss with accuracy... more misses I am afraid. :wink:

Can you confirm if your settings looked like this?

My region is called “Home” and my virtual presence device is called “Home-Brian”

yep..
created the virtual device --> Home-name
put name in the userID field
put the url that was generated into that field.

Can you share the debug logs? You can PM if you don’t want to post. I made a few changes last night and hope I didn’t break things. I also don’t have an android device to test.

I will work on it tomorrow and let you know. I have an iPhone. I did notice the setup instructions changed from the first to second attempt. Again, most likely something I am doing incorrectly.

Yeah I changed them; trying to make it easier so you don’t have to change the URL at all now.

2 Likes

I have been using the app the last few days and have found it to work well. I had been using Locative (which has not been updated in ages) and Maker API in Hubitat but I found it to be slow and not very helpful. Thank you for making this available to people who use Android.

1 Like

How does OwnTracks compare to the likes of Life360? I current use a combination of Life360 with the Hubitat app to get presence but am always looking to improve.

Not sure. I tried Life360 a while back and stopped using it because it kept bombarding me with ads to upgrade to a premium version.

The only app I use for location is OwnTracks. Works perfectly on my iPhone - no complaints at all. And lets me keep my location data completely private.

2 Likes

And with this integration the Hubitat is the "server" or is there additional setup required?

I have an Android but I don't see any of these settings at all. I have not been able to get this to work.

I’d say it depends on your privacy concerns. This doesn’t rely on an external service like Life360.

Perhaps @breindl2005 can share the settings/steps for android and I can update the docs.

Getting persistent error when I try to add the app after installing it via HPM. I've created a single virtual presence device for me at home.

You have to enable OAuth. For some reason, the HPM is not doing it.

1 Like

What you need to do first is go into the hamburger menu and press preferences. Then press Connection and then Mode and change that from MQTT to HTTP. Then press Host and enter your Hubitat cloud link that can be found in the OwnTracks Hubitat App that you should have already installed on your Hubitat. Remember to change the [person] in the link to your name or the name of who you are setting up the sensor for. Then set up your Region for your geofence. You can then choose how aggressively you want to follow your location by pressing the play button on the Map screen to cycle through the different choices. I hope that this helps and if you have any other questions please let me know.

I have done everything you have said except for the [person] in the link. You are talking about the cloud or local link in the Owntracks app in Hubitat?

If so, I am not seeing a [person] reference in the link.....

How is the battery life btw compared to other geofencing applications for anyone that has been using this?

Thanks Brian for figuring out how to 'talk' to OwnTracks!

Based on @brianwilson's code I was able to pull all data from OwnTracks and use my Tracker code to basically duplicate my Life360 Tracker. But then I ran into a BIG issue. When using the http method, we can't see/share Friends. I started looking into MQTT, which is suppose to be able to share friends, but haven't gotten too far yet.

Battery use is very minimal, it only sends when the phone gets a new location. It never tells the phone to get a location reading unless you hit the button to push the info.

2 Likes