Presence Detection

Simple Presence Detection
First of all, we want our home AI to know who and where we are. Presence detection typically relies on Bluetooth and Bluetooth Low Energy (BLE) technology to know someones location. This is usually done via their cell phone, as pretty much everyone has one on them at all times, and works like this:

  • Home automation system (HAS) detects a new Bluetooth devices UUID
  • The home owner then sets that device up in the HAS as a given user, mapping the UUID to a name
  • When the user enters or leaves the range of the Bluetooth network in the home, the HAS marks them as either home or away

That’s the simplest form of presence detection. It’s functional and allows for automation rules to be applied, for example: when the home owner leaves the house and there are no other registered devices detected, the HAS can arm a security system and reduce the temperature of the house. That’s the basis of a smart home.

Extended Presence Detection
However, what if we need a finer-grained control of our HAS? Let’s say that I’m home alone, and in my office all day. The HAS sees me at home so adjusts the temperature to my preferred setting. The problem here is that I’m now heating the entire house, even though I’m only in my office. So, smart yes, but energy-efficient, no!

To take this to the next step, we need the HAS to not just know that I’m home, but to know where I am in my house. This is accomplished by using BLE beacons located throughout the house. Having a BLE device in each room in the house would allow the HAS to know just where you are, not just that you’re “at home”. In the example of me being at home alone and in my office all day, this could prompt the HAS to decrease the temperature in the house, but then turn on a heater in the office.

True Presence Detection
So now our home is a lot smarter, but we’ve just uncovered a problem: let’s say I go upstairs to workout, and notice my cellphone is low on juice. I plug it in to charge, and after my workout and shower, come back down to my office but forget my phone charging upstairs. At this point the HAS thinks I am upstairs still, doesn’t turn on the heater in the office, and warms the whole house.

This is where we need to give our home some vision. If it could actually see us, it would know where we are in the house regardless of where our phone is. Hardware-wise this means small cameras in each room. Software-wise this means computer vision, specifically OpenCV. This brings us nicely into needing the HAS not just to see us, but to know who it is looking at.