Life 360 presence mode

It seems the Life360 app only tracks the simple attribute state "presence" set to "Present" if location="Home" and "Not Present" when away.

Would be nice if there was also a State value "Location" that contained the current Life360 location.

I can ask alexa where everyone is, but I would like to make rules based on places other than home, and have dashboard show current location.

I can probably hack a lot of this with IFTTT rules but I am trying to simplify with Hubitat

The only way I was able to get any sort of reliability out of life360 was forcing a refresh of user locations every minute. This has reduced the battery lifespan on our phones a little, but not enough to be concerning.

On ST I setup webcore to refresh life360 every minute, on hubitat I use rulemachine to refresh every minute. I have a rule setup to send roomba to the dock when my wife gets within 1 mile of the house. With the refresh, it has been reliable enough that roomba has enough time to dock before my wife opens the door to the house.

I don't have anything setup for smaller distances, as I'm not too keen on automating door/security unlocks. :slight_smile:

2 Likes

I don't understand this rule to refresh Life360 on the hub.... the Hubitat device is updated by a webhook from Life360 which is triggered from the phone update to their servers. Performing a constant refresh on the hub does nothing to refresh the Life360 status, unless there's a problem within Hubitat not refreshing the device for RM? Or has Hubitat also implemented polling on top of the webhook? Possible....

Oh, it most certainly does do something!!!

For whatever reason, both in in ST and HE, the webhooks get missed sometimes. For me it is about 25% of the time across the 4 phones in my family. I will get the notificaton from Life 360 that someone arrives home 100% of the time, but the status doesn't always update in HE.

Forcing a refresh compensates for that, and keeps the ST/HE device in sync more reliably. I don't do mine every minute, I've found every 5 minutes works for me.

It's been too long since I've touch ST so I can't comment on how they do it.

That's interesting with Hubitat though. So doing the refresh is a forced poll of the data at the point in time, which makes sense. I do not believe this was the "intentional" purpose but hey... whatever works.

This leads to the webhook is either:

  1. Not being received 100% of the time
  2. Not processed correctly 100% of the time
  3. Not sent from Life360 100% of the time

@mike.maxwell mentioned:

This problem is pretty ugly:

  • If you have two locations ( or more), one will get the updates, the other(s) will not
  • if you use the same life360 with other apps (for example ST), one will get the updates, others will not.

It sounds like as soon as you have more than 1 app using life360, they all need to do refreshes (effectively polling).

It would be nice if HE had the ability to at least forward within HE environments, but I expect this gets very complicated with multiple HEs deployed...

Well, not super complicated. HE automatically in the background sets up the Webhook end point with Life360. There is no asking to do this. Life360 does not actually support any of this but it's there so it's used. However from Life360 they only support 1 endpoint for the webhook. So last one setup is the winner. (Unless you setup the end point to a proxy that will then send the request to multiple destinations :slight_smile: )

Work around for multiple locations would be to NOT setup the webhook and only use polling for the locations. OR setup 1 location as the primary where you want/need the faster push responses and know that location 2 will require the use of polling to get any updates at all. If using the webhook just know to setup in reverse order where the Primary Location should be the LAST one setup so that it will be set as the endpoint for the webhook.

I assume with two locations, each doing refresh, they will keep "switching" the web hook to themselves...so you likely need both sites to refresh as the web hook will keep bouncing?

I don't know the specific Hubitat code but I wouldn't think the webhook would "switch" from a poll request. If it does then it becomes a bigger issue. You actually have to send a deliberate DELETE to the Life360 URL and then a new POST to update the webhook.

It is an interesting question of is their one web hook per life360 account, or 1 web hook per circle.

It is also interesting if refresh resets the web hook. I expected it would as if things stopped, you don't know why / what was lost in life360.

It also is a question if you use ifttt does it also fight over the web hook with HE.

For the first question I'm almost positive but I will double check but it's 1 webhook endpoint for the account level. The circle and member id are components of the post that is then sent to the end device ie Hubitat.

The webhook like all of the Life360 API is "undocumented" and not sanctioned for 3rd party use. I don't see how IFTTT would utilize the webhook as you the user of IFTTT would have to provide the destination.

I don't think a refresh touches the webhook, but Hubitat staff would have to confirm. The webhook is setup during the Life360 app install. The webhook is only the return URL back to your HE hub.

Looking at the debug, it looks like when you hit the Life 360 Refresh device button it deletes and re-creates the webhook.

At least there is a "webhook delete params" and then a "webhook set data" in there.

Wow.... ok so having multi-hubs in different locations with Life360 will be a real PITA... Just don't hit the refresh button!!! :smile:

I guess they thought doing a delete/create on each refresh would ensure functionality and make sure it wasn't updated by another system maybe?

1 Like

That's why I wish there were a simple/more reliable location app for Android... This shouldn't be that hard! The Life 360 app (and app based notifications) work great on my phones, but the webhook updates just haven't been reliable for me - I don't know why.

I tried Alexa, but it wasn't any more reliable - still many times the device didn't update when it should.

I could do something more elaborate with Tasker, etc, but that is a pain to maintain on 4 different phones.

Well... there is. Simplex Locate can use several Android clients. It's not a free service.

For free there used to be an app egiGeoFence that was great. But the author called it quits because he was tired of the constant changes to the Location API's in Android.

Another app that some like is BTraced (not free) but it can push to remote servers so if there was a cloud point open that it could send through and then an app on Hubitat to read the data.... it's at least a possibility.

Simplex looks really interesting. $4/device/mo is too high for me. If they ever have a 50% off sale, I might consider trying it though!!!

It's 30 day free trial just cancel if you don't like it.

I've heard the $4 is too high. It costs a lot to actually run the system unfortunately. I justify the devices as it's cheaper than my Hulu subscription which I don't even watch! :smile:

I get that!!!! LOL!

EDIT: Also, I didn't realize you were associated with Simplex. :slight_smile: I need to do some searching on here and understand what the integration options are with Hubitat...

1 Like

Current integration for external services is limited through Maker API to my knowledge.

Yes I'm associated with Simplex Technology :smile:

1 Like

Rule machine has cloud endpoints as triggers, you can perform any kind of action you want. No ability to read and parse data though if that's necessary.