Seriously, should I give up on mobile presence?

(Steve S) #1

You guys are killing me over here…

Twice this week the “Smart Alarm” went off on my wife when she came home from work because the iPhone mobile presence failed to report her as present. Presence tags are also semi-useless because they checkin at some random time after they are present - and honestly, I don’t want to carry yet another fob on my keychain (one for each car is enough).

Is my dream of my SmartThings enabled house being able to recognize its me reliably without freaking out dead? And if not, you think it would come to be before my wife sledge-hammers the thing?

(Minollo) #2

iPhone presence is completely unreliable right now; I’ve given up using it for the time being, waiting to see if any future updated changes things. It is really a pity.

The tags are much more predictable - even if they can have their own “moments” too; but with some software trickery (grace periods and such), they are at least usable for a number of purposes.

(Ben Edwards) #3

Steve (and Minollo) - first off I am hoping you are contacting support with these issues. They generally respond quickly to emails to

Also, if you don’t mind sharing here, what apps are you running to make use of your presence and also have you seen solid phone-based presence detection with other apps you are using? I use dropcam and a few other apps that detect my presence and while my experience differs greatly from yours (works almost 100% of the time) when it doesn’t work (usually false positives) the other apps also have the issue. Meaning this is often an issue with our phones, and satellites, and cell towers, and wi-fi networks abilities to pinpoint us accurately and in a timely manner.

In any case, please contact support and post more info here so we learn more. Some ideas…

  1. Was your wife using any other location-based apps like maps, gps, checkin apps just prior to getting home (ie was the gps active)?
  2. What scenario triggers the alarm? Door opening or motion when in Away mode?
  3. What happened when she tried to open the app (or didn’t she)? Did it detect her presence then?

We know you are sharing here - out of frustration, yes - but also out of a desire to make things better. Thank you.

(Steve S) #4

I submitted to support… here’s what I added to that ticket:

I’m not sure what I can tell you here that will help debug this. We both have iPhone 5 - she is on Verizon, and I have ATT. We are both running iOS 7 (7.0.3 now, but it happened before this last update as well). It’s clearly something where the app gets stuck and fails to realize it has crossed the boundary of the geofence. I routinely use the GPS (Waze) on my drive to/from work, so it’s not that the phone isn’t able to use location services.

To answer your specific questions

  1. She was using Waze on her way home, so GPS was working and active
  2. I am using the Smart Alarm app, and it’s set to alarm on motion when in Away mode. Away mode is triggered by both of our mobile presences being not present for 5 min (using the mode magic app )
  3. She didn’t try to open the app - she called me and I shut off the alarm from my app. Even so, I’m not sure what happens in the Smart Alarm app when it’s in its triggered state and then the mode switches to “home” it would be great if that shut it off.

(Minollo) #5

Indeed I talked with support; they mentioned me that they are working on an updated app which should fix the problems we are seeing.
I’m running the Smartthings app on three iPhones 4S devices, same iOS version; presence will just remain stuck on present or not-present (in most cases) until I open the app - then presence gets updated. Of course having to open the app to get a reliable presence synchronization defeats the whole purpose of automatically detecting presence based on location…

This is most likely an issue caused by handling of background processes in iOS; not sure how this could even be possible before iOS 7 came out; but it should definitely be possible to fix this now, for iOS 7 devices. That’s hopefully what they are working on. In the meanwhile, I have inevitably stopped using iPhones as presence devices.

(Mike T) #6
Also, if you don’t mind sharing here, what apps are you running to make use of your presence and also have you seen solid phone-based presence detection with other apps you are using?
I have an Android phone. As I posted in another thread I started, I see the same unreliable presence detection my friends with Apple devices are seeing. I also use Google Now, which offers location-based reminders. To be fair that doesn't always work quickly, but it does seem to work reliably.

There is a way to improve presence detection. A phone can easily detect the presence of an SSID. I have Tasker profiles set up on my phone to do things such as turn off the password lock when it detects my home WiFi SSID. This SSID detection is rock-solid reliable and very quick.

For Smartthings you could add a feature to mobile presence in which detection of specified SSID(s) is used to control mobile presence. There are a few caveats, of course.

  • The user needs to have a wireless router
  • It isn’t the same as the geofence that allows you to set a wider boundary
  • A user needs to have SSID broadcast enabled (although hiding it is not a very effective security measure; using strong encryption is)
  • WiFi needs to be enabled on the phone
Still this is something that could be quickly rolled out as a feature, and would be useful for those wanting to detect presence in their immediate home environment. Even better would be to add a hook to let Tasker control the Mode setting :slight_smile:

(Mike T) #7

2 changes to my previous post. First, its probably better to use the home WiFi MAC address instead of SSID. If a Smartthings user names their WiFi “JoesHouse” you don’t want their house to unlock its doors if they drive down a street past someone that has chosen the same moniker.

Second, security… A determined attacker could use spoofing to circumvent the system. Suppose you have your house set to unlock based on mobile presence. Your phone is with you, and you go to work. An attacker that knows about your system could snoop and capture your home SSID and MAC. He then follows you to work, employs a hacked WiFi router to broadcast your home WiFi signals, and your house unlocks. He then phones his buddies who go thru your house. Perhaps a bit far-fetched, but then perhaps not. A way to prevent this is to use the WiFi detection as a trigger to get a GPS update instead of as a trigger to change modes. Its harder to spoof GPS signals than router signals. There is a bit more to all of this; GPS doesn’t work indoors, the OS may not allow a request to get a location fix but instead just do it on its own schedule, etc.

(Cory S) #8

Haha, I’m sorry but that made me laugh a little. I don’t think I’ve ever even heard of a home burglary that sophisticated. Just about all of them are smash and grabs. I’d almost prefer he use your method…at least that way he wont break anything :slight_smile:

(Alex Christensen) #9

I was thinking about this the other day, seems to me you could have the phone, when it sees the SSID for your home network, (or perhaps anytime it switches to Wi-Fi) ping the hub and then handshake somehow.


I had troubles with mobile presence a few weeks back but after one of the updates my presence indicator is pretty spot on. I don’t see it coming and going constantly anymore. This is on an android phone (S4) and also using Mode Magic to set Home and Away mode.

(Mark B) #11

This may be unrelated but I recently noticed that the zip code & corresponding lat/long coordinates associated with my account (found under “My Locations” when I’m logged into the IDE) is not the correct location info. for where my hub actually resides. I’ve never been able to get the little phone icon to display (blue?) even when I’m sitting right next to my hub with my iPhone with me w/location services enabled for SmartThings. Coincidence perhaps for why my mobile presence doesn’t behave properly because I’m nowhere near where it thinks my hub resides?


That could possibly be why. If you google the lat/long coordinates, where is the location? I just checked mine and it’s spot on to where my house is. The zip is incorrect, but close.

(Mark B) #13

Lat/Long coordinate when put into GoogleMaps & searched land somewhere in the middle of the North Atlantic Ocean between the US. and West African Coast. Associated zip code value stored in my profile is for the island of Nantucket - nowhere near where me & my hub’s current location. Weird … something is not right for sure.


I’d suggest removing and re-adding mobile presence to start over with your location (if you have not done it already)

(Mark B) #15

Thanks Rey - that seemed to be the fix. I must have somehow moved my location (pin drop/geofence loc.) out to sea at some point. Once I re-established my presence, the blue icon within my mobile presence tile lit up & zip code & lat/long Info. updated itself within the IDE as well. Good 2 go … for now anyways.

(Jesse O'Neill-Oine) #16

First off, I want to apologize to everyone having issues. We understand how important this feature is and we are working hard to make it better. That being said, there are a few things that are out of our control that are causing some of the issues. I wanted to add a few bits here that may help folks understand what is going on.

  • We haven’t touched any code related to mobile presence since August 22nd. That was version 1.4.2 in the AppStore. iOS 7, however, did come out in the mean time and that may be impacting some users as Apple may have changed something with location services under the covers. On Android we’ve worked on it more recently because we are seeing even worse issues getting callbacks from Play Services than from Apple Location Services.
  • We are at the mercy of Apple and Google for getting geo-fence callbacks. If they don’t call call us back on a geo-fence crossing and we aren’t actively running, there isn’t much we can do. In fact, we sometimes get called for a geo-fence crossing that is 100% incorrect. Because of that we’ve had to add double checking code to all of the callbacks which make the accuracy better, but at the cost of speed (i.e. it takes longer to trigger a real event because we’re double checking the callback).
  • We are also at the mercy of having a network connection to get the event out. We will retry up to 5 times with an exponential easing function, so in the end we’ll try for nearly 5 minutes to send out the event.
  • Apps like SmartThings are not like Maps or Waze. Those apps run in the foreground and actively turn on the GPS. We rely on getting a callback from the platform when we aren’t in the foreground.
  • SmartThings does turn the GPS on when you launch the app, so if your state is incorrect it should get corrected by opening the app. This doesn’t help in the case of a SmartApp being triggered, however.
  • Using SSID as an indicator was evaluated and determined to be a non-starter because of the problem with the names not being unique. Using MAC address is interesting, but presents security problems and I’m not positive Apple will allow our app to get that info either.
  • At least for me, some other apps that rely on geofences seem to have the same inconsistency issues we do. That being said, my Mobile Presence has been nearly 100% correct for the past several months.
  • Be aware that the phone is initiating the events and therefore we can’t do much if the phone goes dead. We’ve talked about adding a third “Unknown” state, but that will require some different monitoring on the server side to try to determine if a phone is dead rather than it just not having moved recently.
  • Making your geofence larger can help in many cases.
  • Make sure (as discussed above) that your geofence is where you mean it to be (i.e. you haven’t accidentally moved it).

(Steve S) #17

@joneilloine - at least in my case, it doesn’t seem like a callback issue, it’s like the ST app just loses connection to smarthings cloud. For example, when I notice that my presence state is incorrect - I also frequently see my switches showing incorrect states (e.g., a light switch is on, but my app still shows it as off). At some point my app lost the connection and it never gets picked up again until I kick it - If I “pull to refresh” on my presence tile (or my “lights” page with my switches on it), it will then re-sync with the system.

I also not that I sometimes don’t get push notifications either. That may be unrelated, but maybe not.

(Mike T) #18

@joneilloine thanks for the detailed reply. 2 comments…

I know that Android allows access to the MAC address of a WiFi hotspot because I use that feature (via Tasker). At work we have a corporate WiFi network phones can join that uses a single SSID. There are multiple hotspots and I use the MAC of the ones in larger conference rooms to automatically silence my phone in those rooms.

On a related note, reading your explanation that you rely on a network connection to get the event out caused me to come up with what may be an explanation for some failures. It’s that “free” wifi that so many businesses offer today. When I am near one of them (for example, go into a Starbucks) my phone will automatically connect to their wifi. But even though the phone shows the wifi as connected, I can’t actually use the wifi until I open a browser and click thru a few screens – accepting their terms of use and watching their ad (the price of my “free” connection). I have noticed other apps that I open will hang until I go thru the connection steps in a browser. Meanwhile my perfectly capable 4G connection is idle and unused since the phone prefers the wifi connection to the internet, even though it can’t actually access the internet thru it. I wonder if this is behind some update failures with the geofence; the OS tells the SmartThings app it has moved, but if the user sits in that wifi zone without going thru the connection steps the hotspot router will block internet access and the SmartThings app is unable to send a notification to the servers back at SmartThings.

I’m not a developer, but it looks like Android has a call setNetworkPreference where an app can select what type of connection it wants. If the speculation in the previous paragraph pans out, then perhaps as part of the exponential easing function you mention should be an attempt to see what connection type the user has going and try alternatives.

(Jesse O'Neill-Oine) #19

@Steve28 - so, in your case, are you ever getting real-time events? We open up a socket from the phone to receive these events and what you’re describing seems more like a problem with that socket not staying open. Is it ever different when you are home versus being somewhere else? Just curious if it could be something with your home network. One thing you should try if you haven’t is to turn on extra logging events for a while. That makes the activity feed much chattier and should confirm or deny that messages are getting through for you. To turn these messages on, you select Support in the left hand menu and then choose Help us Debug > Display extra events. Once you’ve done that, you can try testing out a light. When you tap a switch that is off (with the feed open) you should see “on command sent to SwitchName” in your feed shortly after tapping. A moment later you should get the actual state change that says “SwitchName is on”.

@mikeT - I have no doubt that we can get MAC address on Android, but the problem is that I don’t know if Apple allows it. We really want both platforms to work consistently and so don’t (if possible) want to use different techniques per platform. It’s something we’ll look into a bit more to see if we could use it. I’m also really excited for BLE as we could eventually use that for rock solid presence detection. On the other note… good thinking! I had not considered that, but I definitely think that could be an issue that people run into. The workaround would be to forget those networks, but that certainly sucks. I’ll have to think more on that, but it seems like maybe our exponential back off isn’t enough to get the message out in cases like this. This is also similar to the case where you are close enough to a known access point to get signal, but if you try to actually use any network it’s clear that it is so weak that you can’t actually use it.

(Steve S) #20

@joneilloine - Here’s an example of yesterday’s behavior for my wife’s phone (Verizon iPhone 5, iOS 7.0.3). When I was driving to work, I got the notification telling me that “everyone had left” and my mode magic app switched to away mode. Only problem was – my wife and her iPhone were still home. I checked the activity in her presence tile’s feed and the last activity was when she left for work the previous day (this was under the default logging level). She then then went to work and that evening when I got home I did the following (her presence still showed as not present and the log’s last activity was over 24 hours previous for her presence):

  1. Opened the ST app on her phone - her presence did not change
  2. Went to her presence tile, did a "pull down to refresh - presence did not change
  3. Opened the multitasking tray thing on the iPhone and “swiped up” to quit the ST app
  4. Opened the ST app again - presence updated to “present”

After step 2 I didn’t think to go see if her phone could control lights… When I turn on the extra “help us debug” features and go back and look at the events I see a bunch of:

iPhone Active
iPhone Inactive
iPhone left

All gray (not the usual white actual events) - and they were during the time her presence was not updating (now maybe they got uploaded after it connected, but that’s what I see in the tray now). Also, when get this sequence every time I open app and look in the log tray thing on either phone (mine or hers) - all highlighted in blue. I get this regardless of whether I am home on wifi, at work on wifi, or cellular:

Replacing client registration
Received new client registration
Socket is Unhealthy
Registering with Client Connect
Registered with Client Connect