A Poor Man's iBeacon
a.k.a. I needed a quick solution for proximity without an iBeacon
During the Citrix Geek Speak demo I previously blogged about, we needed a way to kick off everything. Steve and I discussed a few different ways of doing this, but we landed on using proximity - meaning when Steve walked over to the IoT workspace with a particular device, everything would light up and we would be off to the races. The correct way to do this would be an iBeacon, but this was a last minute decision and we didn’t have one. So, we used bluetooth paring on a laptop. The rest of this article explains that part in detail.
Proximity with a Laptop
My first thought was to write some code to accomplish starting an Octoblu workflow using bluetooth proximity. There are some examples out there for the pieces I needed for this (bluetooth pairing, bluetooth signal strength, curl, etc.). But then I thought that there might be something already written. Sure enough, I found 2 solutions (for Mac) - EventScripts and Bluetooth Proximity Tasker. EventScripts was more robust and felt more polished, but I ended up using Bluetooth Proximity Tasker for the simple fact that I could control exactly how strong of a bluetooth signal I needed to start/stop an action. This was important as I didn’t know ahead of time what the signal strength would be like on stage at Geek Speak Tonight (especially once the room filled up with fellow Geeks).
As you can see in the screenshot above, there is a slider that lets me choose the signal strength. The green bar you see above the slider is my actual signal strength. So, I would walk around to see what my actual strength was and set the slider appropriately.
AppleScript Kicks off the Flow
So now that we have have the bluetooth strength thing worked out, all we need is a script to kick off the Octoblu flow. Recall from my previous post that all triggers in Octoblu have a HTTP POST URL. I just used this URL and curl to work the magic. Here is the script:
say "eye oh tee, work space. activated"
set theURL to "[your trigger URL]"
do shell script "curl -X POST " & quoted form of theURL
The first line is a quasi-phonetic pronunciation for “IoT Workspace Activated”. That is about as close as I could get using AppleScript. The next two lines actually kick off the Octoblu IoT workspace in a green state.
Conclusion
So, there you have it. That is pretty much the complete IoT Workspace demo from my side of the desk. Octoblu is a lot of fun and I’m experimenting with other ways of using this software for business, home automation, and just plain fun (like Legos). Go experiment yourself and have fun!