Bluetooth Sensing for Home Automation
Traditionally iBeacon technology was created to allow a mobile phone to know where it is in a building. A museum for example might place an iBeacon on each display and have an app that tells you about the exhibit in front of you. This works well but you need to have your phone on and you need an app running for this to be useful. When your phone is locked it still checks periodically for location beacons but the interval is around 15 minutes and is therefore useless for home automation.
Instead, my interest is in using the Bluetooth advertisements sent by cellphones, Apple watches and iBeacons to track where people, dogs and assets are located within the home. I see this data as complementary to all the other sensor data collected and plan to fuse the two in the future.
Phones however do not want to be tracked, they include a technology called "mac address randomization" that causes the phone to skip to a new mac address on a random time interval. iBeacons and many other devices are much easier to track.
My approach has been to install multiple Raspberry Pi devices around the home and barn and then use code to figure out where each phone, watch or beacon is. The code includes hundreds of heuristics to discern the device ID from any information it transits including manufacturer id, manufacturer data, mac address (if public), appearance, name, ...
Stitching mac address randomization back up into a coherent track has been achieved! I can now track a person with a phone as they move through the space from room to room even as their phone skips mac addresses. Only when two phones in the same room switch mac address at the same time does the system lose the ability to track an individual but it retains the ability to know how many people are in each room.
Determining the location from Bluetooth RSSI has also been a challenge. The next version of Bluetooth will include direction finding capability to centimeter accuracy using angle-of-arrival, but I don't have that yet. Mapping RSSI values onto locations is complex because reflections (off metal surfaces), attenuations (walls, furniture, ...) and atompsheric conditions (mostly humidity) can all affect the received signal strength. Further complicating the issue is that fact that not all of the Pis will receive any given advertisement packet and some of the Pis may be offline for maintenance.
Despite all these problems I now have a robust algoritm that can map devices to rooms, and in some cases areas within a room.
I envision many different uses for the Bluetooth tracking technology I have developed including:-
- Occupancy-based heating control, e.g. lower temperature when just one person present.
- Lighting controls can now be more certain that someone is still in a room even when they do not move.
- Asset tracking enables "find my anything" for any Bluetooth tagged tool or dog.
The technology is currently in trials in the Kuwait, Baltimore and Seattle. A huge volume of data is being collected every day to improve the heuristics for device categorization and to tune the location tracking aspects of the system.
The technology has won two awards so far, one from Hackster.io and another global hackathon with a $20,000 first place prize from HCL. You can read more about that on Geekwire.