Jump to content

Possible BT presence solution


Kevin Connolly

Recommended Posts

I've been researching a few options for presence detection. My main criteria were that I wanted something relatively secure and something where I didn't have to lug my phone around everywhere. This morning, while waiting for the bank to open I looked down and saw my fitbit in a whole new light. It's light, I wear it almost all the time, and it's Bluetooth! Long story short, I did a web search on finding a devices Bluetooth MAC address and came across a ruby program by Carlo Flores on GitHub. I wrote to Carlo and asked if he could thin down his program for an ISY and below is what he wrote back about an hour later (I did ask his permission to post his response and I'll also send him a link):

 

If you're doing multiple devices and zones (like many R-Pis or computers scanning bluetooth) it's easier to have it call to a webservice. In this case each of those devices would run bin/tracker-bt.rb and then send their information to the central webservice (webservice.rb). The central webservice then uses lib/location-by-bluetooth.rb to figure things out by zone.

 

But your use case sounds possibly simpler than that, so I put this together. https://github.com/flores/lotomation/blob/7d7cd904cdf434ce1871393c72784180ed8fc028/bin/tracker-bt-standalone.rb

 

In that script, you would replace "tracker_mac" with your FitBit's tracker and "device_endpoint" with your Universal Devices endpoint. It should let you control a single device by zone really easily, and you could run a bunch of these on a bunch of R-Pis or something per node.

 

If you want some help controlling multiple devices (which would just be iterating over an array of those devices) if in a zone, let me know and I can expand it. If you like this I might just break up these different bits of lotomation into so

Oh, and to run it you'll just need Ruby and hcidump. Something like this should install all the dependenices on a Raspberry-Pi that is already running Raspbian/etc.

 

https://gist.github.com/flores/bc823e5ff2eb213a6a53

Edited by Kevin Connolly
Link to comment

Thanks Kevin for mentioning this project and telling me about the ISY!  I'm planning on working on an update to track multiple Bluetooth devices per an idea of Kevin's (how cool would it be if your partner/roommate/family/etc could trigger various devices they pick?!) and when I do will post, but I've just been busy with other things and my laptop doesn't have Bluetooth to test with :)

 

Hi Michel.  I'll send a PM with my email. I'd love to try and write some stuff to work with ISY to make this as easy as possible.  Also, it sounds like iterating over the ISY nodes to control multiple devices is totally doable and I'm happy to add the auth stuff Kevin mentioned.

Link to comment

In theory, it may work. It's a BT transmitter/Receiver, but not sure, if you got it working what kind of range it'd have. Also, with Linux hardware you always have to first do research on what's compatible and what's not. My BT dongle has a CSR chipset and I believe that's compatible out of the box. Heck, give it a try...it may work.

On another note, when did you graduate? I'm BSCE 80.

Link to comment
  • 8 months later...

I've been researching a few options for presence detection. My main criteria were that I wanted something relatively secure and something where I didn't have to lug my phone around everywhere. This morning, while waiting for the bank to open I looked down and saw my fitbit in a whole new light. It's light, I wear it almost all the time, and it's Bluetooth! Long story short, I did a web search on finding a devices Bluetooth MAC address and came across a ruby program by Carlo Flores on GitHub. I wrote to Carlo and asked if he could thin down his program for an ISY and below is what he wrote back about an hour later (I did ask his permission to post his response and I'll also send him a link):

 

If you're doing multiple devices and zones (like many R-Pis or computers scanning bluetooth) it's easier to have it call to a webservice. In this case each of those devices would run bin/tracker-bt.rb and then send their information to the central webservice (webservice.rb). The central webservice then uses lib/location-by-bluetooth.rb to figure things out by zone.

 

But your use case sounds possibly simpler than that, so I put this together. https://github.com/flores/lotomation/blob/7d7cd904cdf434ce1871393c72784180ed8fc028/bin/tracker-bt-standalone.rb

 

In that script, you would replace "tracker_mac" with your FitBit's tracker and "device_endpoint" with your Universal Devices endpoint. It should let you control a single device by zone really easily, and you could run a bunch of these on a bunch of R-Pis or something per node.

 

If you want some help controlling multiple devices (which would just be iterating over an array of those devices) if in a zone, let me know and I can expand it. If you like this I might just break up these different bits of lotomation into so

Oh, and to run it you'll just need Ruby and hcidump. Something like this should install all the dependenices on a Raspberry-Pi that is already running Raspbian/etc.

 

https://gist.github.com/flores/bc823e5ff2eb213a6a53

Hi kevin,

 

I am extremely interested in getting this running by with multiple phones but Im still really noobish so i just want to verify the steps i need to do to get this working.

1. install dependencies on raspbian

2.change tracker-bt-standalone.rb to include my phones BT Mac.

3.save tracker-bt-standalone.rb in folder on raspbian and have it run at startup

4. change device endpoint to my isy-994's endpoint(can you show an example of this please)

5. once everything is running would it or could it change a state variable on the isy?

Link to comment

I had it up and running a while ago, but what I found while testing is that BT signal strength isn't all that reliable. The correlation between distance and strength isn't exactly linear. 

Since than I've been watching a product called Xethru and waiting for the price to come down. I also have my name in for the SDK of Navisens, but haven't heard anything as of yet.

Link to comment

I had it up and running a while ago, but what I found while testing is that BT signal strength isn't all that reliable. The correlation between distance and strength isn't exactly linear. 

Since than I've been watching a product called Xethru and waiting for the price to come down. I also have my name in for the SDK of Navisens, but haven't heard anything as of yet.

 

sorry about resurrecting an old thread. Xethru looks pretty cool. I hope home seer or isy integrate that one day as it looks promising. ive been working on presence detection for about a year now with horrible results. I don't know im the problem or what, but ive tried geofencing, Bluetooth and wifi individually and all at the same time and no matter what I do It works about 10% of the time. ive been pulling my hair out trying to get something working even 50% of the time. wifi was the most promising but detection is slow and dropouts last about 10 minutes. I figured if I combine your setup with wifi, it might work.

Link to comment

Hi glacket,

 

I have been working on the same thing for about a year on Android with Estimote BLE beacons (ibeacons) and producing unfavorably results with tasker.  Then a couple of weeks ago google announced Eddystone.  João Dias (creator of AutoApps tasker plugins) is now working on adding eddystone beacons to a new tasker plugin.  

 

The Estimote Android App has detection of beacons and looks promising. Their website says "Indoor Location requires 2 dev kits" so it is my assumption Estimote has indoor location working.

 

The following is a link to joao's community discussing Eddystone. You must be a member of the AutoApps Alpha Community on Google plus to see this post!

https://plus.google.com/+StefanSarzio/posts/jJdM7cjbiqj   

 

Link to Estimote website showing "Indoor Location requires 2 dev kits."

http://estimote.com/#jump-to-products 

 

Googles Eddystone Announcement 

http://googledevelopers.blogspot.de/2015/07/lighting-way-with-ble-beacons.html?linkId=15518166

 

I will be testing this as soon as it comes out...if it works better then anything I have now I will add it into my "Home Automation - Chaining Voice Commands" Project 

http://forum.joaoapps.com/index.php?resources/home-automation-chaining-voice-commands.75/

Link to comment

Watch out - I'd avoid the Estimote beacons until they sort out their security model.....

 

http://makezine.com/2015/08/04/beware-hackable-google-beacons-made-by-estimote/

Good to know, In my experience they have been getting better about security over the last year and are much harder to update without an account than they were a year ago.  Also I am not connecting to the beacons when using them for location so the URL issue is not a problem for the indoor location use.  Even with these issues someone would have to be in my yard to even attempt to overwrite information on the beacons...... So I would not use them to broadcast a URL, but I still feel completely safe reading power levels without connecting to the beacon. I'm sure many of us have Internet connected devices that are much more vulnerable to to attack.

Link to comment
  • 9 months later...

Good to know, In my experience they have been getting better about security over the last year and are much harder to update without an account than they were a year ago.  Also I am not connecting to the beacons when using them for location so the URL issue is not a problem for the indoor location use.  Even with these issues someone would have to be in my yard to even attempt to overwrite information on the beacons...... So I would not use them to broadcast a URL, but I still feel completely safe reading power levels without connecting to the beacon. I'm sure many of us have Internet connected devices that are much more vulnerable to to attack.

 

I know this is a rather old thread, but I'd like to resurrect it.  Did anyone ever find a reliable way to keep this running?

Link to comment

I know this is a rather old thread, but I'd like to resurrect it.  Did anyone ever find a reliable way to keep this running?

 

I tried many times but ultimately gave up as the signals where too erratic.

I think BLE indoor location may work in a store or conference hall but I do not think it will work in a small home (or any home with walls, furniture, multiple levels.).

 

I have had much better success reading wifi levels from 2 wifi range extenders  ( http://www.amazon.com/NETGEAR-Extender-Gigabit-Ethernet-EX6100/dp/B00HHRP11C/ref=sr_1_6?s=pc&ie=UTF8&qid=1464407440&sr=1-6&keywords=netgear+wifi+extender ) placed on opposite sides of my home,especially  5 GHz band, but ultimately not reliable all of the time.

 

 

My BTLE proximity detection works well on my RPi. I want to Implement it with KCK's Keypadlinc-like software. The only issue I have is annoying my wife with too much proximity awareness.

 

 

Sent from my iPad using Tapatalk

 

Can you explain your setup a little more?  Maybe I will try this out again...

Link to comment
  • 8 months later...

While I had some free time the other day I visited the EventGhost forum and found this topic which may be relevant to helping us with indoor location:

http://www.eventghost.net/forum/viewtopic.php?uid=20034&f=2&t=9139&start=0

 

The github project:

https://github.com/schollz/find

 

I have not had much free time lately to test, but it appears a new android app will be released soon:

https://github.com/uncleashi/find-client-android

 

Unfortunately apple users may not be able to use this for indoor location:

https://www.internalpositioning.com/faq/#can-i-use-an-iphone

Link to comment
  • 2 weeks later...

Can you explain your setup a little more?  Maybe I will try this out again...

 

Sorry for the very late reply. I moved away from the proximity and towards Alexa. I just tell her where what I want and she does what I need. The only other proximity project I am working on is a key fob system. That is mainly hardware though.

 

I can send you some snippets of code I was working with to make the detection possible if you like. I think it is in Python. It was pretty straightforward.

Link to comment
Guest
This topic is now closed to further replies.

×
×
  • Create New...