geoPresence: iOS Presence Sensor

geoPresence iOS App

Notice!

For current geoPresence users: The recent iOS 16.4.1 update apparently made a significant update to the Locations Services and deleted all monitored locations. I am currently working on an update that will at least preserve the locations (assuming my update is installed prior to upgrading to iOS 16.4.1), but even so, you may need to manually re-associate any SmartThings devices with it’s respective location after the iOS upgrade.

The other option is to create a profile (Settings->Profiles) and associate all locations and SmartThings devices with it. I also recommend you include the SmartThings Token and Master Token as well as enable sharing. You can then email the profile to yourself before you do the iOS upgrade and re-import it after the upgrade if your locations are deleted. See Settings->Help for assistance on creating a profile.

Overview

Need a reliable mobile presence sensor that you can integrate into your SmartThings Smart Home or custom Smart Home Dashboard? Want the convenience of knowing when a family member has arrived or departed a location (home, work, school, doctor, etc.)?

geoPresence is an iOS app that will allow you to track up to 20 locations of interest on each device it is installed on. If you have it integrated with your custom Smart Home Dashboard and/or with SmartThings Smart Home, you can configure it to update displays, update devices, trigger automations, and/or send notifications to keep family members up to date.

It can run in the foreground and provide you with a display of your current location, speed, direction of travel, and altitude (which I use when biking), or it can be closed and will receive updates from your iOS device as you enter or depart designated locations (geo-fence regions) in the background.

Summary

geoPresence turns your iPhone into a Mobile Presence Sensor that you can integrate with your SmartThings Smart Home and/or your own custom Smart Home Dashboard. It allows each iPhone user to track arrival and departure at up to 20 different locations.

Use it to trigger SmartThings automations when someone arrives at, or departs from, a key locations (i.e., home, work, school, doctor, etc.). This can even be used by an elderly family member not living in your household that you want to monitor their routine and make sure they make scheduled appointments, etc.

Use it to send location updates to your custom Smart Home Dashboard as you and your family members arrive/depart saved locations so with a quick glance at your dashboard you know everyones status.

Once the Primary User gets setup, getting the rest of the family setup is as easy as using AirDrop! Pre-configure their setup using Profiles and then just AirDrop it to them. Just like that, they are up and running and everything just starts working!

Of course, they can create/save new locations as desired/needed (up to 20). Once a location has been created on a device, Smart Home Dashboard and SmartThings updates (if configured) just start working. The user will also receive push notifications, if configured, to alert them when they arrive/depart the geo-fence for that location. This information can also be stored in the app’s History so it can reviewed later as desired.

Note: iOS Location Services seem to trigger an arrival event fairly quickly upon entering a geo-fence perimeter, but to prevent multiple arrival/departure events from being triggered in the event you are near the perimeter, there is a delay when triggering the departure to insure that you don’t re-enter too quickly. You’ll be able to observe this as you watch the app.

Note: If you have the app open and on the main Map page, geoPresence will automatically center on the current location once speed reaches 5 mph. While you’re moving, you won’t be able to scroll around on the map. You can also press the Direction button to center of the current location.

Note: Speed, direction and altitude were added to the display so I could use it while biking.

Getting Started

The first time you run geoPresence, you will be prompted to allow access to location services. Apple only allows you to select Allow While Using App here, but will eventually ask you if you want to Always Allow. You need Always Allow in order for the app to continue to get location updates even when closed. You can speed this up and prevent lost notifications if you go to Settings and change the app to Always Allow. You’ll also be prompted to Allow Notifications. I recommend allowing notifications to start and then adjusting as desired later.

Adding a Location

The first thing you’ll want to do is add a location or two. If you want to add your current location, you can either press-and-hold the direction arrow on the top of the main map screen, or press the search icon and tap the direction arrow on the search screen. The first option will open a dialog box asking for a unique name for the location and a geo-fencing radius in meters. You can currently enter a value between 100 and 1,000. I tried smaller values, but 100 seems to be the smallest that it will actually recognize. The second option will take you to a search map screen which shows you the location. If you want to add it, click the Add (+) icon and you will then be prompted for the name and radius. If the name is not unique, the location won’t be added.

If you add the current location, you should immediately see the name of that location displayed in green in the banner to indicate that you are within the geo-fence radius of that location. if you click on the Settings menu on the top-right, you will notice that your location is displayed under Monitored Locations and that you have a History item, which will show the date/time that you arrived at that location.

If you click on the Settings menu and then click on a location you’ll see the current settings, but you can edit the name and the radius. Once you setup a SmartThings device or devices, they will be available to be associated with that location as well. Note that you can turn SmartThings updates for this location on or off at anytime without turning it off for all locations.

Settings

Settings

The Settings page includes the following sections: Monitored Locations, History, HTTP Logs, Configuration: Smart Home Dashboard, Configuration: SmartThings, Help, Troubleshooting, and Manage Profiles.

Location Detail
Monitored Locations

This is the place to go if you want to review or edit an existing location. You can also click on the Map button to show that location on the map, along with it’s geo-fence region.

You can also associate a web address with each location that can be accessed by clicking on that location’s pin on the main Map screen. This address will automatically be populated if you search for a POI using the search function and it has a web address associated with it.

If you want to delete a location, you can swipe it to the left while viewing it on the Settings screen or click the Trash icon on the Location Detail page.

History

You can configure the number of history items to keep (0 – 100). A change to this value will not have an immediate effect, but will be applied the next time an arrival/departure occurs, which is when history is written.

The history will be displayed with the newest data at the top. The oldest data will be truncated once the log reaches the max setting size. If the size is set to zero, no history will be saved.

You can delete all history data at any time by pressing the Trash icon at the top.

HTTP Logs

This is very similar to History. You can set the number of items to keep (0 – 100), but keep in mind that if you are updating both the Smart Home Dashboard and SmartThings, there will potentially be two log items written for each event, depending on your settings for each location.

Each log item written will include the endpoint (SHD or SmartThings), the HTTP status (200 is generally success), the date/time of the execution, the URL that was called, the Reply that was sent back (if provided), and the Response Headers that were sent back (if provided).

You can click on each log item in the list to view all of the above detail.

Smart Home Dashboard
Configuration: Smart Home Dashboard

If you have a Smart Home Dashboard, like the one here, or your own custom SHD, you can enter the URL for your dashboard and the location information will be sent as an HTTP POST for your dashboard to consume and display.

Update Smart Home Dashboard? is a master switch, which can only be turned on after the SHD has been configured.

Smart Home Dashboard Settings allows you to configure the SHD.

For the URL setting, you will need to provide the full URL to the path that includes the route of your geoPresence code (i.e., https://my-shd.com/update-geopresence).

The Device ID will already be populated with a random value that is created the first time you run the app.

Device Name is the name that will be sent for display in the SHD.

Home is the primary SmartThings location that the device will be associated with (i.e., Home). If your account is associated with multiple locations, use the one that you want to device to be associated with.

Delete Device will become active once you have a URL defined. You can use this after you start posting location data to the SHD to remove it from the dashboard.

The parameters that will be sent to the SHD in each HTTP POST event is shown in case you are creating your own custom SHD.

Note: Once you configure SHD and turn on updates, the main Map screen will begin displaying an SHD button to the left of the Status display. It’s color will indicate it’s current status (Blue/Gray: No HTTP calls yet this session; Green: The last call was successful; Red: The last call failed. You can also press this button to force it to send.

SmartThings
Configuration: SmartThings

If you have a SmartThings hub with associated smart devices configured, you can also configure certain locations to send commands to associated SmartThings devices. These devices must support the switch capability (on/off), but can be either physical or virtual devices.

To connect to your SmartThings account, you will need to supply the SmartThings API URL. The app will default with the current version for North America (and perhaps others): https://api.smartthings.com/v1

You will also need a Personal Access Token (PAT). I recommend you only include Devices – Control All Devices access for use with geoPresence. You create your PAT here: https://account.smartthings.com/tokens. Note: you can delete this token at anytime to invalidate it and prevent it from being used further.

If you are the Primary User, you will also need a Master Token. This PAT should only include Devices – See All Devices and Locations – See All Locations. This token will be used to retrieve all SmartThings devices with a Switch capability so they can be imported into geoPresence.

To assist with generating your SmartThings PATs, there is a Click to get a Personal Access Token link provided on this page.

Once you have your PATs, you can then press the Click to Import Devices link. This will open the Import Devices page. The first time you open it you will need to click the Refresh icon to retrieve a list of SmartThings Devices. Once the list is retrieved, you can select the devices that you want to make available within geoPresence and press the Import button. You can always come back to this page and import additional devices later. If you add new devices to SmartThings later that you want to include, just press the Refresh icon again to update the list of available devices.

After you import the desired devices, they will be listed on the SmartThings settings page under SmartThings Devices. If you want to give any of them a more appropriate name, you can click on the device and be taken to the Device Detail page. On that page you can also test the device to insure that it works as expected. If you have it set to Arrive, pressing Test Device will send an ON command to the device, and OFF for Depart, just as it would do when you arrive or depart a location that has the device associated with it.

Notice that there is a master switch to turn SmartThings integration on/off (Update SmartThings?), as well as a switch for each location you define. SmartThings will only be called if the master switch is on, the location switch is on, and there is a device associated with the location. You don’t have to associate a device with each location and you can use the same device for multiple locations if desired.

Note: Once you configure SmartThings and turn on updates, the main Map screen will begin displaying an ST button to the right of the Status display. It’s color will indicate it’s current status (Blue/Gray: No HTTP calls yet this session; Green: The last call was successful; Red: The last call failed. You can also press this button to force it to send.

Help

This page will provide you with some information about performing common functions in the app.

Troubleshooting

This page will provide you with some common troubleshooting steps if you’re having issues.

Manage Profiles

This page will allow you to create user profiles that will allow you to pre-configure each user. Once you’re ready, just AirDrop it to them and they’re all setup! Later you can update the profile and AirDrop it again to keep them up to date.

Privacy

Note that no data you provide to geoPresence will be stored by, or shared with any third-parties. All data you enter is only stored locally on your device within a protected location. Your geoPresence Device ID (a random identifier created upon initial app install) and the name of the location you are entering/departing will be sent to your Smart Home Dashboard, and your SmartThings Token and SmartThings Device Id will be sent to SmartThings, if configured, so that Locations and Devices can be imported and on/off commands can be authenticated and executed.

Download on the App Store
Now available in the App Store!