SharpTools Presence

Thanks!

I’ve set it up like yours except for the geofence, I’ll use wifi coverage instead… since I live in an apartment block it’ll be more precise…

I’ll give it a try in the coming days and report back, but it sure looks promising!

Ok! This is weird!

At first my sensor said ‘Daniel is present’ which is what it should say, but now it says ‘Daniel is 1’… what the?

Ideas?

Ok, now I’m out of the house and the device reads ‘Daniel is 0’ and there’s a persistent notice poping up that reads ‘result: Success!’ Which is driving me nuts!

If you are seeing a persistent “toast” message showing up saying “Result: Success!”, then I would double check your Tasker configuration as it sounds like it might be constantly firing. If it really is constantly firing, it could quickly eat up your battery and data.

If the profile is stuck looping, you’ll want to disable the Tasker profile and if the message won’t go away, you’ll want to restart your phone (after disabling the profile). Once you’ve stopped the constant pinging, I would double check the loop logic to make sure everything is working as expected.

Maybe post an updated description export along with a screenshot of the Task Edit (profile actions overview) and we can take a look?

1 Like

Here are the description and xml…

Hope you can also see the ‘Daniel is 0’ ‘Daniel is 1’ there too!

Xml version:

1454092428859 true 1454260358815 4 5 2 ST Presence Daniel ST Presence 170 Sojuelix 5c:35:3b:97:c5:4a 1454155617245 1454260213435 2 Exit Home 100 523 Updating Presence 547 %attempts 0 888 LoopStart %attempts 3100 com.boshdirect.stwidgets:drawable/ic_thing java.lang.String Intent { act=android.intent.action.MAIN flg=0x40000000 cmp=com.boshdirect.stwidgets/.ToggleThingActivity (has extras) } java.lang.String Daniel java.lang.String <StringArray sr=""/> [Ljava.lang.String; <StringArray sr=""/> [Ljava.lang.String; Thing: Daniel Command: departed java.lang.String departed java.lang.String false java.lang.Boolean false java.lang.Boolean arguments java.lang.String true java.lang.Boolean 667fa0a9-0813-4d3f-b81e-97bf63456a0e java.lang.String com.boshdirect.stwidgets A Thing 19557 <StringArray sr=""><_array_attributes0>presence</_array_attributes0></StringArray> [Ljava.lang.String; Thing: Daniel Attribute: presence

The following variables are set when triggered:
%st_attr_name
%st_attr_value
%st_thing_id
%st_thing_name</com.twofortyfouram.locale.intent.extra.BLURB>
<com.twofortyfouram.locale.intent.extra.BLURB-type>java.lang.String</com.twofortyfouram.locale.intent.extra.BLURB-type>
<fire_action>1</fire_action>
<fire_action-type>java.lang.Integer</fire_action-type>
false
java.lang.Boolean
<net.dinglisch.android.tasker.subbundled>true</net.dinglisch.android.tasker.subbundled>
<net.dinglisch.android.tasker.subbundled-type>java.lang.Boolean</net.dinglisch.android.tasker.subbundled-type>
667fa0a9-0813-4d3f-b81e-97bf63456a0e
java.lang.String


com.boshdirect.stwidgets
Thing: Get Attribute



135


LoopStart

And

%st_attr_value
3
not present


%attempts
6
10




779
Updating Presence



523
Left Home
It took %attempts/10 to update presence






523
Failed To Update Presence







%st_attr_value
3
not present





1454092432690
1454260350733
5
Enter Home
100

523
Updating Presence







547
%attempts
0




888
LoopStart
%attempts




3100


<android.intent.extra.shortcut.ICON_RESOURCE>com.boshdirect.stwidgets:drawable/ic_thing</android.intent.extra.shortcut.ICON_RESOURCE>
<android.intent.extra.shortcut.ICON_RESOURCE-type>java.lang.String</android.intent.extra.shortcut.ICON_RESOURCE-type>
<android.intent.extra.shortcut.INTENT>Intent { act=android.intent.action.MAIN flg=0x40000000 cmp=com.boshdirect.stwidgets/.ToggleThingActivity (has extras) }</android.intent.extra.shortcut.INTENT>
<android.intent.extra.shortcut.INTENT-type>java.lang.String</android.intent.extra.shortcut.INTENT-type>
<android.intent.extra.shortcut.NAME>Daniel</android.intent.extra.shortcut.NAME>
<android.intent.extra.shortcut.NAME-type>java.lang.String</android.intent.extra.shortcut.NAME-type>
<arg_types><StringArray sr=“”/></arg_types>
<arg_types-type>[Ljava.lang.String;</arg_types-type>
<StringArray sr=“”/>
[Ljava.lang.String;
<com.twofortyfouram.locale.intent.extra.BLURB>Thing: Daniel
Command: arrived</com.twofortyfouram.locale.intent.extra.BLURB>
<com.twofortyfouram.locale.intent.extra.BLURB-type>java.lang.String</com.twofortyfouram.locale.intent.extra.BLURB-type>
arrived
java.lang.String
false
java.lang.Boolean
false
java.lang.Boolean
<net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS>arguments</net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS>
<net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS-type>java.lang.String</net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS-type>
<net.dinglisch.android.tasker.subbundled>true</net.dinglisch.android.tasker.subbundled>
<net.dinglisch.android.tasker.subbundled-type>java.lang.Boolean</net.dinglisch.android.tasker.subbundled-type>
667fa0a9-0813-4d3f-b81e-97bf63456a0e
java.lang.String


com.boshdirect.stwidgets
A Thing



19557


<StringArray sr=“”><_array_attributes0>presence</_array_attributes0></StringArray>
[Ljava.lang.String;
<com.twofortyfouram.locale.intent.extra.BLURB>Thing: Daniel
Attribute: presence

The following variables are set when triggered:
%st_attr_name
%st_attr_value
%st_thing_id
%st_thing_name</com.twofortyfouram.locale.intent.extra.BLURB>
<com.twofortyfouram.locale.intent.extra.BLURB-type>java.lang.String</com.twofortyfouram.locale.intent.extra.BLURB-type>
<fire_action>1</fire_action>
<fire_action-type>java.lang.Integer</fire_action-type>
false
java.lang.Boolean
<net.dinglisch.android.tasker.subbundled>true</net.dinglisch.android.tasker.subbundled>
<net.dinglisch.android.tasker.subbundled-type>java.lang.Boolean</net.dinglisch.android.tasker.subbundled-type>
667fa0a9-0813-4d3f-b81e-97bf63456a0e
java.lang.String


com.boshdirect.stwidgets
Thing: Get Attribute



135


LoopStart

And

%st_attr_value
3
present


%attempts
2
10




779
Updating Presence



523
Arrived Home
It took %attempts/10 to update presence






523
Failed To Update Presence







%st_attr_value
3
present




Description version:

Profile: ST Presence Daniel (4)
State: Wifi Near [ SSID:Sojuelix MAC:5c:35:3b:97:c5:4a Capabilities:* Min. Activate Signal Level:0 Channel:0 Toggle Wifi:On ]
Enter: Enter Home (5)
A1: Notify [ Title:Updating Presence Text: Icon:null Number:0 Permanent:On Priority:3 ]
A2: Variable Set [ Name:%attempts To:0 Do Maths:Off Append:Off ]

A3: Variable Add [ Name:%attempts Value:1 Wrap Around:0 ]
A4: A Thing [ Configuration:Thing: Daniel
Command: arrived Package:com.boshdirect.stwidgets Name:A Thing Timeout (Seconds):0 ]
A5: Thing: Get Attribute [ Configuration:Thing: Daniel
Attribute: presence

The following variables are set when triggered:
%st_attr_name
%st_attr_value
%st_thing_id
%st_thing_name Package:com.boshdirect.stwidgets Name:Thing: Get Attribute Timeout (Seconds):15 ]
A6: Goto [ Type:Action Label Number:1 Label:LoopStart ] If [ %st_attr_value !~ present & %attempts ~ 10 ]
A7: Notify Cancel [ Title:Updating Presence Warn Not Exist:Off ]
A8: Notify [ Title:Arrived Home Text:It took %attempts/10 to update presence Icon:null Number:0 Permanent:Off Priority:3 ]
A9: Notify [ Title:Failed To Update Presence Text: Icon:null Number:0 Permanent:Off Priority:3 ] If [ %st_attr_value !~ present ]

Exit: Exit Home (2)
A1: Notify [ Title:Updating Presence Text: Icon:null Number:0 Permanent:On Priority:3 ]
A2: Variable Set [ Name:%attempts To:0 Do Maths:Off Append:Off ]

A3: Variable Add [ Name:%attempts Value:1 Wrap Around:0 ]
A4: A Thing [ Configuration:Thing: Daniel
Command: departed Package:com.boshdirect.stwidgets Name:A Thing Timeout (Seconds):0 ]
A5: Thing: Get Attribute [ Configuration:Thing: Daniel
Attribute: presence

The following variables are set when triggered:
%st_attr_name
%st_attr_value
%st_thing_id
%st_thing_name Package:com.boshdirect.stwidgets Name:Thing: Get Attribute Timeout (Seconds):15 ]
A6: Goto [ Type:Action Label Number:1 Label:LoopStart ] If [ %st_attr_value !~ not present & %attempts < 10 ]
A7: Notify Cancel [ Title:Updating Presence Warn Not Exist:Off ]
A8: Notify [ Title:Left Home Text:It took %attempts/10 to update presence Icon:null Number:0 Permanent:Off Priority:3 ]
A9: Notify [ Title:Failed To Update Presence Text: Icon:null Number:0 Permanent:Off Priority:3 ] If [ %st_attr_value !~ not present ]

Forgot to include the task edit shots!

In step 6 of your enter task, you might want to set attempts to < instead of ~ (match).

In my exit task, I had to change the conditional logic to use present instead of not present or departed. So that would be in step 6 & 9.

Hey @kars85!

I changed those values… but I’m home already till tomorrow… I’ll check it out and report back… unless you know of a way to force it to automatically leave and return to the wifi zone? :smile:

Sorry for being MIA I was out of town. Anyway, I discovered something that somehow didn’t get captured in my screenshot and as such it doesn’t look like is in your profile:

Both steps 8 and 9 should be conditional (using opposite conditions). So for your “Enter Home” task you already have step 9 conditional (if %st_attr_value !~present) but your step 8 should also be conditional (if %st_attr_value ~ present). Basically you don’t want to create notifications claiming both success and failure.

I also followed @joshua_lyon’s suggestion of having a button to manually trigger if the automatic option failed. I used AutoNotification to create failure notifications with buttons. Each button required a corresponding profile. I got it all working and tried it out for about a week. I found that it just wasn’t that much benefit for all the additional complexity. With the task as-is, it will let me know if it fails and its really not hard to manually go into SmartThings app and toggle it myself when that occurs.

So I’m having a problem with the Exit Task in a WiFi Near Profile. It does not trigger when the WiFi range is lost. It does seem to trigger about 10 or so minutes later, which could be the fact that I’m usually arriving to work and hopping on their WiFi automatically. My guess is it could be the off screen update settings in Tasker but does anyone else have an issue or solution with this?

Here is the task I am running:
http://pastebin.com/w1A1xFsP

I sometime see a bit of a delay too. I think some of this is controlled via the Tasker polling settings, and some of it also might just be the result of Android power saving measures (which might be out of Tasker’s control).

Trying to figure out why I have been getting a error 401 with sharptools and tasker. Anyone see this before. I know I did get them if one of the apps was not up to date but I know that they are

There was an authentication issue but the dev is all over it:

1 Like

Still does not work

Maybe you guys can help me.

I was trying to create a task that when I plugged in my phone and it opened android auto that it would signal the “goodbye” routine so long as I was “present”

I’m having the hardest time with this.

The “Thing :Get Attribute” if %st_attr_value ~ present has a red box next to it like the code doesn’t work.

Thanks

Can you share an export of your Tasker profile (in Description format)?

I am a noob with this so I’m sorry if this seems dumb but here it is

Run Goodbye (6)
A1: Thing: Get Attribute [ Configuration:Thing: James Bell’s Android
Attribute: presence

The following variables are set when triggered:
%st_attr_name
%st_attr_value
%st_thing_id
%st_thing_name Timeout (Seconds):15 ]
A2: A Thing [ Configuration:Thing: Garage Door
Command: close Timeout (Seconds):0 ] If [ %st_attr_value ~ present ]

The “Thing :Get Attribute” if %st_attr_value ~ present has a red box next to it like the code doesn’t work.

Is it A1 or A2 that shows the red dot next to it?

Have you tried adjusting the timeout of A1 to 15 seconds? You might also consider enabling logs in Tasker and then try reproducing the error and sharing the logs. And if that doesn’t expose anything meaningful, you might want to check the SharpTools logs (Settings > View Logs (document icon)) or watch the SmartThings IDE Live Logs while you try to trigger the task.

It’s A2… if I change it to not matching instead of matching it lights up green like the code is good. I was thinking the word present was wrong but it looks right according to smart things web docs I found

Have you tried outputting the value from A1 in a notification or toast message? I would try adding a new step between A1 and A2 with something like Alert > Notification which includes the %st_attr_value as the content so you can see exactly what the current variable value is for debugging purposes.