Automators 39: Automating iBeacons

Maybe a European group buy is in order?

Has anyone gotten a smart home device to work with Pushcut, as Rose was trying to do in this episode? I had the same thought when I did a Bluetooth scan. I got the UUID of my Eve Outlet Switch, but I have not gotten it to work with Pushcut yet.

I also bought the Blue Charm beacon on Amazon. I did figure out the somewhat confusing setup, and got it to work. But it’s very flaky. If my phone sits right next to the beacon, I will get a pushcut alert that I have left the beacon and immediately came back to the beacon at least once every 20 minutes. I think that’s a deal killer for me.

No. I did try it with my Apple TV 4.

For ‘home devices’, have you confirmed that they are definitely iBeacons and not just Bluetooth LE devices. iBeacons have to be broadcasting the BLE packet structure defined by Apple. Different services will have different packet structures, and so just being a BLE device will not necessarily make something an iBeacon.

For example, here’s a local scan of BLE devices that I could detect utilising BLE Scanner 4.0 on my iPhone. It’s an app for scanning for BLE devices, but you can helpfully configure it to act as an iBeacon, which I did with my iPad.

This shows quite a few different BLE devices.

But if I use an app on my Mac (Beacon Scan) that specifically scans for iBeacon devices, I get a very different listing that picks up my one test case in the local area.

You might ask if there’s a way to scan for if a BLE device is an iBeacon on i*OS. While you can, it isn’t necessarily easy for developers to do so, and there’s a reason you have to type in that UUID for the iBeacon rather than just scan it and select it.

3 Likes

Thx, i will some other device where services are shown.

Stephen, thanks - this explanation is really handy. A bummer, but really helpfu!

Has anyone used iBeacons or BTLE for pets? Specifically, the opposite of a pet locator, more as a way to deter a pet from going into a specific area? We have the buzzers (just vibrates and makes a beeping sound) that I think would be interesting to connect to something like this.

Examples:

  • Away from the garbage bin
  • Away from the stairs

This iBeacon was fairly easy to set up and use with Pushcut:

JINOU Bluetooth BLE 5.0 Programmable Beacon/iBeacon/Eddystone with nRF52810, for Android and iOS https://www.amazon.com/dp/B07FMSBLDG/ref=cm_sw_r_cp_tai_m3ocEbJ24VHS9

4 Likes

Hi

I am just curious does anyone else have a “welcome” home shortcut that runs? If so would you mind sharing the details? @RosemaryOrchard would you mind sharing details of yours?

Thanks in advance

1 Like

I just bought the same one and it arrived today. It was easy to set up and configure. During the podcast on iBeacons, I seem to recall David and Rosemary recommending some specific settings. Can anyone tell me what the settings were or where to get them? I guess I could zip through the podcast again and write them down.

Thanks for this explanation. I’ve reached out to a couple of device makers (www.trypura.com and www.zing.fm) to see if they could update their firmware to make their devices iBeacons. Feel free to explain to me just how difficult this would be for them to add to an existing device and to incorporate the control/update of the iBeacon within their existing apps.

We should add this as a feature request for any crowdfunded device we see…

I think the Pushcut app is a bit underdeveloped in terms of beacon functionality at this point. I also saw this same issue mentioned in Reddit. But I think they will eventually work it out. They seem like smart people (or at least a lot smarter than me!)

The reason why you are getting alerts when you shouldn’t is because the app thinks the beacon is gone. So, what could cause that?

1. Misaligned broadcast/scan:
-The beacon broadcasts it’s little UUID message according to the beacon’s configured interval. Let’s say you set it at the default 1000ms. So that means that the beacon will send out it’s broadcast every 1000ms (i.e. 1 second). The broadcast only lasts 3 milliseconds. In order for this to be “seen” by the app, the app has to be scanning for beacons at that exact moment. If the app’s scan interval is set to 1000ms and the scan window is 100ms long, that leaves 900ms of time when the beacon broadcast could be missed by the app.

Solutions:
-The app maker could increase its scan window or decrease its scan interval. (I think there are some issues created by the iPhone iOS also, such that the scan interval and window time is different when the app is in the foreground or background). This would use more battery power on your smartphone.
-You could lower the broadcast interval of the beacon to 500ms or 300ms or even 100ms. This would use more beacon battery power.
-In addition, you could also try inputting a more optimal broadcast interval into the beacon. The smart people at Apple recommend that you set your advertising interval to one of these odd-looking numbers: 152.5 ms, 211.25 ms, 318.75 ms, 417.5 ms, 546.25 ms, 760 ms, 852.5 ms, 1022.5 ms, or 1285 ms. It is a bit complicated to explain this in detail (something something math), but suffice it to say, these weird intervals work better. The bad news is that most beacons’ configuration apps don’t allow you to input such precise numbers for interval.

2. Missed broadcast due to interference
-Bluetooth and BLE does experience interference sometimes, so broadcasts might be missed from time to time. In my experience, this is not a big issue, but it exists. Of course, it depends on the household and number of bluetooth devices in use. More devices means higher chance of interference.

3. Unreliability of RSSI signal strength figures
-I am not sure if Pushcut is using RSSI to detect distance. I think the answer is no (but they should). But if they are, they might be looking for a specific RSSI figure such as “higher than -80” (just an example) to indicate that a beacon is “within range”. This is probably a good idea for them to do. But if they are only looking for a “higher than -80” RSSI to happen ONCE, then there may be some issues. RSSI figures are not exactly rock solid stable. You can put a beacon two meters away from your phone and measure the RSSI, and you will see it jump around from -80 to -79 to -90 to -82 to -84 to -78, etc. So what the app maker should do is to add some smoothing of these figures. A simple way is to take a moving average of 3 readings. Then consider that “smoothed RSSI” to be more trustworthy. Or the app could smooth but also throw out (ignore) obviously false numbers. There are a couple different ways to do it that would help a lot.
-Plus, if they did start to use RSSI figures, that would allow them to easily add an option of “immediate” (i.e. really close by), “near”, or “far” to the beacon notification setup. That would make it a lot more useful/flexible for various real world uses.

1 Like

hey, Pushcut developer here.

thanks for this detailed post, there is a lot of good information in there!

the main issue in this case for Pushcut is that pretty much all of the techniques you listed require the app to “run”. for iBeacon-based background/location triggers you need to hand off everything to iOS, with basically zero configuration possibility. iOS decides when you are close enough to “enter”, and when you have “left”.

this is obviously for very good reasons (you do not want every app do its own beacon ranging in the background) but comes with these drawbacks…

you can do a tiny bit of background processing once iOS tells you are close, but you might get killed whenever iOS feels like it. so the possibility to measure signal strength until you are in a certain range cannot really be done reliably…

WWDC is going on right now, I’ll be checking if there are new OS features coming to consider here ; )

2 Likes

Ok, that makes more sense. I have heard some grumbling about this issue from several iOS app builders, but my coding knowledge is very limited, so I did not quite get it. Thanks for educating me!

Just curious: Is there some way to specify to the iOS what you would like to consider as “entered”? In other words, can you specify to the iOS whether to use “immediate”, “near”, or “far”? (These are the original Apple BLE terms, so I am assuming they are part of the iOS internal ranging protocol…might be a big assumption on my part though).

1 Like

as I understand it, the “near/far/immediate” stuff is all done through “ranging” - which requires the app to actively run (at least in the background). you cannot tell iOS to wake you up when you are “immediate” for example, only when you are “in range”…

this has the potential issue that iOS will eventually kill your background process, leaving you with somewhat unreliable triggers (because you of “entered” the beacons region, but failed to get close enough in time, ultimately never triggering in this case…)

long story short, I decided that I rather have a less accurate but reliable feature. I found it would be really hard to diagnose and explain to users why sometimes things do not trigger for background timeout reasons…

if anybody knows how to do background beacon ranging in iOS reliably, please let me know ; )

You have probably seen this already (and it might be outdated), but just in case:

I’m finding that Pushcut only fires off a local notification for me, based on detection of an iBeacon, once I unlock my phone. Should it be able to fire off that notification even when the phone is locked?

I get iBeacon notifications in Pushcut when my phone is locked. Any chance you have the system settings for notifications to Pushcut not set to display on your lock screen?

Thanks for the thought, but I do have that set. They show up on my lock screen, but not until Face ID unlocks the device.