GPSTracker with Life360, OwnTracks and GPSLogger integration

Yeah I’m happy to test. I don’t use Life360 for time critical events arriving home anyway. I use Bluetooth and Network presence instead as it’s more timely.

I plan to use Life360 for notifications when a family member leaves or enters a zone to do announcements and prompts in the home. I setup the script and cron and it works fine - but it’d be neater in the single binding.

I’ve found Own Tracks to be so sloooooow it’s almost unusable. I basically have to open the app to trigger a location refresh. So as I already use life360 this works great.

Oh and not sure if it’s outside your scope or not, but it’d be super handy to add a channel for the life360 ‘in_transit’ and ‘speed’ variables. As these could be handy in rules to calculate expected arrival times.

Binding test version with Life360 support [WP]

@gbicskei looking good, but it failed to create a thing for one of my users, as the email address with the user has a period (eg. firstname.lastname) and I get the following error in the logs:

2019-08-29 17:35:58.428 [ERROR] [nternal.handler.Life360BridgeHandler] - Failed to update circle 976635a0-420b-4b53-8829-f689eeacda48
java.lang.IllegalArgumentException: ID segment 'life360_firstname.lastname' contains invalid characters. Each segment of the ID must match the pattern [A-Za-z0-9_-]*.
	at org.eclipse.smarthome.core.common.AbstractUID.validateSegment(AbstractUID.java:97) ~[?:?]

(truncated the rest and anonymised the actual first/lastname)

Maybe rather than using the email address from Life360 to name the tracker, you use the actual firstName & lastName in the API response?

Also, extra credit if you add channels for each of the places configured in Life360 for each Thing (eg. https://api.life360.com/v3/circles/{{life360_circleId}}/places). That would be awesome!

I’ve fixed the tracker id. You can use the same download link as before.

I’m not sure about importing places. Till now I sticked to the binding side place maintenance. This is the case with OT as well to make things simple (what if a place is deleted/modified on application side…). You can create these channels manually in PaperUI.

Considering you have a Life360 ‘Thing’ that manages the connection, you could have an option there to allow the user to sync/not sync places.

I have a bunch of places in life360 and I can have the ability to copy these across - but tbh it’s not simple to setup gpstracker regions and afaikt you need to do it for every user. So for me, ideally these would just be the same.

As for changes - can the polling process modify the related things or is that problematic technically?

Yes it can. The new version creates the distance channels for Life360 places but it doesn’t check for updates. If you modify a place you need to delete the channel manually which will be recreated with the new settings.

@gbicskei awesome work on this binding! Made it much easier for me to get up and running with OwnTracks as I was expecting to have to setup my NGINX to handle TLS for an encrypted MQTT connection.

I have a suggestion though:
Currently the geofence triggers for presence switches are only set by the transition event, but what if you are already in the region? I suggest taking the "inregions": [] data from the OwnTracks location message and sending ON commands to those listed, and OFF commands to any other known regions. I also suggest using the regionDistance channels to determine the same thing for server defined regions. Server defined regions should take precendence over client defined regions with the same regionName though.

I know you explicitly state that these triggers only update when the client sends the transition message, but that behavoir for the binding is counter to its intended use for presence detection.

1 Like

Hello, Used to be I was also Life360 user before I had changed to OH+Owntracks. My experience is that OH + Owntrack is same accurate and usuable. I use it for my doorlock and heating control. One thing what I have realized. If you check the location of other family members in Owntrack it won’t give you accurate result. It lates compares to Life360. But information reaches OH accurate so if you create a visualization in e.g. in sitemap than you can check it in live through your OH server. If you are experiencing delays, you need to check your mobile phone and Owntrack settings. We use it on Iphone and Android as well. I need to make some changes on each phone to get a good result.

My problem with Owntrack is different. It is more resource cosuming on android than Life360. On Iphone it operates strange but works.

have you tried the new Life360 support?

No I have not need it since I have changed to your solution. I installed map tracking in sitemap, and refresh throug OH sitemap is better than in Iwntracj itself.

1 Like

Hi, could you point me at the doco that talks about how to integrate life360 please?

thanks
Paul

Hi, I appear to be missing something, hopefully blindingly obvious!

I have owntrack configured and connecting perfectly. I got a notification in my inbox for my new gps tracker thing which I added. all good. I appear to bestruggling now to get a switch to trigger and for the life of me I cant workout why

I am testing with a REST client sending in a transition event and I can see the event register in the logs (I have debug on).
2019-10-14 13:55:17.810 [DEBUG] [nal.provider.AbstractCallbackServlet] - Post message received from OwnTracks tracker: {"_type":“transition”,“tid”:“pp”,“acc”:10.0,“desc”:“workshop”,“event”:“enter”,“lat”:51.3749936,“lon”:-0.4356089,“tst”:1527966973,“wtst”:1524244195,“t”:“c”}
2019-10-14 13:55:17.814 [DEBUG] [cker.internal.handler.TrackerHandler] - ConfigHelper transition event received: workshop
2019-10-14 13:55:17.816 [DEBUG] [cker.internal.handler.TrackerHandler] - Update base channels for tracker pp from message: org.openhab.binding.gpstracker.internal.message.TransitionMessage@18fecdc
2019-10-14 13:55:17.822 [DEBUG] [cker.internal.handler.TrackerHandler] - Updating distance channels tracker pp
2019-10-14 13:55:17.825 [DEBUG] [cker.internal.handler.TrackerHandler] - Location accuracy threshold check is disabled.

My item looks like this (workshopis defined as a region in owntracks

Switch atWorkshopPaul "Paul Workshop presence" {channel="gpstracker:tracker:pp:regionTrigger" [profile="gpstracker:trigger-geofence", regionName="workshop"]}

Any pointers would be much appreciated.
thanks
Paul

Not to worry, I deleted he switches completely and then re-added them and its all working fine now.

Hey guys,

i am maybe doing somethin wrong. But the binding is not working on my iPhone as expected. There are no position updates unless i open the app. But i want to use it for a “home coming” feature and dont want to open the app each time i get home.

Is this a known bug?

It is not a bug. Check iphone application settings. Then it would wirk.

I already did. But when the phone is in sleep mode i think there is no position tracking possible right?

Yes. You need to change in application settings location option of Qwntrack to continious instead of in use, then it works continiously despite of Owntracks is not opened. However as we have Iphone and Android phones both I can tell, that it works on Android a way much better. But nothing to do with the binding. It is purely Owntacks and Iphone issue.

@gbicskei did the Life360 feature make it into the official releases yet? I’m about to upgrade to 2.5.1 and wondering if I still need to use the custom jar?