[HOW TO] SmartThings Presence reporting using Tasker/SharpTools/AutoLocation

So I was able to “solve” my monitor start issue by completely disabling doze mode on my phone. Not sure why it was ignoring the run in foreground and the disabling of battery optimization. But now I seem to have a whole new issue.

While away from home, my depart task is running on a continuous loop every 5s.

If you are on Android 8.1 or newer, the latest beta of Tasker and SharpTools provides a new service integration which improves reliability when Doze mode or App Standby is enabled. You can find more details in the following thread:

(If you’re on Android 6.x - 7.x, there’s an option to enable a foreground service in SharpTools as well which should help. And for all 6.x and newer SharpTools/Tasker users, SharpTools will now prompt you to whitelist SharpTools from Doze mode)

Thanks. Just updated to the sharptools beta and enabled foreground service.

My issue with the depart task every 5s was because the task was failing. Restarting sharptools solved it. So hopefully the beta solves the need for that.

Thanks

1 Like

Glad to hear it helped! :smiley: There’s also improved logging in this release with a color coded log viewer built into the app which makes it easier to review what’s happening and detect unexpected issues.

Can someone tell me why I am getting a constant “result:success!” message? Also my ST activity log shows about 45 Sharptools presence every minute

I have this setup on my Galaxy S7 and it’s working well. After trying it for a week or so I then added it to my wife’s S7. Unfortunately hers is having problems. I’ve gone through the setup instructions several times to be sure everything is setup correctly. I also put our phones side by side and gone through each input and setting. They all appear to match. I must be missing something but, I don’t know where to look.

Here’s the issue:

We frequently see the %YourName variable in Tasker showing a 1 or a 0 instead of present or not present. I have not pinned down which profile is triggering the 1 and 0 but it’s not all of them as we do see some present and not present indications as well.

Any ideas on where to look or how to debug would be greatly appreciated.

Well everyone, I updated my Pixel XL to Android Pie about a week ago. The new adaptive battery function took about 3 days to effectively kill Autolocation’s accuracy. I tried turning adaptive battery off, and Autolocation came back to life but my battery is in the crapper, it dropped 70% in 5 hours with light usage. So I’m turning Adaptive Battery back on and pretty much giving up on this solution, tired of fighting Android updates. Probably going to go back to stock location updates and just deal with the 5 minute lag between when I get home and when the locations updates.

1 Like

Thanks for checking-in, Chris. This is still working great for me. With each Android update, I have concerns; but so far (Oreo on a Samsung S8 and a Sony X Compact) it’s working nearly perfectly.

Since my first Nexus One in 2010, I’ve rooted every phone. But other things are taking my time now (ST and Hubitat, to name two) so I’ve become less attentive to Android fun and games - more of a tool than a hobby, so I’m content to sit on Oreo until I have to upgrade.

Thanks for creating this. If nothing else, it motivated me to learn Tasker.

2 Likes

You gave me an idea and dug deeper and found something. Go to Settings-Apps-Menu (3 dots)-show system apps and select Android system-Battery-Optimize battery usage. There you’ll find that location services is optimized, so flip that switch to Off. I just did it myself, but can’t check it until tomorrow.
It’s the only way and place that you can find it. Let us know. I’ll do the same.

Edit: This is Samsung S8+, yours should be similar.

I installed this app last week and for the most part it works well. What I found is that after a reboot, “Near Home” works as it should - I get to my boundary and it comes on. But after a few hours, it no longer works until I get inside my “Home” boundary - then it comes on and changes to “Near Home” and “Home” at the same time. If I do another reboot it’ll work again.

I just read that last post about turning off battery optimization for Location Services and have made that change. We’ll se what it does this afternoon.

On my S9 this appears to have made the “stock” presence sensor for my phone start working again!!! Thanks!
My WebCore presence sensor for my phone wont update unless I constantly kill the WebCore app and reopen it, even with battery optimization turned off for the WebCore app. Sucks because that one worked great!

Thanks for this. On my phone it was under Settings → Apps → Advanced (at the bottom) → Special App Access → Battery Optimization. Had to change the filter from Not Optimized to All Apps, then found “Fused Location” was being optimized. Changed that to Not Optimized, will see how it does now.

Webcore sensor doesn’t work for me either. I dug deep down in every possible place. I gave up on it.
After mentioned changes however standard phone presence sensor works much better.

One other thing I realized today is that the new Android adaptive battery delays notifications for apps too. So there’s another layer to it…when the “someone is home” notification comes in late, is it because the presence update was delayed, or was it just the notification that was delayed? Easy to tell by comparing notification time stamp to presence history, but it’s a manual comparison. Frustrating to say the least. I don’t have the time I used to have to dig into all this, between work and having a 5 year old who’s getting into different activities (and spending one day every weekend at the lake :sunglasses:) there’s not a lot of time to tinker any more.

As far as the optimization of Fused Location with the stock presence…I have 2 arrivals so far with it not optimized, and both have been delayed by several minutes, even after I connect to WiFi at home. So far it doesn’t seem to have helped much. I re-enabled all my Tasker profiles to see if it helps that at all, will keep you guys updated.

1 Like

Has anyone been able to come up with a work around for this issue? It’s weird because it worked for me a a couple times then it just stopped. Hopefully you guys that are much smarter than me can figure it out. When it did work it was great!

I think I’ve got this working well on two phones both are Pixel 2 running Pie. Like all of the suggestions before I turned off Battery Saver and the Adaptive Battery in in Battery section of Settings.

I also turned off battery optimization for Smatthings, tasker, sharp tools and autolocate

I also turned off battery optimizations for Fused Location AND Presence. I just found the Presence system app. Not sure if anyone saw that one.

So far it’s working as good as Oreo (Android 8.0+) Fast, no delays

1 Like

Both my phones are on Oreo and I don’t see Fused Location or Presence. Am I not looking in the right place? Or, more likely, are these new to Pie?

I hadn’t noticed the Presence system app before, will give that a try. Thanks for the tip. I have been using stock presence again recently, and it’s (still) terrible. I’d love to get this solution working well again.

This solution did work well for me when I completely disabled adaptive battery. Problem is that my battery life was terrible that way, to the point where it wasn’t worth it. I’ll be interested to see your experience.

I don’t recall seeing them in Oreo, so I’m assuming they are new to Pie. If you are showing your system apps in the app settings section and they aren’t there, they must be new.

Looks like adaptive battery is still keeping something from running. Just got home and none of my geofences activated until my phone connected to my WiFi.