So here’s a link to how to use tasker and a presence sensor. Now this was before the shut down of groovy and the sharptools app. This will help you get the Tasker part of the problem at hand setup.
[HOW TO] SmartThings Presence reporting using Tasker/SharpTools/AutoLocation
Next you will need to use the SmartThings API to interact with your presence sensor. Since you can’t make one in the IDE as the write up above states. You will need to use the vEdge drive to make a vEdge presence sensor.
[ST Edge] vEdge Creator: a virtual device generator for end users
Finally you will need to use the SmartThings Rest API to toggle you new vEdge presence sensor on/off(present/not present). Here’s a link to a thread about using the API and tasker.
SmartThings Rest API using Tasker
Additional help.
Here’s a thread doing this exact thing.
Tasker used to update Smartthings Virtual Presence sensor