Bluetooth setup / (iBeacon) presence detection

I tried for about a month to try and get the bluetooth binding to work in openHAB and eventually gave up. But I did find this MakeUsOf.com article that I adapted. Follow the instructions to get everything you need installed.

Using the example Python scripts on the article I modified a Python script I already wrote to report the status of GPIO pins on the Raspberry Pi over MQTT to query for the presence of a device with the given Bluetooth address and report whether it is there or not. If you know the address you can see if that device is nearby even without pairing it with your computer. The article has a script to discover your device’s addresses.

I will eventually update the script on gitHub so the same script works for both. I also have some changes so it reports a Last Will and Testament (LWT) message so I can tell from openHAB when the scripts go down but not yet posted those updates. But if you want to see the changes for the bluetooth and let me know and I’ll post it somewhere you can get to it or update the gitHub.

The range isn’t all that great but I happen to have my server on the top floor, the garage controller on the main floor and the alarm controller in the basement so was able to put a dongle on each and have all three of them reporting BT presence. If any one of them report the presence of the device I count that person as present. It works pretty well.