GPSTracker with Life360, OwnTracks and GPSLogger integration

I would like to introduce my new binding that integrates OwnTracks and/or GPSLogger mobile applications directly over HTTP to provide geofencing/presence detection. I’ve been testing it on my setup for some time without any problems but it would be good to here your feedback.

The pull request can be found here, the binary can be downloaded from here and this is the documentation for setup.


Sound great, have you thought about supporting mqtt connections?

No as OwnTracks advises to use HTTP mode:

Just tried now that gpstracker binding has become part of 2.4, but I’m struggling trying to get that to work with owntracks.
Following the docs (i.e.,
I would need to access the HTTPS server on port 443 from the clients.
But openHAB does not listen there ? I’ve got a standard openHABian setup to run nginx there
Also, I fail to understand where that User/PW for openhab are coming from that you say to enter in the docs?
Do you expect me to run an nginx instance on :443 and do the auth there ?
If yes, where would I need to forward those requests to ?
If you don’t expect users to provide the nginx instance then where and how to access the API and where and how to store those credentials ?

Pretty confused …

Basically you have two options:

  • Use which will proxy requests to /gpstracker/owntracks. In this case the authentication is handled by
  • You can set up a reverse proxy with Nginx. In this case you can choose the port you like (https://<your.ip.address>:PORT/gpstracker/owntracks) and you need to configure the authentication as well in Nginx. Here is a community topic with this subject.

I know, that’s the two standard ways to make OH reachable from the outside. Option #2 is what I already run.
Ok, so you mean to say there’s actually NO authentication in your binding, right ?

So either of the following ways, to access via NGINX, the following curl command, or to point owntracks directly to the http://:8080/geofence/owntracks would also need to work, right? (if the phone is in the LAN).
Neither one does. As can be seen below, jetty does not serve that namespace. So I guess the URL is wrong ?
Also, I enabled debugging on org.openhab.binding.gpstracker but I do not get ANY output whatsoever. Is that normal ?

[19:28:54] openhabianpi@openhabianpi:/home/openhabian $ curl -v --header "Accept: application/json" ""
*   Trying
* Connected to ( port 8080 (#0)
> GET /geofence/owntracks HTTP/1.1
> Host:
> User-Agent: curl/7.52.1
> Accept: application/json
< HTTP/1.1 404 Not Found
< Cache-Control: must-revalidate,no-cache,no-store
< Content-Length: 0
< Server: Jetty(9.4.11.v20180605)
* Curl_http_done: called premature == 0
* Connection #0 to host left intact

But the path is wrong:


!= /gpstracker/owntracks

Ok, so you mean to say there’s actually NO authentication in your binding, right ?

The authentication is never the binding’s responsibility
The binding was renamed during the review process - make sure you have the up-to-date binding jar
Enable the log trace on console: log:set TRACE org.openhab.binding.gpstracker
You should see this in the log;

2018-10-03 18:12:38.950 [DEBUG] [org.openhab.binding.gpstracker      ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.config.discovery.DiscoveryService, org.openhab.binding.gpstracker.internal.discovery.TrackerDiscoveryService}={, service.bundleid=183, service.scope=bundle,,} - org.openhab.binding.gpstracker
2018-10-03 18:12:38.965 [DEBUG] [org.openhab.binding.gpstracker      ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory, org.eclipse.smarthome.config.core.ConfigOptionProvider}={location=47.536178,19.169812,, service.bundleid=183, service.scope=bundle, radius=100, name=Home,,, additionalRegionsJSON=[
], triggerEvent=false,} - org.openhab.binding.gpstracker
2018-10-03 18:12:38.994 [DEBUG] [er.internal.GPSTrackerHandlerFactory] - Initializing callback servlets
2018-10-03 18:12:39.013 [DEBUG] [org.openhab.binding.gpstracker      ] - ServiceEvent REGISTERED - {javax.servlet.ServletContext}={osgi.web.version=, osgi.web.contextpath=/,, osgi.web.symbolicname=org.openhab.binding.gpstracker, service.bundleid=183, service.scope=singleton, osgi.web.contextname=default} - org.openhab.binding.gpstracker
2018-10-03 18:12:39.047 [DEBUG] [er.internal.GPSTrackerHandlerFactory] - Started GPSTracker Callback servlet on /gpstracker/owntracks
2018-10-03 18:12:39.058 [DEBUG] [er.internal.GPSTrackerHandlerFactory] - Started GPSTracker Callback servlet on /gpstracker/gpslogger
2018-10-03 18:12:39.072 [DEBUG] [org.openhab.binding.gpstracker      ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.core.thing.profiles.ProfileFactory, org.eclipse.smarthome.core.thing.profiles.ProfileAdvisor, org.eclipse.smarthome.core.thing.profiles.ProfileTypeProvider}={, service.bundleid=183, service.scope=bundle,,} - org.openhab.binding.gpstracker
2018-10-03 18:12:39.092 [DEBUG] [org.openhab.binding.gpstracker      ] - BundleEvent STARTING - org.openhab.binding.gpstracker
2018-10-03 18:12:39.098 [DEBUG] [org.openhab.binding.gpstracker      ] - BundleEvent STARTED - org.openhab.binding.gpstracker

Any luck?

Seems I used the info off the picture in the binding docs, that’s still ‘geofence’. Please update that pic.
Ok now at least there’s a different response…

I had set it to debug already, but trace makes no output appear either.

I’ve been running snapshot #1374 (5 days old or so), latest code should be in there I believe ?
I’ve removed that bundle and installed yours from that link above. Now at least I saw some debug output on startup.

Something’s still weird though, I see packets arrive into nginx on sending owntracks update but they do not seem to be forwarded to the OH API side.
But I see them arrive if I send direct. Need to investigate further.

You are right. That picture was created before the binding was renamed.
The link I’ve provided is the official PR built artifact. There should’n be any differences compared to the latest snapshot build.

Please update the docs page. Add the info on myopenhab/nginx there, too, else it’s very confusing.

Ok, some tiny progress and a new problem on thing discovery:

2018-10-03 22:09:35.428 [DEBUG] [nal.provider.AbstractCallbackServlet] - Post message received from OwnTracks tracker: {"_type":"location","tid":"MS","acc":16,"batt":66,"conn":"w","lat":51.6898195,"lon":8.688836,"t":"u","tst":1538597376,"_cp":true}
2018-10-03 22:09:35.435 [ERROR] [nternal.DiscoveryServiceRegistryImpl] - Cannot notify the DiscoveryListener org.eclipse.smarthome.config.discovery.internal.PersistentInbox on Thing discovered event!
java.lang.ClassCastException: org.eclipse.smarthome.config.discovery.internal.DiscoveryResultImpl cannot be cast to org.eclipse.smarthome.config.discovery.DiscoveryResult
        at org.eclipse.smarthome.config.discovery.internal.PersistentInbox.get( ~[97:org.eclipse.smarthome.config.discovery:]
        at org.eclipse.smarthome.config.discovery.internal.PersistentInbox.add( ~[97:org.eclipse.smarthome.config.discovery:]
        at org.eclipse.smarthome.config.discovery.internal.PersistentInbox.thingDiscovered( ~[97:org.eclipse.smarthome.config.discovery:]
        at org.eclipse.smarthome.config.discovery.internal.DiscoveryServiceRegistryImpl$ ~[97:org.eclipse.smarthome.config.discovery:]
        at org.eclipse.smarthome.config.discovery.internal.DiscoveryServiceRegistryImpl$ ~[97:org.eclipse.smarthome.config.discovery:]

Also still wondering on NGINX, seems GETs work but it doesn’t forward PUTs … already added proxy_http_version 1.1 but that didn’t do the trick either

You can probably ignore this error. I had the same message in a fresh openHAB installation (but with a different binding). After a restart the error did no longer appear (see also this issue:

I’ve seen these messages as well while I was using nightly snapshots. The new milestone builds are more stable. Consider switching to 2.4.0.M3 or M4.

Switching to the milestone builds won’t help. According to Kay the problem has been solved after M4.

Hmmm… I’m on M3 and I don’t see this. @mstormi is on 1374 which has this bug but according to Kai in >= 1374 should be fixed…

Have you checked this:
There is a detailed documentation how to set up nginx. This is not really binding specific.

Seems to be an NGINX issue with encryption, it works for now only if unencrypted.

BTW: discovery is still broken in latest snapshots, Kai confirmed and is working on it.

I manually added a tracker thing.
Now if I force a location update in owntracks, it works to get the location into my openHAB item.

However I did not manage to get neither owntracks to send region enter/leave nor the binding to detect that.
Am I correct in thinking that owntracks would need to send this if I define a region(+radius) called say “home” inside owntracks and then move in and out my home ? I’m sure that worked in previous versions.

Can region definition and enter/leave recognition also be done on the server side ? (It worked like that in mqttitude1 binding).
If I create a channel, is that to be used for server-side definition of a region ?

More questions:

  • on manual thing creation in PaperUI, things are created with a default channel of type distanceSystem, now what’s that ? Is that a server-side region definition for the openHAB server’s location ?
  • what is that profile="gpstracker:trigger-geofence" for in the binding example config ? It’s not explained.

You can do this in OwnTracks app by defining regions. This will result a transition message sent to the binding and the trigger channel will fire events with <<region_name>>/enter or <<region_name>>/leave