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

Yeah this is exactly why I have two separate conditions that have to be met in order to open the garage when I get home…It will only open if I am just arriving home and if my car’s Bluetooth is connected to my phone.

1 Like

Is this the one you outlined in post 64. Figure I might give that a shot. I still have the original setup.

Yep. I didn’t get a chance to re-do the whole write-up this weekend. Hopefully soon.

Any chance you can help me with this close garage door script? It works great. So fast too. Just I had to set a time range so it wouldn’t close it when I come home as the wife had it open. Happened once. I’m thinking there might be better triggers.

Profile: Close Garage (2)
Notification: no
State: Wifi Connected [ SSID:mywifi/mywifi5g MAC:2c:40:00:40:fa:7b IP:* ]
State: BT Connected [ Name:Chevrolet MyLink Address:28:A1:83:80:4F:C7 ]
Time: From 6:25AM Till 7:25AM
Enter: Anon (15)
A1: HTTP Get [ Server:Port:https://graph-/smartapps/installations/execute/closegaragedoor Path: Attributes: Cookies: User Agent: Timeout:10 Mime Type: Output File: Trust Any Certificate:Off ]

What are you trying to do in plain English?

When I start my truck when I leave it closes the garage door. It works great now but only during that time frame :sleepy:

If you end up doing the setup from post 64 I would add a couple minute-ish delay before the %Home variable gets set in the Home - step 4 section. The add a restriction to your garage door close profile where it only sends the command when %Home = true. This will keep the Close command from happening when you first get home (assuming I understood your need correctly).

1 Like

I have posted this in the original thread about the retry, but it’s been a few days with no reply so it may not be watched anymore. I’ll be honest, I’ve read through every one of the posts and cannot understand how to put the loop/retry logic into the right tasks or places. Can someone lay this out? Step by step. With screen shots would be awesome, but I understand I’m asking a lot already. The original solution worked perfectly for a few days, but has started to drop off and have a few misses where it’s not updating properly. Seems to be when I leave rather than when I’m coming home so I’m hoping putting in the retry will help with that. I’ve extended my geofences as far out as I think should be required. My inner is at 350 and outer is 2K. I’m not sure I want to go further than that unless someone thinks that would be a better solution.

I got a system update to take my phone from Android Marshmallow to Nougat a few days ago. This method has been hit or miss since then. Seems as though the Tasker profiles are activating and deactivating correctly but the actions either aren’t firing or the SharpTools commands are only making it through to SmartThings about half the time. Haven’t had a chance to troubleshoot yet.

@joshua_lyon what’s the best way to log events in SharpTools to see where the breakdown is happening?

Here’s my retry logic. Thus is for the entry task of the “Home” profile - i.e. the task that actually tells SharpToools to set the simulated presence sensor to “present”. Basically, it sets presence, then checks for the presence status; if it doesn’t come back “present” then it loops the specified number of times (e.g. 6) before giving up and giving a notice of failure.

The first action is something I added to prevent the task from running until the system had booted for 120 seconds (%UPS > 120) to avoid a timing problem. It’s not essential.

The same logic is replicated in my exit task, but obviously for “not present”.

P.S. If you’re running v3.0R2 of Sharp Tools, particularly if you have a large number of devices, then I recommend you upgrade to the latest v3.0. It helped me with some timing problems.

1 Like

Chris- Take a look at the autoapps forum:

http://forum.joaoapps.com/index.php?threads/autolocation-geofence-flapping-in-out-after-android-7-0-upgrade.13737/

The poster has geofence problems after upgrading to Nougat. He doesn’t have a definitive solution, but dine ideas. At least you might find someone to commiserate with.

1 Like

I rebuilt the actions that I had around Departing and Arriving and it seemed to help a little bit (arrival and departure actions fired better but were delayed a little bit), so I just rebuilt all of the actions for all of the profiles. Maybe something got messed up in the upgrade. Will report back after a few cycles.

Thanks for the reply @CAL7! It did look like my SharpTools wasn’t up to date so I did update that. Unfortunately I’m a complete noob at Tasker so I still don’t understand how to enter the retry logic. I can’t find a screen that matches yours or determine where to enter information. I’m sorry!

If I’m understanding the question correctly, SharpTools has logging built into it natively. As you run various tasks, SharpTools logs certain events which you can see in the SharpTools settings by tapping the log / document icon in the action bar. You can email those logs to yourself by tapping the email icon in the action bar while viewing the logs then just change the To address on the email. You can also view these logs on your computer as they are just a text file. And if you open the file with Notepad++ you can change the language to AndroidLogger which will color code the events based on their verbosity (warning, error, info).

1 Like

This is true, but only applied to people who were on the beta releases. 3.0 is rolling out to the production channel now and includes multi location support (staged rollout).

Thanks for the info.

Since I rebuilt the Tasker actions everything seems to be running as expected, not sure what caused the hiccup but it was a simple solution.

1 Like

@destructure00, @joshua_lyon

Hi there,

I recently purchased SharpTools with Tasker integration for both my wife and I in the hope of improving ST mobile presence accuracy.

I followed the steps outlined by Chris in his original post - I haven’t yet implemented the 3-geofence method mentioned in post 64.

I’ve been running into an issue where it seems that the virtual presence sensors are not being set as expected. I’m not quite sure where the issue is.

The profiles themselves seem to fire correctly (all 4 profiles show green in Tasker when at home and connected to WiFi).

SharpTools seems to set ‘arrived’ OK, when I activate Tasker (as opposed to Tasker being disabled).

But after the initial trigger the state of the virtual sensor never changes, unless I manually ‘Play’ the exit task for the Home profile. And again, after it is Away, the virtual sensor doesn’t return on its own.

What is odd is that if I manually disable the whole of Taker (so the gear is greyed out), SharpTools sets the virtual presence sensor to away - so I know SharpTools is capable of manipulating the virtual sensors, and that at some level it is tied into the Taker profiles I’ve created.

I’ve included the descriptions of my Tasker profiles from my phone below, and would definitely appreciate any thoughts or suggestions you might have. The profiles on my wife’s phone are almost identical except that they are setup to toggle her virtual presence sensor instead of mine.

Profile: Near Home (2)
Restore: no Notification: no
State: AutoLocation Geofences [ Configuration:Geofence Name: Home - Outer
Status: Inside ]
Enter: Anon (3)
A1: AutoLocation Location [ Configuration:Starting Location Monitor
Interval: 3 seconds
Update Type: High Accuracy Timeout (Seconds):60 ]

Exit: Anon (4)
A1: AutoLocation Location [ Configuration:Stopping Location Monitor
Update Type: No Power Timeout (Seconds):60 ]

Profile: Home-WiFi (5)
Notification: no
State: Wifi Connected [ SSID:TheHawksNest5G/TheHawksNest MAC:* IP:* ]
Enter: Anon (6)
A1: AutoLocation Location [ Configuration:Stopping Location Monitor
Update Type: No Power Timeout (Seconds):60 ]

Exit: Anon (7)
A1: AutoLocation Location [ Configuration:Starting Location Monitor
Interval: 3 seconds
Update Type: High Accuracy Timeout (Seconds):60 ]

Profile: Home-Location (8)
Restore: no Notification: no
State: AutoLocation Geofences [ Configuration:Geofence Name: Home - Inner
Status: Inside ]
Enter: Anon (9)
A1: Wait [ MS:10 Seconds:0 Minutes:0 Hours:0 Days:0 ]

Profile: Home (10)
State: Variable Value [ %PACTIVE ~ Home-WiFi/Home-Location ]
Enter: Anon (11)
A1: A Thing [ Configuration:Thing: Adam
Command: arrived Timeout (Seconds):0 ]

Exit: Anon (12)
A1: A Thing [ Configuration:Thing: Adam
Command: departed Timeout (Seconds):0 ]

Please let me know if I can post any more info that would be helpful. I’d really like to see this work, but so far, it’s been frustrating.

Just spitballing here, but did you set all the Autolocation advanced settings per Chris’s OP item #4?

@CAL7, thanks for the reply. I did set the AutoLocation advanced settings as outlined in the first post. I just double checked them now to make sure that nothing had changed.

Am I understanding correctly that you can manually control the virtual presence from the main SharpTools app as well as by manually running the Tasker tasks? And the profiles seem to be triggering correctly, but the SharpTools actions in those Tasks fail? Have you tried adding some debug actions to the profiles (eg. Notify/Flash)?

Is it possible that this is a network related issue? Sometimes when devices are transitioning between wifi and cellular, the network activities will start to fail. This is where having retry logic like @hellfire51 describes in the following post can be helpful:

SharpTools Presence

1 Like