[OBSOLETE] Life360 - Refreshed Every Minute & All Places & More All API Data available for webCoRE Usage

@tmleafs Thanks for this & nice work!
I am currently working on a piston that allows you to query a family member’s location and time until home with an alexa output. I am using your life360 work and the google distance matrix and geolocation APIs (https://community.webcore.co/t/leveraging-google-maps-api-for-location-on-demand/10693). I am pretty certain that it is working nicely for a US application. Once it is stable for a week or so, I will post it here (if there is interest). Thanks again!
-Broc

2 Likes

@broc I take it your a android household and don’t have any issues?

I will be anxiously awaiting.

Is Life360 still a battery killer? I haven’t used it in years, but remember when I did it would eat up the battery.

Seems to be working fine now

If your android and already have high accuracy location turned on you will seen a few percent battery usage by life360. If you see I drain in the past I reset Google play services and reboot

Hi guys,

I’m looking for SmartThings to do things when I leave or arrive at home, at the moment all I’m asking for is a notification. I’ve been using ST & WC presence sensors for the past few month with intermittent results. Usually departing from home works better (I get notified quicker) than arriving home. Today I installed Life360 and the results are much the same as ST & WC (which is a shame).

When I arrive home (using Life360) the Life360 app shows my precise location in ‘real-time’, but ST takes ages (several minutes) to update the presence of the Life360 sensor (my iPhone).

I was hoping to write a piston to force ST to update more frequently when either myself or my wife are within a certain radius of home and traveling over a certain speed. See draft 1 below.

Would this work do you reckon, or, are there any other approaches ? Also, in this example piston, will the refresh happen every 10secs until both the distance and speed conditions are not met ?

Cheers

1 Like

How long have you been using my version of life360? Are your phones android or iOS?
Using this app the data should never be more than 1 minute old from life360 servers.

Hi tmleafs,

I only installed Life360 DH & SmartApp (via the IDE) today. Both of our phones are iPhones.

If I drive up and down the road (through our home geofence) the Life360 app (my location on the map) updates real-time, but ST notifications are usually a fair way behind. Interestingly, I receive our ‘leaving’ notification approx 10 secs after leaving the Life360 geofence, but the ‘arrival’ notification on my first attempt was around 30 secs after entering the Life360 geofence, then on subsequent arrivals more like 2-3 minutes (whilst I was constantly refreshing the ST app).

Even more interesting is that from within the ST app I noticed my ST presence & WC presence were marked as ‘present’, it was only my Life360 presence which was marked as ‘away’ (all on the same iPhone, and the Life360 live view clearly showed me well inside my geofence).

Also interesting that the Life360 app described me as ‘near xxx roadname’ and not ‘at home’. Not sure if that’s relevant.

Cheers

I haven’t had any issues yet!
That said, I only came across this solution last week, which is why I wanted to make sure that it was stable. I am going to copy my webcore piston and change the variables to be more generic (currently, they are the names of my family members) before posting it.

Using Google APIs and Life360 with Amazon Alexa to get updates on location and drive times for friends and/or family
These instructions are slightly modified from gopack2’s original instructions.

  1. create in smartthings and share with webcore a simulated switch for each person whose location you will want to check (e.g. Switch 11, Switch 12, Switch 13 in the code below)
  2. Install the life360 smartapp per this thread’s instructions (as well as the life360 app on the appropriate phone(s))
  3. You will need to get API keys for 2 Google API’s. I am a novice at these, but it appears that with the low level of usage that is likely with personal usage that no charges will be incurred (this is buried deep in the description of the charging structure … but please read this for yourself). Google will want a credit card though.

3a. Get an API key for google distance matrix API
https://developers.google.com/…/distance-matrix/start
3b. Get an API key for the Google geolocation API
https://developers.google.com/…/docum…/geolocation/intro

  1. Webcore global variables
    4a. Save your API keys from step 3 into @GoogleMapsDriveTimeApiKey and @Google_Maps_Api_Key for the distance matrix and the geolocation respectively … these are the same numbers for me
    4b. Define the global variable @GPS_Home for the latitude and longitude of your home address. I used https://www.gps-coordinates.net/. If your home address is “New York, NY”, then you would define @GPS_Home as 40.7127753,-74.0059728

  2. Import the following code

  3. change the text for the cases (lines 35, 38, and 40) to match your simulated switches

  4. This code assumes that you are timing your drive times relative to a life360 address named “Home”, if this is not true for you, update line 60 of the code accordingly

  5. “Music Player 4” is any Echo device(s)

  6. I have tried to heavily comment the code so that it is clear what is happening where

  7. When forming the message to be spoken in the code (Lines 58, 67, 78, and 80), I replace “Life360” with " ". This is because my life360 presence sensors have names like “Jane Life360” and this makes the output from echo more conversational.

  8. The last step is up to individual preference … trigger those simulated switches from step 1 however you want!

Notes about things that may vary regionally: I have modified line 71 from gopack2’s initial code changing many [1] references to [0]. This may vary regionally depending upon Google’s output to your requests. The first responses were more accurate for my cases, thus, I use [0] (computers start counting at zero). My life360 gives “No Data” for address2 only when I am at a personally defined/named life360 location. If this is not the case for you, then you might need to adjust line 65.

I hope that you find this useful!

2 Likes

Hi guys,

Does the Google API force the phones (presence sensors) to constantly update their locations when inside a goefence or within a certain distance from home ?

After testing with ST, WC & L360 presence sensors the issues appears to be the frequency of iOS background app refresh.

If I drive in and out of my home geofence with my phone locked then location updates / notifications can be anything up to 5mins late. If however I drive in or out of my geofence with Apple maps or Google maps open then notifications are pretty much instant.

I’m therefore after a way to force the iPhones to frequently update their locations when within a distance range from home (e.g. 5miles - 0.2miles). My home geofence has a 0.5mile radius. Ideally the phones would update in real-time or every 5secs when ‘near’ home.

Increasing the update frequency when near to home would surely solve a lot of people’s problems with presence notifications.

Any ideas ?

It does appear that iOS seems to update life360 far less than android from my research in the last 20mins going by the lastcheckin changing, it seems to be android will update 3 times the amount in the same period of time to Life360 Servers.

Has anyone figured out a way to use iOS shortcuts / launcher to open WebCoRE briefly when near home in an effort to improve location accuracy ?

Would ideally to open webCoRE and keep refreshing location (in the background / while phone is locked).

For me on iOS WiFi is always on and charging is always No. Also tried on android same.

Wife’s phone is iPhone 8 with iOS 12. Smartthings is recognizing her arriving immediatly which triggers disarming our alarm but 1 minute later it shows her as being gone for about 3 minutes which rearms the alarm. It does not show her home again until after she walks in and trips the alarm. Any ideas. I have an android that seems to function properly.

It happened to me a few times. I have an iPhone X with iOS 12.

The odd thing is that on the second time it marked me home (9:14PM) it didn’t disarm the alarm… see example below.

Obter o Outlook para iOS

Hi,

Is anyone using this updated DTH with webCore and if so, how do you access the differently named attributes?
Specifically, on a presence device I’d expect currentPlace to contain the name of the current GeoFence in which the sensor is located e.g. Home or Work (if it’s in one) and this appears to be address1 with this DTH
As long as i’m referring to the specific device the IDE presents all attributes, but if i am using a variable that contains the device then I only get the standard attributes for a presence sensor to pick from

I know this isn’t a webcore specific forum, I will ask it there too

Started getting SmartThings popup notifications for users having low battery level. So actually getting a notification on my Android phone. I do not see an option controlling this. Any idea where these are coming from and how to disable them?

Sorry I do not know but its not this app doing it

You need to remove any device from webcore and readd it will then list all the new attributes in webcore

Sorry for not replying sooner