[RELEASE] Life360 with States - Track all attributes with app and driver. Also supports RM4 and Dashboards!

Do you have notifications turned on for your Place in the Life360 app?
(Go to Places and make sure the little purple bell is highlighted)

I do...

From a previous post...

:man_shrugging:

Cool, I'll try that! :+1:

I've got this app installed and noticed the following log entry for 1 of the Life360 devices. It's probably because I hit pause on the location sharing in the Life360 app for my device (we're using Life360 primarily for my daughter's phone).. anyway, figured I'd share the log in case it's an easy fix

dev:8542022-03-22 02:14:00.545 pm errorjava.lang.NullPointerException: Cannot get property 'latitude' on null object on line 355 (method generatePresenceEvent)

I've been getting that on my wife's 360 since I don't know when. Just noticed it a few days ago while working through another issue.

I keep mine inactive.

I forgot to mention that it's every 30 seconds too.. guessing that's how often the app is polling Life360?

I ended up just adding this to the app driver code.. maybe there's a better way to handle it but just ignoring the update seems to work for me:

Drivers -> Location Tracker User Driver

def generatePresenceEvent(member, thePlaces, home) {
    if (member.location == null) {
        // log.info "no location set for $member"
        return
    }
    if(logEnable) log.trace "In generatePresenceEvent..."
...

1 Like

I actually looked at 360 and see that she paused so that explains the error, but maybe put the polling to sleep for x after x missed polls and then wake it periodically?

Or perhaps read the paused state and report on it?

1 Like

Anyone having issues with their places not showing up? Two of us in a circle and still nothing.

Have you selected places within the Life360 (phone) app by clicking the little 'bells'?

I have rules to trigger when battery level increase of decrease, but sometimes my rules don't seem to trigger. I look at the life360 device log and see this:

invalid operand type for 74(number) decreased decreased0(string)

The life360 device does create a log of events and I wonder if the event rate is too much for rules to handle. If the load is causing rules to skip events, then that would cause it to not see state changes.

Now I'm thinking I should rewrite my triggers to just check life360 states every few minutes instead to reduce the number of times my rules are run. And use an alternative to the the built-in decreased/increased attributes.

Hi @bptworld - I'm using this driver to display a map of my daughter's iPhone; I noticed there's an update pushed out to all my connected dashboards just about every 30 seconds but the only change is the 'lastUpdated' time and the status tile (which has the last updated time in it). Her phone hasn't left the house in days

I'm wondering if it'd be possible to only send out updates if something actually changed? Or, maybe just be able to set a property for how often the driver polls for an update from Life360?

Hi, It's been running like this for over 3 years now. No ill effect on the hubs.

I wasn't suggesting it was slowing anything down - but just curious if there could be a way to see fewer updates when nothing's actually changed.

I figured 1 option would be a setting to control how often the life360 server was polled. I've seen that in several other drivers and maybe it's easy to do (I'm not a groovy developer)

def scheduleUpdates() {
    if (logEnable) log.trace "In scheduleUpdates..."
    // Continue to update Info for all members every 30 seconds
    schedule("0/30 * * * * ? *", updateMembers)
}

I think more my request though would be just not to push out any updates to the dashboard when nothing's changed and it's not for any kind of performance reason.. just a personal preference (fewer data in the logs so easier for me to spot other issues).

More specifically, does Life360 have any kind of 'last updated' timestamp when the device last reported in (or something to that effect)? That would seem useful to know vs just the timestamp of the last time the driver did a poll

Again, I'm not a groovy developer so this is just me browsing through the drivers..

    def lastUpdated = new Date()
...
    // *** Timestamp ***
    sendEvent ( name: "lastUpdated", value: lastUpdated )

Anyway, not criticizing in any way - just a couple of things that would be helpful to me (but maybe no one else :man_shrugging: )

2 Likes

New bundle available...

2.6.4 - 09/06/22 - Added option to export all life360 Places to file

Also, files are now available on Bundle Manager

Thanks for making this app/bundle! Is there a way to create feature requests or send you pull requests to implement new ideas?

I’d like to add support for multiple circles. I have two circles, each of which has a “home” location defined (my house). This is because the members of both circles share their location with me but don’t share with each other.

My feature request is to allow selecting more than one circle in configuration and then selecting one home location from each of the circles.

Does that sound reasonable? Would you accept pull requests? I looked around but didn’t see the code on GitHub, only the zip bundles that go to HPM.

Pull requests are the only drawback to bundles that I've come across so far. I do accept changes/additions/fixes but with bundles, we can't do pull requests. As a work around, you can update the code, then upload it to your Github and send me a PM. I'll go and download it, test it and then pack it up and update my Github.

Just a quick note, please make sure you are using the latest code before making changes.

Looking forward to seeing what you come up with!

Thanks!

After the last hub update the states are not updating anymore :cry:
It shows th person at home, but the status is "away". The logs for the devices are flooded with errors

[error]com.hubitat.app.exception.LimitExceededException: App 11 generates excessive hub load on line 340 (method generatePresenceEvent)

For last several days, Hubitat Package manager throws the following
2022-11-07 11:53:22.624 AMerrorBad manifest for Life360 with States. java.lang.NullPointerException: Cannot get property 'betaLocation' on null object Please notify the package developer.

app:22582022-11-07 11:53:22.622 AMerrorError downloading https://raw.githubusercontent.com/bptworld/Hubitat/master/Ported/Life360/packageManifest.json: groovyx.net.http.HttpResponseException: status code: 404, reason phrase: Not Found

Bundle Manager