Phone presence sensor gone rogue?

Calling Rogue One for assistance. Sorry couldn’t resist that :wink:

Coming back to your Rogue issue, let’s understand how location works so it’ll help you figure out how to fix your issue. Location is determined by a couple of methods:

  1. GPS - Most of the time devices do NOT use active GPS due to the fact that’s it drains the battery. So this only works while the app is open.
  2. AGPS - Assisted GPS, this done with the help of mobile network towers. Most cellphones are aware of the network towers within a certain radius and their distance from them using the signal strength from the towers. Since the mobile network is always active this is the primary way for a cellphone to “guesstimate” its position. (Each towers location is transmitted to the phone). This is one source of a problem. Often in urban cities and even rural areas where there are objects (buildings, hills etc) that cause reflection and other interference the signals from the towers fluctuate which causes the “guesstimated” position of the AGPS to vary. This can cause your phone to appear to be out of its “circle” as defined on the hub to be considered “Home”. The second reason this may happen is due to boundary conditions. Mobile towers work on the concept of micro cells (think small circles or hexagons). If you live on the border of two cells your location can fluctuate between the two cells depending upon which tower the cellphone connects to and this can keep fluctuation for the reasons above. I live on the border of two cells and see this issue. The problem is one tower’s “location” puts me squarely in the center of my “home circle” as defined on the ST hub, the other towers location puts me outside the “Home circle”, so when it fluctuates my location keeps moving in and out of the “Home Circle”. I’ll explain how to solve this later.
  3. WiFi Location - AGPS also uses wifi hotspots to determine their location. Apple pretty much has a list of every WiFI hotspot in the country (personal and public, I won’t get into how but it does and so do other providers). The AGPS uses the MAC address of the wifi router to look up its position and then lets the phone know where it is and it’s pretty darn accurate. Onfact this method is much more accurate than the cellphone tower AGPS method. If I drive down a road with only Wifi AGPS enabled it tells me pretty accurately where I am everyone my phone “detects” a wifi router from a nearby house or building. It ALSO uses your OWN router MAC address to find it’s location, so if you have a NEW/USED router or an updated mac address it may not know your new location and will mess it up.

iOS’s/Android geo fence uses Cell Tower and Wifi AGPS to approximate its position and report it to the apps.

So having explained how a phone determines its position now I can assume you understand why your phone position keeps fluctuating and moving in and out of your “Home circle”. So let’s talk about how to fix it. Couple of things, you can’t obviously do anything about cell tower boundaries or location errors or signal fluctuations, but here is what you can do:

  1. Leave your Wifi on on your device always. It helps find nearby routers and locate it self more accurately for the most. Conversely if your have “Rogue” router nearby with a wrong location in the providers database it could be throwing your location off. Try turning your wifi off and see if it is a rouge router, this very unlikely but not impossible. If you have a new router it could be throwing your location off, give it time to find it’s location and update the database and you can test by turning off Wifi.
  2. Change your “Home circle” radius on your hub. From your ST App open your Location properties and increase the radius of the circle. Make it very large at first say a Mile or so and then start reducing it slowly until you find the threshold where the fluctuations are within your “Home circle”
  3. Open the IDE -> My Hubs -> Utilities and check your presence timeout. Make sure it’s at least 2 minutes. This essentially tells the hub how to react when the “phone” reports its location outside the Home circle. How long should it wait before updating the presence status (arrived or left). If you are on a boundary region with towers or have slow fluctuations, increasing this number to day 5 minutes can help immensely but letting the hub know to ignore temporary changes in location. This could be an issue as it gets corrupted sometimes or isn’t configured properly so do reset this number.
  4. Reboot the SmartThings hub, it helps (it can help reducing caching issues and “other” firmware quirks)
  5. It’s possible that one of your neighbors have changed their wifi router and the mac address of their router is still pointing to an old address and when your phone “sees” the wifi the location is being thrown off. To check for this, scan the Wifi’s in your devices range in your home and extract these wifi routers MAC address (many tools for that). Once you have the MAC address use this tool to track the location of the MAC address. http://rumyittips.com/how-to-track-any-mac-address-geographical-location/

So there you are, what you’re seeing has not much to do with the app but a lot to do with the operating system and how it calculates its position. But now you have to tools to diagnose and fix it hopefully.

5 Likes