Bluetooth Proximity Prototype - XPL Application
With the success of the USBMicro Switch/PIR prototype - I thought I'd have a crack at also building an XPL Bluetooth proximity application. One which simply fires off triggers for any bluetooth device found in the area.
It's obviously a good way to work out who's at home, especially if it's mashed up with PIR detection - so thought it would be a good little experiment which I could also definately build into my HA project.
Being an old VB6 guy - I went on a google search mission to find an active-x object to do all the hard work. I already had a USB dongle I bought a year or so ago (another eBay cheapy)
I found a control built for transferring files over bluetooth called ActiveBlue2 - which unlike others, also allows visibility of unknown (unpaired) devices. There's a shareware version available which times out - but doesn't look like a trial key is required if you're simply searching for devices! Just means I can't actually release this app - so may have to look at alternatives so I can share the app/code (As the object license fee is around AU$300!). Feel free to drop me a line if you know of any free alternatives I can use (Active-X)
Anyway - It didn't take too long to build a quick app as a test which:
- stores a list of visible devices in memory (simply used a list control)
- polls the visible device list every 10 seconds and adds any new devices it finds to the list
- removes devices that are no longer in range
- fires off a xpl trigger message (used sensor.basic - device:input) for any new or removed item.
Works great! Only problem is my phone needs to be left in discoverable mode - which isn't ideal - as paired devices always show up as connected - even if they're not in range.
A possible workaround is to look at the last connected time and build in some configureable timeout functionality into the application. I'll get back to this if there's any interest (once I've finished the USBMicro XPL project)
Labels: Bluetooth, XPL App, XPL Device
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home