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

You can import and export Tasker profiles but you would have to make sure your Autolocation boundary names matched and change the wifi profile to match your wifi SSID.

Did anyones Autolocation start going crazy this morning aprox 1:45 am MST ?
It was going in and out of the boundaries every few minutes
I did a hard reboot of my phone and it appears to be back working.
as a precaution incase it ever happens again
added a entry task variable to departed profile to perform task only if PACTIVE does not match wifi (basically if wifi is connected not to set to departed (or away whichever you called it).
I did have it set like this in the departed state variable but it didn’t work for some reason

On a separate note I also run SmartThings default presence sensor and it has gotten much better after the last few updates than originally.
tuned it to almost exactly match SharpTools virtual presence.
I just had to adjust the hub location (a street over) and radius in the SmartThings app settings so that it would activate when I wanted it to. Took some playing around with SmartThings location. Not perfect but I never go over in that other direction.

It looks like Sharptools sends the Arrive command and my presence gets updated in Smartthings promptly. The problem seems to be somewhere around the “Robert Variable Set” profile where Sharptools’ Thing State doesn’t see the attribute change. The Tasker variable doesn’t get updated so the Arrive command gets called repeatedly.

I’m attaching a screenshot of the Smartthings Event List for my virtual presence that shows this. The virtual presence was changed to “present” right away but there were about 100 calls to the Arrive task before the variable finally got updated on my phone.

I basically quit trying to use this. It’s become all but useless to me. The timing isn’t that great - usually delayed by a few minutes compared to the actual and, as my previous note, when it does work, it just has hundreds of messages. Currently, I’m sitting at work, 30 miles from home and my virtual presence still thinks I’m home.

Seems like none of the components work right for me. Currently when I check the geofences in autolocation, it says I’m inside all of them.

@destructure00, thanks very much for the detailed instructions. I have followed the instructions and setup everything as per the instructions when I was at work. My presence changed to present when I got home correctly. But I see a Result: Success message on my screen which doesn’t go away after setting this up as below.

I have now disabled all the tasker profiles but this message still stays. Can you please help me get rid of the message?

I think I understand the problem now. Sharptools is continuously triggering present to smartthings.

The st_attr_value is never set to present. So tasker thinks I am not present and continuously triggers the presence to change. @joshua_lyon can you please help?

Sounds similar to the problem just a few posts up:

I would read through those posts and verify that the variables are all getting set properly and work your way back through the profile from there - proper subscriptions are in place, events are getting sent as expected, profile is configured correctly (easy to make a small typo with all the steps!)

Thanks very much for your response. I was able to resolve this last night. There is a typo in the instruction in the OP which says “%st_attr_valueTap” instead of “%st_attr_value Tap”. So I named the variable wrong. When I realised it, I changed the variable to “%st_attr_value” but the issue wasn’t resolved. It was only resolved when I left home and came back.

I have found one more issue now. I left home yesterday and when I came back, the “Presence” was only triggered when I got connected to WiFi. AutoLocation completely failed to recognise that I was near home and then home. Both my life 360 and Smartthing android presence reported that I am home, but not AutoLocation.

I opened auto location and checked geofences, it was reporting that I was outside. When I opened them and saved them again, magically it was reporting I am back home.

I see Activity Monitor, Geofence Monitor and Location Monitor in the autolocation app. Do I need to keep any of them always started for it to work? Currently I have Geonfence monitor started and rest are stopped.

1 Like

I’d say go over your settings rather than the monitors. I see the same things enabled as you, but I have “Force Location to help Geofences” enabled in the advanced settings. I also have “Retrieve First Location” enabled in the location monitor.

With that said, this whole setup generally works relatively well for me, but I still get the rare hiccup. Just this morning I kept getting the Tasker “unexpected error” toast and the variable was set as “present” – and ST thought I was home, even though I wasn’t. Once I rebooted everything got sorted out… my guess is that there was some kind of issue last night (I see ST reporting that SharpTools sent “arrived” 10 times around 9:30pm), and never sent the “departed” command this morning when I left, even though the “Away” task was active.

I would say that there could be some additional resiliency built around this, maybe by checking the variable every hour or something and alerting if it’s set to “present” but the “Away” task is active.

1 Like

Thanks very much for the detailed response. I have checked my settings now and see “Force Location to help Geofences” is enabled as per the instructions in the OP. I have now enabled “Retrieved First Location” as per your recommendation. I will give this a try.

I have also now updated the settings in the “Near Home” and “Home WiFi Connected” profiles to make sure “Retrieve First Location” is checked.

1 Like

Yeah the whole setup is fragile, with having to use AutoLocation -> Tasker -> SharpTools -> SmartThings and back again, just as a workaround to an issue that SmartThings themselves should have solved by having reliable presence detection.

But hey when it works, it works great… now if we could only get it to work 100% of the time… :slight_smile:

2 Likes

@destructure00 could you update the original post to clean up this typo? Step 14d

1 Like

Hi guys, I have been using this setup for a few days now. Most of the time it seems to be working fine. I have noticed that Sharptools keep sending arrived commands to smartthings continuously throught the day. Roughly about once or twice an hour. This only happens when I am home and not when I am away.

I checked the settings and see the variable %[Name] is set correctly to present when I am home. Is this the expected behaviour or is there something wrong with my settings?

Done, sorry about that.

1 Like

It should not be sending arrived commands continuously, only when you first arrive home. It may send several in a brief period between when it first detects that you are home and when the variable updates, but no more after that.

It was rock solid for me until I took the Android Oreo update. Google restricted background app access to their Fused Location Provider API in Oreo, which means that AutoLocation can only ping GPS for high resolution updates if it’s running in the foreground. I messaged the AutoLocation developer about this to see if he could work around it and have not gotten a response to either my original query or follow-up. This method may become obsolete for this reason as more and more people upgrade to Android Oreo.

@sapstar are you upgraded to Oreo? If so, this may be the problem you are seeing.

I have enabled logging and see that my WiFi seems to be dropping and reconnecting always.

I have added a if condition as below in the Arrive [your name] task under home WiFi connected.

If %[your name] eq not present

Hoping this will fix the issue.

2 Likes

I have not upgraded to Oreo. For me it works fine most of the time, but ocassionally I see it looping and not setting the variable when I am marked away. I have noticed this when I went to the postoffice or a shop near by which is in between my Departure boundary and location service boundary. If I actually leave home and go out of my outer boundary and come back in, i see it works perfectly.

I have also made the setup on my Wife’s phone. I was able to export the geofenses and a backup from Tasker and import into my Wife’s phone (I manually edited the XML backup from tasker and did a find and replace of my name with my wife’s name). I had to change one setting in tasker manually after import to change SmartTools presence sensor to “Departed”. Other than this all other settings were copied properly.

1 Like

Hi Chris, I’m trying to set this up device shit down, when I get to variable set> name> I enter % Rebooting to true> if>%PACTIVE~,Near Home, when I try to go back I get a “Error:%Rebooting to true:must be a variable or array name” please what am I doing wrong.

Laurence

Make sure it looks exactly like this

I just swapped my phone for a Pixel 2 XL with 8.1 and this setup still appears to work fine.

2 Likes