Android Phone Presence Sensing

Check out this thread below. After a lot of digging I came to realize that it was my phone, not SmartThings issue. SmartThings requires that the phone be in High Accuracy location mode. High Accuracy is a misnomer. Its more like Always Available. High Accuracy uses GPS or WiFi or Bluetooth or Cell Towers to determine location. Only GPS is actually highly accurate. The others are just guesses. In actuality ‘Device Only’ location mode uses GPS only so it’s actually the most accurate, but GPS may not always be available, so if it is set to this your phone sometimes may have no idea where you are.
So if the phone is in 'High Accuracy mode, and it is idle, it may turn off GPS to save battery. During that time it is probably just using the nearest cell towers to determine your location. If you look at your Google Location history (see the link below for info). You’ll see that Google thinks your phone is 'teleporting back and forth from your house to a the cell tower. When you ‘teleport’ to the cell tower ST reports you as away. :frowning:

  1. Web requests not completing
    This is something that I recently contacted Smartthings about, and have seen referenced a few times here and there. As part of the events triggering, your phone sends a web request to a Smartthings url reporting the phone either entering or leaving. If the phone cannot send that request for whatever reason, then your automations will not trigger. Examples are being in airplane mode, having low/no signal, etc… Just like you couldn’t load a web page, the Smartthings app cannot send the information to it’s servers to show that an event has taken place.

With the release of Android Nougat, I confirmed with Smartthings that Doze may be interfering with these requests and not letting them complete. I have been told their Engineers are working on it, and will at some release an updated app that will account for Doze, but until then, if your phone is in sleep mode, know that the request fired off to the servers when an Enter/Exit event occurs, may not actually get there, thus not triggering any automations.

This is regarding your explanation of #2. This seemed very plausible to me, so I set about a simple (and quite possibly flawed) experiment. I left my home this morning and went to work, approx 11 miles away. That’s far enough that there could be no GPS reporting error risk, as described by #1. At work, my phone’s presence was still listed as “present” in SmartThings.

I attempted several fixes: toggle location services on/off, toggle location services accuracy modes, disable battery optimization for ST, restart ST app. None of these resolved the problem. Given the explanation in #2, that the event indicating an Exit has failed to reach the ST servers, this made sense, still.

However, when I restarted my phone, the ST app correctly updated my presence to “not present”. This seems to violate the suggestion re #2, since either the Exit event was republished OR there’s some completely different mechanism to change presence OR “something else” OR a mix of the above.

While I agree that a dropped Exit event could still be happening, it doesn’t look like the complete explanation.

Nexus 6P, Android 7.0, build NRD90M.

This is normal in relation to how ST updates its presence in Android phones. I used to have to restart my phone a lot when I used a Samsung Galaxy S2. It drove me nuts and I created a lot of tickets for that. This is an issue that ST support had admitted to a while back as not easily fixed.

Imosenko, I actually think it’s more a problem with the phone than with the ST app integration. For example, my Nest thermostat also has phone-based presence detection, and it sometimes has problems detected when I’m away.

I was really hoping that ST had figured out some more awesome way to get good presence detection from the phone. Reading some other threads this morning, though, it seems that’s a pot of gold yet to be found.

Just an update. I tried Life360 for a while and it worked well for a few weeks then it started having similar issues to what SmartThings was doing…

The best solution I have found is to make the geofencing radius in SmartThings to be absolutely huge. I’m talking a couple of miles in diameter. While I don’t like the fact that it takes longer to register me as “Away” and it registers me as “Arriving” sooner than I would like… it IS the best solution I see until SmartThings gets a better handle on this location stuff (which I don’t believe will ever happen).

So to anyone reading this, just make your geofence REALLY big and it should fix most problems.

My grocery store, my gym, my gas station, and some other things are all within 1 mile of my house. :frowning: I’m glad such a large radius works for you, but it won’t be a viable workaround for many people.

Not saying it’s a work around at all. In fact, it’s terrible that we can’t have a properly working small geofence… I’ve been frustrated about this for a long time, but at the very least, everywhere I need to go is more than a few miles away from me.

I’m sorry to hear this won’t work for your situation. They obviously can’t figure out the geofencing properly. I’m assuming it would eat too much of the phone battery to poll GPS more often than they already are. So hopefully they can implement a better option.

What I can’t understand is why they can’t allow for a WiFi only geofence option… allowing us to trigger things based on whether or not we are connected to home WiFi.

1 Like

Perhaps this is something that can be tackled with CoRE

Hmm, I hadn’t thought of that as I had no idea CoRe had functionality like that. I’ll have to look into it.

Still annoying that’s it’s not directly integrated with routines though. Can CoRe trigger routines to run?

I’m trying to figure out what all can be done and linked this topic in CoRE topic.

Right now I am just using IFTTT in CoRE for presence with the Wi-Fi applet to set presence, here’s a link from another topic that has screenshots of what I did in IFFT…

You could tinker with Tasker. Have it set a virtual presence via sharptools when your phone connects and disconnects to WiFi profile triggers? I have this running. Has a few issues. Your presence will be slow since phone has to connect to WiFi first. It has tracked my phone coming and going reliably just slow. So I don’t use it as my main detection. We use the presence FOBS.
I also tinkered with my tablet running Tasker ping to detect when our phones were on the WiFi. The problem with that is Iphone put their WiFi connection to sleep, also will probably affect your phones battery.

Check out this solution. It uses ST Presence, IFTT Location, and WiFi to determine if you are actually home. See bottom paragraph of this post to see exactly how big you need to make your Geofence.
Since doing this I have not had any issues.

Same concept here using CoRE, but still have to set a large radius in both ST and IFTTT for it to work correctly and show me as home before I actually get home. The WiFi switch works as a backup in case location doesn’t update or somehow gets disabled. The weakness here isn’t ST, it’s the frequency of updates from our phones I believe.

2 Likes

I’m having the same problem with my note 5 and my wife’s galaxy S6, while she’s at work it thought she’s home. My presence sensor worked flawlessly for a few days and then stopped completely

I have been having some presence issues and was reading thru this post, I have seen that one option to try is to set a larger geofencing radius in Smarththings , can someone explain how this is done?

From the ST App, go to My Home menu, click the Gear icon, from there you’ll be able to adjust the geofence by adjusting the red circle.

i have tried to do it there, only thing i can get to happen is moving the location balloon. Is there a trick to it that i am missing?

Hold down the edge of the red circle, wait for a black dot to appear, then you can adjust the size…if I remember correctly.

Edit: Oops, tap anywhere on the map, then it will bring up another screen. Sorry

got it. thanks. apparently i must have been pressing too hard or something.

Hi @Silverpawn.
Did you ever resolve this?
My S6 updated to Nougat last week and I have had issues since.
My wife’s phone has not updated yet and is still working flawlessly.
I have checked the battery optimisation and it is off.