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

Good tip. We found the same thing with my wife’s phone last week, we were almost at our data limit for the month so she turned data saver on and her presence reporting essentially stopped working. Arrived and Departed commands were delayed by probably 3-4 hours. Turned data saver off and back to normal again.

I had this working great but had to factory reset. I set everything up but my presense isnt being updated. What is the best way to troubleshoot?

Just to be sure I’m reading this right, you’re setting yourself as arrived if either you cross your inner boundary or you connect to your home WiFi, correct?

Enable and check the Tasker logs to see if the task is running, then check the Sharptools logs to see if it’s working too. Included some samples below, they are from different events so timestamps won’t match up but gives you an idea of what to look for.

Tasker logs showing arrival task executing:

Sharptools log snip:

Correct

1 Like

@destructure00 Chris - two quick questions.

Still going strong on Oreo? I’ve held off upgrading until João upgrades Autolocation to use a foreground service, which he said he would do.

In setting this up for my wife’s new phone, I noticed that your May update dropped the idea of adjusting the Wi-Fi Scan period (as I recall, the original used 25/120 when in/out of the area). Just checking to make sure that was intentional on your part and not an oversight.

Still loving it! Thanks.

Nope if you look back to post 227, I got an update along the way that killed GPS again. Been limping along with my Wifi connection triggering me to arrive, which usually happens as I’m getting out of my car in the garage or walking to the door. Occasionally I have to wait at the door a few seconds for it to unlock. Frustrating. Looking forward to the update from Joao, whenever that comes.

I believe I was adjusting the Wifi scan period when I was counting on a wifi connection to be the primary trigger for arriving at home. With AutoLocation and pinging GPS every 3 seconds, I don’t see it as necessary and have not adjusted the settings the last few times I set everything up.

Gutted :frowning:
At first I thought this is what I could use for my problem.
My 2 son’s always run out of data on their phones so the presence doesn’t change.
So I wanted to set their presence on whether they are connected to the WiFi.
But this is just to set up on the person’s phone isn’t it?
They won’t let me install tasker and other apps on their phones :frowning:
So I’ve got tasker set for http get on my routers status page for devices connected and set to save to a txt file so I can check if their Mac address is connected.
And tasker is doing that but I can’t get any further.
Do you think your way would be able to achieve it some how?

Intrigued by the original post as using my phone as a presence sensor was not working well. Seems like a lot of hoops to jump thru but probably worth it if its a rock-solid solution … but, jumping to the end, looks like maybe the original solution no longer works? Can somebody give me the readers digest condensed version? :smiley:

Do I need to initialize the %PACTIVE variable? Didn’t see that anywhere. Just finished setting up the 6 profiles, and it seems to be good so far since my Near Home, Home Wifi Connected, and Home profiles are active right now. Will see tomorrow if it works with smartthings.

I modified my 2nd profile to say “NEAR wifi” instead of “connected to wifi” because I have 2 networks, and my phone is able to connect to either one.

@Steveuk23 I dont see why that couldn’t work. The difficulty is what to use as the trigger in tasker. Assuming your router can’t send notifications when something connects to it, then you’d probably stuck with something like “every 1 minute, get the connected devices list (http get), read the file into a variable, then search the variable for the MAC address.” That would probably be battery intensive, though. Do you have an old phone you could install Tasker on, and leave it plugged in?

You may be able to do something similar to that with IFTTT or Stringify, but since those are cloud services, you’d probably have to open up some ports in your router, so they could see the connected devices list. I can’t help with that one.

I noticed there’s an existing IFTTT profile for OnHub routers (made by Google) that can send you a notification when a specific device is connected to it. Then its just a matter of setting up a Tasker profile to look for that notification.

You might be able to bypass Tasker completely for your sons by setting up an IFTTT profile like this: IF a specific device connects to the OnHub router, THEN switch the smartthings virtual switch called “son1 is home” to ON.

Thanks @Brian_Renstrom got it working now :slight_smile:
I have a android tablet running all the time with Action tiles so have installed tasker alongside it.
I was trying to get it to read the newly created text file instead of the variable.
But it’s set to read the variable and is changing the virtual presence sensor great now :slight_smile:
I’ve set it for every 5 mins though as I’m not too fussed about instant changes
Cheers

No, %PACTIVE is a system variable. It’s a comma separated list of active profiles.

You don’t need to do near either, you can specify multiple wifi connections by separating with a “/”. I have two also, and just have it set like SSID1/SSID2

@destructure00 Don’t know if you’re following the Oreo Autolocation forum, but João posted a test version:

1 Like

OOOH did not see that, downloading now so it will run when I get home from work in a couple hours. Thanks for the link…will report back :slight_smile:

2 Likes

Looks promising. I just manually ran my “Near Home” tasks and I got the old GPS icon in the task bar that I used to get when it was actually pinging GPS. Will update again when I get home and the task runs by itself.

2 Likes

So far so good. Worked perfectly when I got home tonight. Toggled wifi on and off a few times to activate different profiles and it worked as desired too. Will report back again after a couple days.

2 Likes

I’m glad this is working for some people. It’s been a complete fail for me and I never got any help here when I posted about it. Right now it still says I’m present while I sit at my desk 30 miles from home.

Thankfully, either having this stuff run has helped the regular smartthings processing or they fixed it because my normal phone presence has been rock solid for a while now.

Is anyone even still actually having the original issue?

The updated Autolocation app has been working great, functionality is restored in Oreo. Yay!

1 Like

Yup, it’s been working for me as well the past few days. I did have some odd issues where Tasker & AutoLocation knew that I was away but it either never sent the “not present” command to SharpTools or SharpTools never received it/passed it on. Originally I thought it was a problem with the new AutoLocation, but when I checked the app, it showed the geofences as properly being outside, and Tasker itself showed my Away profile active. I think it might have just been a hiccup (fingers crossed). I also made sure that all three apps were added to the “do not optimize” list. Will post updates as needed, but so far it seems that AutoLocation on Oreo w/ that beta APK is working well.

1 Like

Initial setup is tedious and needs to be exact since there are so many apps that need to work together for this method (Tasker, Autolocation, Sharptools, SmartThings, Android system settings, etc). I probably had 8-10 hours of time just into writing the instructions above, much more into creating/tweaking/testing the logic and interaction between the apps. When done correctly, it works extremely well (except for the background location hiccup in Oreo, which it looks like is finally fixed). Troubleshooting is hard to do over the internet and is time consuming, each link in the chain needs to be tested separately to isolate where the problem is, which is difficult to talk through in a forum. Something in your setup isn’t right, but without doing some logging and troubleshooting yourself it’s going to be difficult for anyone to help with the basic information you gave. Sorry it didn’t work for you, hopefully the stock geofencing in the ST app will meet your needs.

1 Like