It thought I would share my solution using @joshua_lyon’s SharpTools to SmartThings presence issues. I started out with the example on his site, but continued to have some issues. Eventually I found the heart of the matter: when arriving or departing from home my phone was often in the process of handing off between 4G and WiFi while the task was being triggered. This would cause calls to timeout and silently fail. I played with setting timeouts, but continued to have issues.
My solution was to add retry logic to my Tasker task. I try up to 10 times to update my presence, and if after that I still fail, I leave a notification indicating that it gave up. This screenshot shows most of the task:
The only important things not shown here:
- The first notification should be “Permanent” – this means it can’t be dismissed by the user (we dismiss it programmatically at the end of the task). This notification just tells you when the task is running.
- For the two SharpTools actions, make sure to check “Continue Task After Error” – we are handling errors, so we don’t want to exit upon encountering one. You can also play with the timeout values in here.
- The value of 10 in the GOTO is what controls how many iterations to attempt.
I have a Depart task thats pretty much identical, I just look for not present instead of present.