Learn how to create a virtual presence device handler that can be used to create an virtual presence switch for each family member's mobile device. Setting up virtual presence device switches gives you the ability to see the status of your mobile phones in the SmartThings App device list. But more importantly, these presence switches provide you with the ability to use the status of your smart phones within scenes and automatons. As a result, you you will now be able to trigger numerous actions based on the arrival and departure of each member's mobile device.
You may be asking yourself; didn’t I setup my phone when I installed SmartThings App? It is likely true that you added each member’s smart phone and gave the SmartThings App permission to get the location of each member’s mobile device. So why is necessary to take additional steps?
Well I’m glad you asked. The built in mobile presence feature in the new SmartThings app does provide limited ability to use the location of your family members device. The app does this by using the same location services used by your smart device.
However, your connected mobile devices and the status of those devices will not display in the SmartThings device list. Therefore, you are limited to using the status of your devices within the Home Monitor’s Security settings. When you setup Security in the Home Monitor, you are instructing the SmartThings App to use the location of your devices to triggered mode changes. You may also set the Home Monitor to trigger lights and alarms based on the status of door and motion sensors, during the time when all of your mobile devices are away from home. However, you are not able to use your mobile phones as a presence sensing device within scenes or automatons. Unless of course, you take a few simple steps to add your devices to the SmartThings device list using the SmartThings IDE.
If you are new to Samsung SmartThings, the SmartThings IDE is simply a website which you can access using your established SmartThings login and password. I’ll leave a link to the site below.
The SmartThings IDE, or Integrated Development Environment, provides SmartThings users with some tools which can be helpful in managing their SmartThings account. Among other things, the IDE provides the ability to build, manage and publish custom Smart Apps and Device Handlers.
In the video supplied below I will show you how to use the IDE to add a nifty little device handler that will give you the ability to set-up each family member’s phone as a virtual device. Once your mobile devices are added to the device list, you’ll then be able to view the status of each member’s device within the SmartThings App. With a simple automation, you’ll be able to switch the presence setting of each device when individual members depart or arrive from your home’s geolocation. Best of all, you’ll also gain the ability to use each mobile device within scenes and automations.
Before adding your devices to the IDE, you must first ensure that you have granted SmartThings the needed permissions. SmartThings must be given permission to get the location from each member’s mobile device. To do this you must sign in to the SmartThings app, select Menu icon located in the upper left hand corner of the App, I call this the Hamburger icon. Nest you need to tap the gear icon. Now you want to toggle the switch which reads, “Get your location from this phone” to the “ON” position. Then it is simply a matter of tapping “Allow” so that your SmartThings App had permission to access your phone’s location information.
It’s important that you apply these settings for each family member device which you intend to use as a presence sensor. Each intended device must have cell service. Otherwise you will not be able to use the device to detect mobile presence.
Next you want to verify that your geolocation is properly set. The accuracy of your geolocation is important so you can trigger automations when you leave or arrive home. From the Home screen, you’ll need to tap on the three dots in the upper right-hand corner. Then Tap Manage Location. Next, Tap on the word Geolocation. You may also need to Tap and drag the map to center your Home’s location to the middle of the geofence circle. Finally, you can also adjust the size of the geolocation’s radius to suit your preference. Once everything is set, simply tap Done.
Now that we’ve given SmartThings the proper permissions, and set our geolocation, we can now add each mobile phone to the IDE as a SmartThings virtual device. To do this, we are going to use a virtual switch that was developed by Austin Pritchett. Austin is a contributor on the SmartThings Community. I have also provided a link to Austin’s article with provides GitHub integration instructions as well as instructions for manually installing the RAW code. You can view the video provided at the end of this article to see the visual instructions for installing the code. We will be copying the RAW code, and then paste that code into the SmartThings IDE. This will install the Austin’s virtual presence switch as a new device handler.
Now assuming that you installed Austin's GitHub code and that you’ve added your virtual phone devices to the IDE, you can now login to your SmartThings mobile app and l see the virtual switches displayed in your list of devices. I listed mine in a group titled iPhone presence. I moved them to the top of the list so that I can view and verify the status of each device.
Now it just a matter of creating a couple of simple automations for each member’s device so that each virtual presence switch is turned “on” or “off” when the device returns or departs from the home’s geofence location. When I created my automations, I just name the automations as Bud Home and Bud Away. So if a members mobile device is at Bud’s home, then set the iPhone Bud virtual switch to “ON”. If a member’s mobile device is away from Bud’s home, then set iPhone Bud virtual switch to “OFF”.
Please reference the video below to setup these automations…