Tuesday, December 16, 2014

Presence Sensing with SmartThings and Multiple iPhones

After you set up your home automation (HA) hub, in our case, the SmartThings Hub, one of the first things you're going to want to do is automate things based on your presence.  You'll want to have the lights come on when you come home, offset the thermostat when you leave, etc.  With a little work, you'll have the house behaving much differently when you're home than when you're not home.  The real question of course is, "How does it KNOW?"

The answer is that there are all sorts of ways.  If you're familiar with the Google/Nest Labs Nest Learning Thermostat (not a recommended product), you know that it uses motion sensing to know if you're in the room with it.  Of course that's a pretty limited way of doing things, which fits right in with the Nest, but we'll get to thermostats in another post and I'll explain why Nest is at least 3rd on my list of recommended thermostats.  There are better was, and the SmartThings software offers several solutions.

The simplest way is directly interfacing with the app:

Open the app and set the status to default "I'm Back!" or "Goodbye!" events and trigger whatever actions you've tied to it.  OK, let's face it, you're never, ever, ever going to do that.  What good is home automation if it's not automated?

The most obvious automated way is the SmartSense Presence Sensor:
This device utilizes your ZigBee Home Automation Profile mesh network to know if you're home.  Basically, if the device is in range, you are home.  You can buy as many of these as you want, attach them to kids' backpacks, keychains, etc. and know when people are home.  The reviews on Amazon are pretty hard on this device.  Complaints basically include:
  1. Short battery life
  2. Comes apart too easily (i.e. when keychain is dropped)
  3. Unreliable due to range
#1 and #2 I am presently evaluating here in "The Lab," and #1 may be a real issue, since mine currently reports 75% battery after a pretty short stay:

#3 is at least partially a sign of where HA technology and consumer understanding of it is at, and is why every time I talk about a device, I specifically talk about how it connects to your home network of networks.  ZigBee is a mesh network.  The devices are low power and also short range.  Because of this, all the devices on your network talk to each other and pass their various messages along through your house.  They connect to your main home network (the one your computers and other WiFi devices are on) through your home automation hub, but if the hub and the device are too far apart, there has to be another device in between to relay the messages.  With respect to the SmartSense Presence Sensor, that means that if you don't have many ZigBee devices (and remember, there are actually several different profiles of ZigBee that don't all talk to each other or SmartThings), and your hub is back in your nerd closet, it might not reliably know you're home.  Complicating all of the above is that there are actually different ZigBee profiles that don't necessarily talk to each other, so a ZigBee Home Automation device (like this one) won't talk to a ZigBee Smart Energy device, etc. You need to consider things like this when applying the device, and it's annoying.

Beyond the SmartSense Presence Sensor, there are several other options.  One of the most interesting is simply using your phone to geofence your house.  Modern smartphones have "location services" that track the phone's location as you move around using a variety of methods (GPS, identities of in range WiFi networks, Bluetooth beacons, and cellular tower signals), and one of the applications that has been increasingly applied over the last few years is what's called "geofencing."  Basically is creating a "fence" around a location and triggering when the fence is crossed.  In this application, we create a fence around our home, and trigger a present/away event when we cross it.

The first option for doing this is the SmartThings app itself.  When you set it up, it locates your home and lets you set a radius for sensing presence, and you can always modify this in the main settings for the app.  Now, from the main screen, or "Dashboard," we hit the big plus sign to add a device, scroll down to presence sensors, select our phone, and "connect now."  Easy peasy, lemon squeezy, right?  Now you go to your wife's phone, log in with your email and password, rinse and repeat, right?  BZZZZZT.

Apparently SmartThings has decided that this isn't the way it should work.  When you take this path the app complains that there is already a device named "Colin's iPhone."  Never mind that I'm on Courtney's iPhone, no matter how many times you try, it complains of the same thing.  It turns out, you have to log into each device with a separate email address, which is "invited" from from main account.  Why?  I'm really not certain.  It's an irritating enough issue that on the SmartThings online forums, there is a thread titled, "Setting up multiple iPhones (separate linked accounts) as presence sensors for dummies."  Yeah, that's what I went and found when it didn't work the way I expected.

Another method of presence sensing is through SmartThings integrating the Life360 app, which integrates with the SmartThings hub via "cloud to cloud" integration.  Life360 lets you do all sorts of things to keep up with your family, including sharing to-do lists, grocery lists, and tracking when family members come and go from your home.  You can leverage this tracking instead of using the built in tracking functionality.  I'll be honest, at this point I'm not sure why I would prefer one over the other, but I've verified that this method works.

OK, this post has gotten pretty long, but presence sensing is one of the core inputs for home automation, so I wanted to get a thorough foundation, plus the SmartThings software didn't work as expected.  In the next HA post I'll actually talk about applying the presence sensing to make some things happen.

Products referenced in this post:

For advanced reading on home automation I recommend the SmartHomeHub forums.

1 comment:

  1. loved your writing style. your blog is amazing. Have been going through some of your posts, will def. recommend to others. Independence Day Whatsapp Message