[SOLVED] Erratic Android Presence Reporting (fix=Tasker/SharpTools integration)

I have two presence sensors, one for myself (my primary Android phone) and a simulated one for testing. During this melt-down period, they have both exhibited crazy things…

The testing one seems to have mostly stabilized now (i.e. I set it to AWAY, and it seems to be staying AWAY), but my Android phone keeps going away and coming back over and over and over, all day long.

So, since my phone is the only presence device that is being used by the system to know whether the MODE should be HOME or AWAY or whatever, I suspect that my MODEs have likely been continuously changing all day long as well, but I haven’t looked into that yet.

Also, multiple times, I have gone in and increased the radius for where my home is in the SmartThings Android mobile app. It’s so far out away from my house now that it’s useless. Holy crap! How freakin far out does it have to be?

If the radius needs to be bigger than it is now and that’s your answer, then my question becomes…
why can’t I just have a presence status for my phone which is in its holster on my belt and/or sitting on my desk at home that is correct and consistently so without having the system think I’m home when I’m miles away from my house? That’s just stupid….and dangerous.

How can I ever have ANYTHING related to security/perimeter or presence or arriving/leaving that actually works, and is safe for my family if we have to set our home location to a radius that is miles larger than our yard, let alone our house?

Thanks.

p.s. I also sent in a support request about this at the same time of creating this post, and I will update here from that when/if I get any relevant responses that aren’t also already in here.

1 Like

I have many of the same frustrations and I am pretty sure you will find lots of posts on these forums about the same thing. I have tried and tried to get presence working from my phone. I have had both an Android and IOS phone hooked up and neither will reliably signal my presence. I find that sometimes it will detect that I have entered a geo-fence within 20 or 30 seconds while other times it just never knows that i have entered or exited the zone.

I think this is partially due to the smartthings mobile app/hub and partially due to limitations of the phone operating system itself. I know on IOS I have to periodically launch the app to get it monitoring those geo fences. Also, if I have other apps on IOS that are actively monitoring my location it will work a little better. Android is similar to this but seems to do a better job of keeping the apps running in the background and receiving those events.

in my opinion, to really make presence sensors work reliably you need to use multliple triggers/sensors to determine presence. For example, if a motion sensor goes off inside your house and then you open the front door or garage door, chances are pretty good that you are leaving and should “consider” changing to away mode. But then to know for sure maybe a smart app can somehow ping your phone in a minute or two to get exact geo coordinates and see if you are outside the geo fence. Yep, probably too complicated but relying on a single sensor does not seem to tell the whole picture.

[quote=“joe64, post:2, topic:43163, full:true”]
…geo-fence…[/quote]

Sorry…didn’t read your whole post yet (will a bit later), but the term geo-fence stood out, and I wanted to post an add-on comment about this concept…

I have geofences set up for Tasker to keep track of and either notify me about things (you’re close to the grocery store. Here is your shopping list…", or to connect/disconnect from WiFi, or other things.

Well, those geofences, and my Tasker profiles have been firing successfully without fail…for years…and still are to this day.

However, SmartThings’ geofencing sucks as far as I can tell. There’s just no way that my phone’s GPS signal has been coming and going all day long while I’m at home. If it were, I’d be hearing about it from Tasker, but it’s silent unless my phone ACTUALLY enters or leaves a geofence.

I need to try Tasker out and see if will work better for me. Maybe I can just have it call into a smart app or device type to identify when i am coming or going. The smartthings app just does not get it done.

1 Like

Would we be talking about using the superior location sensing of Tasker to fire a IFTTT command to SHM or some such?

@BadAppleMan
In my case, since I already have the following path working…
SmartThings -to- SharpTools -to- Android -to- Tasker

…hopefully somebody can help us with getting it to go the other way…
Tasker-to-SOMETHING-to-SmartThings

(without needing something so unreliable as IFTTT, yet another cloud in the mix…just hate that our ST processing happens in the cloud…hate it even more to have to include another one in the mix).

I wonder if it’s already possible with SharpTools ( @joshua_lyon ) and I forgot or something. I’ve been working with the idea that it only sends stuff from SmartThings to Android, and not the other direction.

Is that what you are looking for?

2 Likes

@joshua_lyon
holy moly, yes! That’s exactly what we need. Geez, and that article was presented there over a year ago lol
Thanks, man. This is awesome!

Anybody else that is sick of their ST-based presence crap, even if you don’t have Tasker or SharpTools yet, get them. It is well worth it to be able to do stuff like this.

Sounds good. Thanks!

Every time I’ve tried to use Tasker, I’ve left in frustration - I just didn’t find it intuitive enough for my skill level. But, I’m going to try these step-by-step instructions to see if I can finally get a handle on it.

It’s also possible to export/import Tasker profiles, etc. So, among others that have already done this, perhaps somebody would be willing to share with you via PM or something. I would, but I just haven’t ‘gone there’ yet. :slight_smile:

1 Like

Hmmm. Sometimes, re-reading things can help.

I created such a custom presence for my phone. Thing is that II don’t use cell service, I do wifi-only. And once in the house I tend to shut it off, as my iPad can then be used to answer calls on that line. Then I bring it out with me, but only turn it on if I need it for something.

So I’ve been struggling a bit with reliable sensing of its presence.
How I think I will try to solve that problem is to make a timed Tasker profile for it on my Android ST control center. That profile will simply tell ST that the phone is gone at 7am every weekday. Then I’ll make sure to turn it on before I get home, and it should report me as home. And perhaps with FusedLocation, it will get better at sensing me at the right time to unlock my door.

1 Like

I followed the recipe exactly (so me thinks) and I thought I had it just right. All the menus came up and allowed me to enter what I was instructed to enter. But, although there are no error messages, it’s not working. I have the custom presence sensor and it shows present; but it never goes unpresent. My expectation: when I turn off Wi-Fi or disconnect from the SSID that I configured, then the ST simulated presence sensor should show me away. Right? Any tips on how to diagnose?

If you are using the Wifi Near option per the tutorial, then you physically have to leave the presence of the Wifi connection before it will trigger the departed command.

This is a bit of a pain for testing, but it’s a pretty cool feature. The newer versions of Android can continue to check for your proximity to a Wifi connection even when you are disconnected from an access point or have your Wifi connection turned “off”. (Android 4.4+)

Check out the notes from the Tasker user guide on using Wifi Near. As noted in the link, you don’t have to actually connect to the access point – you could even use the proximity to your neighbors wifi as a trigger as long as their signal was strong enough!

2 Likes

I also use Tasker on my Android phone for various needs. I think there is another little gotcha with the WiFi Near state that you need to be aware of.

From what I recall, the Wifi Near state will not deactivate immediately after you are out of range of a particular SSID. It will take several minutes for Tasker to recognize that it is out of range of a particular SSID. I believe that this is because it only polls this information every few minutes (particularly when the screen is off). In addition to this, Tasker will only deactivate the Wifi near state if it finds that SSID is not seen for two consecutive polling cycles.

So I think you need to look at Tasker Preferences under the Monitor Tab, there is a “Display off Monitoring”, “All Checks Seconds” option. Mine is set to 390 seconds. This means that in my case Wifi near will only deactivate if the SSID hasn’t been seen for about 13 minutes (= 390/60 sec = 6.5 min * 2)

1 Like

OK. Two days of using it with AutoLocation, and two days it is working perfectly. I set up my geofences so that there’s the area, neighborhood, and the driveway. I pull into the driveway and the light goes on and the door unlocks.

I’ll report back in a few days. But I think the issue is solved. :slight_smile:

2 Likes

It took me a while but after experimenting with the settings for a while I also finally figured out how to open up the house when I come home. Many thanks to everyone, as that seems to be working well for me now.

I do wonder if anyone knows if there is a way to get tasker to recognize when my garage door is opened? What I would like to do at that point is kick the GPS into high accuracy with shorter update intervals so it can more quickly detect that I have left and then shut the door and turn on the alarms. Or, maybe there is a better event to use as a trigger?

@joe64
For the part about getting Tasker to notice the garage door state, I’d suggest using the same methodology as in this thread…

It also uses SharpTools to get the state change passed to the Android so that you can then have Tasker do whatever you want when it gets that trigger.

1 Like

[quote=“Jeff_Klein, post:14, topic:43163”]
From what I recall, the Wifi Near state will not deactivate immediately after you are out of range of a particular SSID. It will take several minutes for Tasker to recognize that it is out of range of a particular SSID. I believe that this is because it only polls this information every few minutes (particularly when the screen is off). In addition to this, Tasker will only deactivate the Wifi near state if it finds that SSID is not seen for two consecutive polling cycles.

So I think you need to look at Tasker Preferences under the Monitor Tab, there is a “Display off Monitoring”, “All Checks Seconds” option. Mine is set to 390 seconds. This means that in my case Wifi near will only deactivate if the SSID hasn’t been seen for about 13 minutes (= 390/60 sec = 6.5 min * 2)
[/quote]I saw reference to this in the instructions for Wi-Fi scanning in Tasker’s preferences:

Menu / Prefs / Monitor / Wifi Scan Seconds (screen on) [mine=120]
Menu / Prefs / Monitor / Display Off All Checks (screen off) [mine=600]

I lowered them both to 90. I expect a hit on battery life, but depending on the amount, that’s a trade-off for good location. But, I’d be interested in anyone’s comments on those settings.

Also, my not-well-informed opinion is that I’m better off with “Wi-Fi Near” than Autolocation, because I want a tight definition of home. Autolocation seems suited to setting a wider geofence. Is that right?

AutoLocation uses Google’s Fused Location provider which uses a mix of Wifi, Cellular, and GPS depending on the context. Google used to have a good summary of this, but I can’t find it now. Here’s an article I found by The Next Web which briefly talks about the fused location provider:

You can always try out your new solution for a few days and if you’re not happy with it you could try out AutoLocation?

Also note this portion from the Tasker guide linked above about improving battery life by adding a second, lower power context along side your Wifi Near context.

Multiple Contexts
Tasker does not check high-power contexts until all lower-power contexts in the same profile are active. You can use this to reduce power consumption. For instance, if you use the Wifi Near state to detect coming home, you could add a Location: Net context to the same profile, so that wifi scanning will only take place when you are in the right neighbourhood.

1 Like

I’m not sure if I missed a step or something but the Device Type: Simulated Presence Sensor is not showing up in Tasker. The Custom Presence Sensor shows up in the SmartThings app so I’m not sure where I went wrong.