Question on Life360 Integration and other Geofencing Apps

I've struggled with this too. I used life360 for a while but found it not to be always reliable, and I got the same privacy concerns you are running into. In fact I had folks just outright turn off the app. Had similar issues with geofency.

I finally devised a three-prong approach that relies entirely on wifi. It is accurate but not that timely. I use @thebearmay's hub ping, @jwetzel1492's iphone presence sensor, and @mike10's unifi presence sensor. I use these in combination with a relatively long timeout. It definitely works and is more reliable than any of the other methods, but it is not fast. It only detects presence, there is no location information involves.

Let me know if you want more details.

Android or iOS?

I'm on iOS and use OwnTracks, which also works on Android - completely private, your data isn't stored on any external server or shared with anyone. Locative also works on iOS, and is also private.

1 Like

I use Geofency on the iPhone. Works great and doesn’t share locations - it just tells Hubitat if a specific phone is home or not. It might be able to do more, but that’s all we use it for.

You will need to just setup the could endpoints as triggers for rules that sets up a presence virtual sensor to present or not. Sounds a bit complicated, but is not - I or others can help you set it up if you decide to go with this option.

1 Like

I run Android, and thank you for this suggestion and I got OwnTracks working on my hub. I think I ran into what is causing my issues though, as it says "This version of Android restricts OwnTracks from receiving locations when automatically started on device boot until the app is opened" and I'm guessing this is why my other tracking apps stop working and don't work until I try to debug them (by opening the app).

4 Likes

Maybe something for tasker to handle? Have it open all these apps once on boot then force close them?

2 Likes

I use Life 360 and Improved Mobile Presence (android only) , and Improved Mobile Presence has been Rock Solid, and @Johndc7 is great to work with and helps out freely if you have any problems. Since I started using this I don't care that the geofence in on the mobile app doesn't work.

1 Like

If OP has Tasker app on phone already, it is very easy to create a Profile to turn on/off an HE virtual presence device using Http Request and Maker API. You can create multiple for multiple locations.

1 Like

I do have tasker on my phone but it would be yet another app to install on my wife's phone and I need to make damn sure it's the solution before I do that. Wouldn't tasker have the same issue of not being able to get location until it's manually opened?

I know how to have tasker open apps, do you have any information on how to do what you suggested, or perhaps a task to share?

You do have to get permission for Tasker to run in the background all of the time which I do. If I didn't, Tasker would be almost useless to me because I rely on it to be always running.

First, in Hubitat, create a Virtual Presence device whether that be home, work, etc. You should create one for each location that is important. Then, take note of the Device ID for each. Next, authorize each virtual device in Maker API.

In Tasker, create a Profile using Location and set it to home, work, etc along with the diameter. Then, the task is to send an HTTP Request using your Cloud Maker API information such as:
https://cloud.hubitat.com/api/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/apps/4/devices/[Device ID]/[Command]/[Secondary value]?access_token=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx where "[DeviceID]" corresponds to correct Virtual Presence Sensor. "[Command]" would be "arrived" and you can delete "[Secondary value]". After that, create an Exit Task for that same Profile that sends an HTTP request that is same as first one but replace "arrived" with "departed".

I recommend opening Hubitat on your phone so you can copy the HTTP Request from Maker API then you can paste into your Tasker Task and make the device-specific edits.

2 Likes

From my understanding from experience and from what Owntracks is telling me, it's not enough to be able to be started in the background, it seems like Android doesn't allow background apps to get location access until the user opens the app or the app is launched not in the background at least.

I already have several tasker tasks that run without issue every time, but it looks like there's something specific with location access. Am I misunderstanding this? This would certainly explain why my apps stop working, I'm guessing I just don't launch them on my phone. It does seem like people are having success with some apps like Life360, so I don't know what's going on.

EDIT: did some reading on it and it does appear possible via the "allow all the time" location permission option, but background location is limited to a couple times an hour. Cómo acceder a la ubicación en segundo plano  |  Sensors and location  |  Android Developers

OwnTracks doesn't have this option

Hubitat, life360, smartthings, and tasker do. I'll still try the Maker API option and other options listed here so far but it seems like the issue I've been running into is actually the "couple background location requests per hour" and it's just not responsive enough to have lights come on when I get home, lock the door when I'm out of geofence, etc.

I do use Life360 and I haven't had issues with it unless Life360 does. I have found this very reliable however, there are things you need to do. I put all my automation people in its own circle. I do not use that circle other than for the hubitat. I used to use a shared circle with other friends and families and this did cause many many issues. I am using the free service and only have the people that I'm automating in that circle. I find is very reliable especially, on iOS devices. However there is fine-tuning both in IOS and Android that needs to be done with the power management. In addition, you do need to have the app running all the time. This means it can run in the background without the application actually running; so, you are going to select "always" not just when running. I do use this in combination with Wi-Fi detection. Although, the primary trigger is still geofencing. I've also used webcore but I believe this will use more power whereas Life360 does not seem to use as much battery. Some say when you use the service account for the application on hubitat; that you should use a different account than everyone else in Life360. I do not do this and thus far it's been working fine. I do use another application to combined different sensors and this helps with the responsiveness both leaving and arriving. On my wife's phone and my phone I do use the habitat geofencing with Life360, but not for my kids only Life360 and the Wi-Fi. This has been working perfectly in both scenarios.
Note, this is just for the setup for the phone and the hubitat. Since it's getting request from an internet connection your local network needs to be configured well. Thus, things like igmp and snooping need to be set up correctly on your network. I have found if this is not correct on your network this can and will delay response. If you do not know what these are you might be better off disabling all those Network services from everywhere and then only turn on one at a time and retest. Just some advice on networking.
Finally, if your phone is in power save mode this will also have an effect on the geofencing regardless of what application you use. Keep it at a power save mode, as long as, you can.
I hope you find this helpful.

Thanks for the write up, but you can still see precise GPS locations of those you're tracking, right?

Yes, I do. Both for Android and iOS. iOS it should prevent the application from going to "sleep".

Unfortunately life360 is a non-starter due to the privacy issues. If it would just report inside/outside zone that would be great but I do not want my exact GPS location visible to family nor do I want to see others'.

I agree, Life360 sells your location data to basically anybody that wants to pay for it.

1 Like

Privacy is what motivated me to switch to OwnTracks about 2 years ago. It has never failed, and at least on iPhones, has very little impact on battery life.

1 Like

Unfortunately OwnTracks on Android doesn't have background location permissions so I would have to open the app after a restart. At least that is my understanding. OwnTracks does seem to work the most reliably so far, if they were to add "Allow all the time" permission that would be great. I will continue testing a couple apps and continue to explore other recommendations here. Also, if I am misunderstanding anything with background location please enlighten me.

Currently testing: Webcore, Improved Presence, Hubitat (1.6.8 build 128), OwnTracks, and Smartthings. Will see which most accurately reports presence and report back.

The developers are quite responsive. You could submit a request.

First update from home to work:

Started out by restarting phone and didn't open any apps afterwards.

Hubitat: success
Improved Presence: success
Smartthings: success
Webcore: failed
OwnTracks: failed (significant changes mode)

Will try to manually make them report not present and test from work to home again the same way.

1 Like

As far as privacy, that's a philosophical discussion not technical. The fact that you have a cell phone your privacy has already been compromised.

There are definitely settings on the Android side that you might be missing. You must go into the advanced settings on the application to permissions and location; select allow all the time. In addition to that, under battery details you'll have to select unrestricted. This should resolve those issues.
I have tested and used Webcore and this does work even after a reboot of the phone and the Hub.

2 Likes