[RELEASE] OwnTracks Presence

Yeah, it's weird...no matter what value I enter I get a "Invalid value entered" error. Oh well, I think I'll be allright. :slight_smile:

Are you using iOS app, I don't see locatorpriority settings , peglocator and Ping:

Android version has two places that allow you to change settings... Under Preferences. Maybe the iOS app does something similar, and the"missing" setting is in another location in the app?

Advanced and Configuration Management

Thanks for your response. Unfortunately iOS APP doesn't have those options. The screenshot I posted above is all it has to modify, How reliable is owntracks location reporting, I am not too concerned about the battery usage at the moment. I just want to automate garage opener with a tight geofence of < 30 m. Eventually if possible I would like to use it with a customizable geofence like this one:

brchri/tesla-geogdo: A lightweight app that will operate your smart garage door openers (GDOs) based on the location of your Tesla vehicles, automatically closing when you leave, and opening when you return. Supports multiple vehicles, geofence types, and smart GDO devices. (github.com)

This is incredibly accurate with my Tesla & a polygon geofence for both open and close the moment I am <10 ft away from my house. I am hoping to do something similar at least to auto-open for my wife with her phone when she is in proximity of door.

Not sure how iOS does it, but Android uses the Fused locator service that all of the other apps on your phone would use.

For the best performance, I'd switch it to "locatorPriority:3". That would use only GPS (not wifi). You get a bit of a battery hit, but each location is a GPS pin.

1 Like

If you have an Android, you can use Improved Mobile Presence to set up a "Driving" location that triggers when your phone connects to your car via bluetooth. Used in connection with OwnTracks (or other geofence-capable) presence devices, you can accomplish what you are asking about.

1 Like

Unfortunately we all have iPhones in our home. I hated the restrictions on iOS and have used Android for a while but then carrying multiple cables was such a pain I had to move to iPhone myself:-(

1 Like

FWIW, we have moved our Samsung Android devices over to Magsafe charging, so we no longer worry about cable types (USB micro, USB-C, Apple lightning, whatever) at all.

Car mounts and home charging locations are all Magsafe. All it took to make the change from plugin charging was getting a couple Magsafe compatible cases for our phones, and desktop and car Magsafe chargers. Love it, and it's all compatible with my kids GFs, who use iPhones.

I'm having another go at improving my "location clock" - there were some code issues and some mechanical ones around the servos.
Those are sorted, and I'm back at trying to improve the performance of owntracks on the family phones (android and iphone). I've taken @lpakula settings above & applied them to the android phones, and to the settings, such as they exist, on the iPhones.
I'm still not happy with the performance though - has anyone seen this sort of behaviour?
my android phone picking up me leaving home & broadcast "not present" at 13.07. it then sent an updated lat/long 1min20secs later (I was driving).
I returned home at 13.10 (short trip!).
at 14.03 it had not registered my return. on my phone I checked my location in google maps.
I looked in owntracks at my regions:


and I'm not showing as "here"
despite that being pretty clear on the map:

(I'm in "significant changes" mode)
I then hit the upload button top right - went back in to regions and there was no change. I went back in to map, hit the upload button again, and then it responded.
looking at the logs,

2023-12-28 13:07:54.448 I MessageProcessorEndpointHttp: Message id=1703768873398-ea9342 sent in 1043ms
2023-12-28 13:08:58.792 I MessageProcessorEndpointHttp: Message id=1703768937864-9077bc sent in 906ms
2023-12-28 14:02:28.926 I ServiceStarter$Impl: starting service
2023-12-28 14:05:49.669 I MessageProcessorEndpointHttp: Message id=1703772349004-418ee2 sent in 656ms
2023-12-28 14:05:50.283 I MessageProcessorEndpointHttp: Message id=1703772349016-331a98 sent in 607ms

It looks like the service stopped and then restarted? but owntracks was running all the time.
Battery usage is set to "Unrestricted":


"Pause app activity" was allowed - but that is for long periods of not being run at all isn't it?:

I probably ought to report this in the owntracks github, as it's clearly all to do with owntracks and not hubitat, but has anyone got any ideas?

Cheers,

James

How far is the trip you made (distance wise?) What you are describing sounds like more of a Google issue than Owntracks based on the settings.

With the settings I posted, the phone would need to see you move 50m before sending a location, and then it would wait 60 seconds, and need to see another 50m move before sending the next location.

With "locatorPriority:2", it's sniffing the air for wifi and cellular access points to determine if you moved. If you are in a place with there is a ton of wifi activity, it's very accurate. If there isn't a lot of wifi activity, or you are not traversing a cell boundary, it won't reflect your movement properly.

If you switch to "locatorPriority:3" then Owntracks will use GPS which solves the above statement, but does sacrifice more battery to do so.

Mine is working spot on, but I did write an Owntracks app that changes the phones to pegLocatorFastestIntervalToInterval: false and locatorPriority: 3 to give me the near home precision when a phone reports back that it's within 750m of home. Once it leaves that geofence, then it switches the phone back to pegLocatorFastestIntervalToInterval: true and locatorPriority: 2 to save battery.

Still working through that code, but so far that has worked great.

1 Like

Thanks - i didn't understand the difference between locatorPriority 2 & 3. I'm in a town and did around 500m. It also disconnected from my own wifi and then re-connected on getting home, so I would have thought that would have triggered it....
I'm going to leave it on 2 for a bit and see how it goes, but I might bump it to 3, as I charge my phone every night anyway....

1 Like

That distance should trigger it fine, as long as you didn't trip a locator accuracy limit where it didn't send out a location (you will see those in the logs that it suppressed it).

Might be the wifi though. When I drive where I live it works spot on. If I ride my bike, and go through a green space with poor wifi coverage, I go MIA for 10 minutes. :slight_smile:

Are you going to ask for a pull request on these options from the OwnTracks developer(s) when you feel it's ready? Or post that version as a download here for us to try? :slight_smile:

1 Like

Oh, changes were all in an Owntracks Hubitat App. I need some time to document it a bit and then I can post a thread with a version to grab. The "goal" of the app was to replicate a single config source (and mimic Life360). Just need to get the documentation together, and check if any custom additions that I added to the mobile app doesn't break anything for others grabbing it off the playstore.

4 Likes

Thanks very much for sharing - both your settings and these additional customizations. I alwasy liked OwnTracks, but now it's more like love. :wink:

Would the changes you’ve done break other installs (like iOS?), if not, happy to help you get it integrated into the version I “maintain”.

2 Likes

Will this app work with OwnTracks if I run it on my unraid server for full MQTT functionality? Is there any way to make it look at a server if I set one up?

Darn nice of you, Brian, especially since you don't really use this yourself. Three cheers... :mega: :mega: :mega:

Hopefully @lpakula's changes can be integrated to keep things simpler (one version).

3 Likes

Cheers @brianwilson. Much appreciated.

I guess that duplicating the "where are my family members" mapping gui of Life360 is a pipedream. Presence seems to be quite cool though.

Also, I can't figure out how to add locations on the Android owntracks app - unless I manually add using lat/long, which isnt practical. Odd.

This may help...it's actually pretty easy to get the lat/long in Google Maps.

Computer:

Right-click on a location and get the lat/long coordinates in the context menu:
image

Phone: Long-press on a location/area to drop a pin, you can also get the coordinates of the spot: