Mobile Presence and iBeacon (discussion beginning 2015)

1 is the one I’m most interested in right now, 2-3 could get rather expensive with the need for that many Beacons. Unless we can get Beacons put into other devices like Motion/Open Close sensors, etc.

The reason presence is so difficult for me at the moment is that one, we live 2 blocks from the High School. So my son always appears and disappears from the geofence since I can’t make it smaller. And 2 is a funny one, we have a park behind our house that has a circular walking track. It’s very funny to watch my logs when my wife is out walking. When she gets on one side of the track she’s home, then on the other she’s away. If I wasn’t home, the house would likely be going nuts trying to arm/disarm the system based on her movements.

I just ordered 3 more of the geohopper beacons and they arrive this weekend. I can’t wait to test them out on the four sides of the house.

Estimotes new stickers are disposables, $10 per unit sold in packs of 10 with an expected one year battery life. I’ll probably use those for some of the touchless switches. $10 for a year of use is worth it to me.

Geohoppers are a good price for plug ins, but I prefer battery.

edited to add rats! Just found out Estimote stickers will have a fixed range of 10 meters, useless for touchless switches. :disappointed_relieved:

Back to the originals, but they cost a lot more ($33 each).

1 Like

Yeah, the $33 price point is a bit high. I went with the $25 plugin beacons since they will be in fixed locations just to determine if you are in the house or not.

Yeah, I am stoked to combine the RadBeacon USB with a couple of my Leviton USB outlets around the house for some stealthy microlocation… Now we just need the software to catch up.

2 Likes

I have those Levitons - I just put a bunch in. With Tasker I can do some cool stuff with room presence. Unfortunately, Tasker doesnt’ monitor the signal level. If I could get the RSSI / LQI into SmartThings or Tasker, I could do near perfect room presence.

1 Like

Using iBeacons with SmartThings

@DavGlass made a “proof of concept” smartapp for me that allows me to use an iBeacon to flip a SmartThings switch on or off. :slight_smile:

Since this could be a virtual switch, it can also be used with the Big Switch for Hello Home Actions to do all kinds of stuff. Or used with IFTTT.

Or, of course, if you want to modify the code, this proof of concept can be used as the basis for many different SmartThings interactions and much more complex smartapps.

The POC SmartApp only asks for the detection range you want to use, and the switch you want to turn on or off. You can get it from Dave’s GitHub:

My very deep thanks to Dave for working this up for me! It has immediate practical use in my house, and I’m sure will be the basis for many other creative solutions for other people.

What You’ll Need
SmartThings hub
One defined SmartThings switch (can be virtual)
One iBeacon (we tested with both GeoHopper and Estimote)
The Beecon+ iOS app or another beacon app that can do http POST

AN INTRODUCTION TO HOW IBEACONS WORK

If you’re already using iBeacons, you can skip all this. If you’re not, read it before setting up your use case, as they probably don’t work the way you expect.

iBeacons are not proximity detectors. Those do exist, typically triangualated infrared, but that’s not what iBeacons are.

The usual metaphor is a lighthouse, which is a good one, but you need to really think about that for a minute.

All an iBeacon is is a tiny very low power transmitter that keeps sending its own ID out. That’s it. (OK, there are some that are also temperature sensors, but forget that part for a minute.) They don’t send a message. They don’t know what receivers have detected them. They don’t run any other code. They just send out the “Beacon 123456789” identifier over and over.

So you need a “receiving station” that will recognize that an iBeacon is transmitting, get that ID, and know what to do with that specific ID. The receiving station is an app that lives on your phone. Not a SmartApp. Not the ST hub. Just a regular app. An app that has been set up ahead of time to recognize a specific iBeacon’s ID.

RANGING

The receiving station is going to recognize the iBeacon ID as one it’s been set up to process, and the first thing it’s going to do is “range” it–determine how far away it probably is based on the strength of the signal it receives. (Not the strength of the signal the iBeacon is sending–that’s always the same. It’s just a lighthouse, remember. But the receiving station is going to guess whether it’s close to the lighthouse or far away based on how strong the signal is at the receiving point.)

Based on the standard, the signal will be ranged as: “Just entered into range,” “far” (typically about 30 meters) “near” (typically about 3 meters), “immediate” (typically within a few inches) or “just went out of range.”

Notice that there are two event ranges: (entered into range and went out of range) and three presence ranges (far, near, immediate).

There is no range value for “just left immediate range and is now in near range.” If it’s near, it’s near, whether its previous range was far or immediate.

Also–a lot of things can affect the perceived distance, but usually it’s something that interferes with the signal so it seems weaker (farther away) than it really is. Rain will also interfere if your phone or the iBeacon are outdoors.

And remember the iBeacon itself doesn’t do anything except broadcast its ID. If your receiving station app isn’t monitoring for it, or your phone is turned off altogether, nothing will happen.

THE RECEIVING STATION APP, AND WHY WE USED BEECON

All receiving station apps can recognize an iBeacon’s ID (although not all brands are detectible by all receiving station apps) and range it. Now what? That just depends on the app.

For example, the Geohopper app is designed as a notifier for individuals getting to and from locations. LIke a college student letting their parents know they arrived back at the dorm or a person working in an office letting their family know they just left the office.

It provides two basic action triggers: entering or exiting range. You can then set it up to email someone, or post to an RSS feed. It has an extra fee webservices option, but it’s still only on enter or exit.

The Beecon and Beecon+ apps from Beacon Sandwich, which are designed for home automation use cases, offer a different set of choices. You can set it up to tweet. You can have it send a post or get request to a web service. Or it can directly control some home automation brands, notably Philips Hues, LifX, iTach (IR) and some WeMo devices.

Remember the iBeacon itself just says “Here’s my ID.” It’s the Receiving Station app on your phone that does whatever comes next based on its recognition of that specific ID.

And now Beecon’s big advantage for home automation: you can set the actions to occur for any of the 5 standard ranges: just came into range, just left range, immediate (which they call “very close”), near, and far.

Unlike many receiving station apps, iBeacon also lets you set a custom distance, which is very useful for home automation. Just remember that this is a measure of signal strength, not real distance, so allow for some variability. But it’s very useful when you want to limit an action area to something a little smaller than just “near.”

One technical limitation: due to various issues with the iBeacon standard, you’re allowed to have one iBeacon trigger for one distance plus exit, but you can’t have one action for Near and a different action for Very Close on the same iBeacon. So you may end up needing more iBeacons than you first expect.

The Beacon Sandwich app costs $1.99 for the basic Beecon, and $8.99 for Beecon+. See their website for the differences.

There are some other technical reasons for why we like Beecon+, including its ability to distinguish between regions and beacons and its resiliency in dealing with overlapping beacons, but that’s getting a little far off topic here. Just look up iBeacon app reviews, they mostly say the same things.

THE IBEACONS

There are about 5 major brands for iBeacons right now, but for home automation I would recommend two at this time. Both can be managed with the Beecon receiving station apps.

  1. Geohopper, a USB plug in with a wall plug. List price is $40 but usually costs about $25 on Amazon and comes with a free set up app.

http://www.amazon.com/Geohopper-iBeacon-with-Power-Supply/dp/B00N17AU4K

  1. Estimote, the most popular iBeacon brand. Comes in a “developer kit” of 3 battery powered ibeacons for $99. Free SDK if you want to write your own iOS apps. Free set up app that you will likely only use for things like modifying the ID the estimotes broadcast.

(They also sell “stickers” at 10 for $99, but those only have one reporting range, 10 meters, and are not standard iBeacons so won’t work with many receiving station apps. I don’t know if they could be integrated with ST or not.)

The batteries on a standard Estimote should last several years in most homes, and the estimotes can be cut open if you do want to replace the battery.

You can also use a mix of GeoHoppers and Estimotes with the Beecon receiving station apps. The Geohopper is slightly cheaper and mains powered. The Estimote is slightly more expensive, can be put anywhere, handles overlapping ranges well, and has an SDK for if you want to write your own iOS apps.

MAKING THE SMARTTHINGS CONNECTION

OK, I tried pretty much every built in option for iBeacons to SmartThings integration, including all the options using IFTTT as a “man in the middle,” but nothing worked smoothly enough. The iBeacon recognition was perfect for weeks, but getting the message to ST was lagging too much.

So Dave Glass said, “Beecon+ has a POST method, let me see if that works.” 10 days and several iterations later, I can confirm that it does. :slight_smile:

His smartapp asks the user to specify range, on or off, and switch to control. That’s it. Since this is just a proof of concept, right now you need one instance of the smartapp for each beacon. And it’s only set up for switches, although you should be able to modify it for other devices.

GOOD THINGS ABOUT IBEACONS

  1. iBeacons should be both fast and reliable for geofence detection in small ranges. Excellent for “car in the driveway,” “person at the front door,” or “person in the living room.” And with Beecon+, you can define a custom distance as well.

  2. Unlike a motion detector, you can set detection for a specific person, so there’s no way a dog or cat can set it off, for example. You can also have it work differently for homeowner vs house cleaner, or parent vs teen. This is particularly helpful for me, since I have a service dog. I can send the dog to get something near the iBeacon knowing he won’t set off the event the way he might with a motion detector.

  3. And you should never get a false positive from an iBeacon unless your phone went dead and then was recharged, something you’d probably be aware of. Gusts of wind, afternoon sunlight, and air conditioners won’t trigger an event.

  4. unlike a motion sensor, an iBeacon has an actual “exiting” event. So you don’t have to worry about the off event triggering too soon. It’s not based on time, it’s based on you actually moving out of range of one iBeacon (or into range of another).

SOME NEGATIVES ABOUT IBEACONS

  1. every use case depends on you either bringing the phone near the iBeacon or bringing the iBeacon near the detector (which could be a tablet). So it’s definitely not as good as a regular proximity switch for the “Very Close” distance use cases. If you forget your phone in the living room, it won’t trigger the iBeacon in the bedroom. And your phone has to have been set up with the receiving station app first, so it’s unlikely that iBeacons will work well for visitors.

  2. they don’t toggle for distances other than “out of range.” You could certainly have your lights come up when you to the house and turn off again when you leave. But if you want to use them for Very Close switches, you need one for on and one for off. Or have a metal box to drop over it to force it “out of range.”

  3. They don’t work great with Android. iOS detects iBeacons at the operating system level, which is both easier on the battery and means the receiving station app can be set to work even when it’s closed. Android’s native functionality requires that the receiving station app be open in order to detect the beacons. I don’t know what other options there are for this, but it’s no coincidence that Beecon is only available for iOS.

  4. If your phone goes completely dead and is then recharged, it will be treated as an Arrived in Range event. Just something to be aware of.

  5. They’re not cheap. If it takes two to handle the on and off conditions, that’s fifty or sixty dollars. Since I’m quadriparetic, there are a lot of use cases where that’s worth it to me, but for many people, the primary justifiable use will be at the geofence border for arriving home/leaving home use cases where you’ll only need one.

  6. As of this writing, May 2015, they aren’t detectable by smart watches, only phones and tablets. The Beecon+ app does have an apple watch version, but while it lets you launch actions manually, the watch itself doesn’t have the receiving station. So the range is always relative to where the paired phone is, not the watch itself.

  7. depending on exactly how you set it up, it may use too much battery on your phone. There are a lot of options to play around with, but again something to be aware of.

SUMMARY

Dave’s proof of concept definitely works, so if you’re interested in using iBeacons with SmartThings and you have an iOS device to host the receiving station app, you’ve got a good jumping off point. Have fun! :slight_smile:

14 Likes

Really nice stuff! Using the app to POST to SmartThings is definitely the best method. I have a strong feeling that ST will have some beacon integration inside the app in the near future as ST already has the Bluetooth permission, at least for Android.

Some brain dump comments below:

Good

  1. iBeacons should be both fast and reliable for geofence detection in small ranges. Excellent for “car in the driveway,” “person at the front door,” or “person in the living room.” And with Beecon+, you can define a custom distance as well.

The custom distance thing is really a big deal. I have been working (on Android) to map my home with overlapping beacons to triangulate each room. I am using the Geohopper USB warts, which I just plug into outlets I’ve converted for USB 5V. Ideally, I am shooting for knowing what room a cell phone is in, in every room in my house. Thus far it has been very accurate - but I have not glued the multi-beacon sensing together yet in Tasker.

  1. they don’t toggle for distances other than “out of range.” You could certainly have your lights come up when you to the house and turn off again when you leave. But if you want to use them for Very Close switches, you need one for on and one for off. Or have a metal box to drop over it to force it “out of range.”

I have lobbied Tasker and some of the plugin guys to allow RSSI detection inside BTNear and some of the other Tasker methods. There was a lot of interest, so hopefully you’ll be able to cut out the app and use Tasker directly to do this.

  1. They don’t work great with Android. iOS detects iBeacons at the operating system level, which is both easier on the battery and means the receiving station app can be set to work even when it’s closed. Android’s native functionality requires that the receiving station app be open in order to detect the beacons. I don’t know what other options there are for this, but it’s no coincidence that Beecon is only available for iOS.

Android has really been a chore to get up and running. There are far fewer beacon Apps for Android, and as you mentioned the OS doesn’t handle BLE as well. I believe Android is going to add Bluetooth to its location services – that is the logical thing for them to do – and there are several folks out there mapping BLE infrastructure. Tasker also seems to be interested in using Bluetooth in its “Fused Location” component. The big thing is battery. On Android you can pair to the GeoHopper beacons to cut down battery. I’ve been messing with dead reconning on my Tango tablet to get a high resolution GPS signal at the beacons, and then take a BLE measurement only occasionally. This is really efficient but way far away from production code. I’m pretty confident in 2-3 years this will be the “normal” way micropresence is done though.

  1. unlike a motion sensor, an iBeacon has an actual “exiting” event. So you don’t have to worry about the off event triggering too soon. It’s not based on time, it’s based on you actually moving out of range of one iBeacon (or into range of another).

One of the things I’ve made my ST do is reset the motion to inactive on adjoining sensors. I.e., Hallway motion, then Bedroom motion, immediately set Hallway motion to inactive. This is a simple tweak (requires a custom device) that dramatically improves motion detection reliance. Combined with beacon technology, I think I can get this even better.

Bad

  1. every use case depends on you either bringing the phone near the iBeacon or bringing the iBeacon near the detector (which could be a tablet). So it’s definitely not as good as a regular proximity switch for the “Very Close” distance use cases. If you forget your phone in the living room, it won’t trigger the iBeacon in the bedroom. And your phone has to have been set up with the receiving station app first, so it’s unlikely that iBeacons will work well for visitors.

This “split presence” case is nasty and very hard to deal with. I’ve experimented a bit with monitoring Wifi and having APs in every room – this is OK if your guest has your Wifi. I’ve also toyed around with monitoring cell repeaters in the house which works well but you need one per carrier and you have to root the repeater. And those solutions only incrementally help as well. Right now in my house if I can’t match virtual presence to a device / person, I just consider it an intruder :slight_smile: Lots of fun WAF there…

  1. they don’t toggle for distances other than “out of range.” You could certainly have your lights come up when you to the house and turn off again when you leave. But if you want to use them for Very Close switches, you need one for on and one for off. Or have a metal box to drop over it to force it “out of range.”

I think the solution you really want to try here is NFC. Its sort of the “fifth pillar” of location services. It only works at the inch or so level, but its probably more consistent than the metal box. Just put a $1 NFC tag on the table and when you put your phone on that tag, make Tasker turn your switch off. You can also accomplish the inverse pretty well.

  1. If your phone goes completely dead and is then recharged, it will be treated as an Arrived in Range event. Just something to be aware of.

I’ve been working on a SmartApp (Wasp in a box) that creates a virtual presence device per phone per room, and then also creates nested devices (Home → Upstairs → Bedroom → Closet). This generates about a hundred virtual presence sensors in my house (which has its own set of fun challenges) that make it easier for me to associate motion with occupancy and presence. So if I forgot to charge my phone last night, the last known presence sensor was on my bedside table and there was no motion outside of my bedroom, so the presence sensor knows the phone is still there. In the long run, this is almost definitely how microlocation will work at some level – though all the various error correcting is a beast (phone died, motion sensor failed to report, someone exited via a window, etc).

  1. They’re not cheap. If it takes two to handle the on and off conditions, that’s fifty or sixty dollars. Since I’m quadriparetic, there are a lot of use cases where that’s worth it to me, but for many people, the primary justifiable use will be at the geofence border for arriving home/leaving home use cases where you’ll only need one.

The BOM on the Geohopper device, minus the power supply, is about 80 cents. Its very conceivable in the next year or two that these will be so cheap that it will probably be easier to litter your house with beacons than motion sensors. (But ideally both). Being an early adopter is never cheap but its also regularly profitable.

  1. As of this writing, May 2015, they aren’t detectable by smart watches, only phones and tablets. The Beecon+ app does have an apple watch version, but while it lets you launch actions manually, the watch itself doesn’t have the receiving station. So the range is always relative to where the paired phone is, not the watch itself.

From what I can tell my Moto 360 seems to detect the Geohopper beacons just fine. I haven’t messed with any detection stuff yet - but it looks like this is one aspect where Android is further along than iOS. Not sure where Tizen is…

Random

Go into any retail store like a Walmart or Target and turn a Bluetooth scanner on. Its shocking to me how many beacons are already out there.

2 Likes

Yeah, the metal box thing is really a hack for two separate use cases. It won’t be important to most people. Although there’s also a third case with real possibilities.

  1. it’s dog-friendly. I’m quadriparetic, so I really prefer handsfree or touchless switches, as I have very limited hand function. NFC and RFID tags have proven to be too difficult for me, and if I drop one, they’re hard for my dog to pick up. It’s possible to attach the tiny tag to something bigger, but then it can be hard to get positioned perfectly.

The metal box idea is something that’s very easy to set up so my service dog can use. Flip boxes or something like a butter dish with a handle. He can open or close it, no problem. ( Although I would typically wrap the part he grabs in tape as he doesn’t really like the taste of metal.)

Why would this be any better than a conventional switch? Just because it could trigger multiple events or a mode change. And iBeacon plus box is still cheaper than a wired zwave switch. :wink:

But that’s a weird use case, I know. Still, very helpful at my house.

  1. ST, as is often mentioned in the forums, doesn’t have a lot of choices for tactile buttons. There are a few–harmony home hub remote, Minimote, aeon key fob, Securifi key fob, smartenIt 3 toggle switch. All of these except the Securifi cost more than an iBeacon. And the Securifi is so tiny it can be hard to use in the dark. So for the 2 in the morning " turn the dang lights on NOW" case, the metal box might fit. With the range set appropriately, the phone could be in another room. Or you could even use a receiving station app on a tablet control station in that room, maybe a wall mount on the other wall.

For people who care a lot about aesthetics, the box can be ornamental and just look like a decorative piece.

So this use case only exists because there aren’t enough other devices under $35 to do the same thing.

  1. I could also see this as a very practical “panic button” for a child or a physically fragile adult. Open the box, and the lights come on and maybe lights flash in the caregiver’s room or some other signal. Granted, ST itself isn’t reliable enough to use this for life and death situations, but as something more convenient than yelling or phoning, this could be nice. And of course unlike most panic buttons, you can customize it to anything you can control with ST.

And again because you can use the full range, the child doesn’t have to have a smartphone. I do think the ideal for this particular use case is to pair the panic button iBeacon with a receiving station app on a wall mount tablet somewhere. It could manage multiple beacons and it would always be in the right place.

So just some possibilities for the metal box scenario. I agree most people won’t need these, and for many “very close” use cases, NFC will be a better/cheaper choice.

2 Likes

So far I just read thru @JDRoberts detailed explanation, thanks. So this can replace using an iPhone as a presence device, correct? From what I understand so far is it can easily replace using the phone as a presence device and then more, this would be a good alternative for the problematic built in presence sensing.
So I assume I would have one of these iBeacons somewhere in my house and then have the app on my phone which would trigger it when I am close. Can multiple phones work off one Beacon?

Sorry for the stupid questions as this is all new to me :smile:

Yes to all of the above, as long as they’re iPhones and you buy the beecon+ app for $9.

You can install the app on multiple devices under the same license.

Not only that, you can choose to either have the same rules for each device or different ones. So one iBeacon, but it could turn on a different switch for each phone, because it’s the receiving station app that devices what to do when it recognizes the beacon. Not the beacon itself.

Cool. Right now I am just using presence for Arming and Disarming Smart Alarm and turning on a hallway light when all of us are away and at least one of us returns home and it’s night.

Right now I think I only need one to play around with and see how well it works for us. What would you recommend buying?

If you only need one, and you have a place to plug it in, the $25 GeoHopper is the best place to start, I think. You can’t buy just one Estimote, you have to buy a pack of three.

For your particular use case, another option is the Securifi key fob, which costs $15. It’s not automatic detection, but for arming and disarming an alarm mode, it’s a good solution for many people.

Thanks. I was looking for something automatic and was already planning on getting the keyfob as a backup. For $25 I think it’s worth a try to see if it works better for us.
I had bought one of these LightBlue Beans back when they were on kickstarter a while ago but it’s to over my head (still in the box), so the GeoHopper may be my best bet for now.

Thanks for your help.

A friend who is using iBeacons for home automation through Beecon said he saves battery life by putting an iBeacon in his car and using a wall mount tablet as a control panel inside the house near a front window. The tablet detects the car arriving/leaving and that triggers a bunch of stuff.

He also has Beecon installed on his phone, but keeps the regions disabled most of the time in that instance of the app, so it doesn’t drain the phone’s battery.

Then if he’s going out without the car, he has two choices: carry an iBeacon with him or turn on the receiving station on his phone.

For his kids, he just uses an iBeacon the same way people use the ST Presence fob, and puts it on the kid’s backpack. He also put one on the baby stroller. The one tablet at home (which is plugged in) detects everybody’s beacons coming and going.

Interesting ideas. Clearly people are starting to use these a lot of different ways. :blush:

3 Likes

@JDRoberts,

How has this been going for you? I was about to order the $25 GeoHopper since I still have inconsistencies with using our iPhones as presence detectors.

Thanks,
Scott

We’re still experimenting with it. Of the three people here, one was having battery issues with their phone running down too fast. Not sure why it was only that one person.

We are now testing having each person carry an I Beacon, and using a tablet at home that is plugged in as detector.

That won’t work with the Geohopper though, only with the battery powered I beacons like the estimates.

So I’m not sure what to tell you. For two out of three of us, the Geo hopper worked great. But for one of us it used too much battery power on the phone.

So this is likely one of those things you just have to try and see how it works in your particular set up.

1 Like

Thats perfect, thanks for letting me know.

1 Like

They killed my battery pretty good, but then again I now have 8 & I was developing against it. So I was pushing the app way more than a “normal person”. I haven’t tested it as a normal user just yet.

2 Likes

@davglass did you pair to the beacon or were you using it differently?

I used geohopper to find it, then paired it to Beacon+, then used it to ping the web endpoint on my SmartApp BeaconBacon.