[RELEASE] BTLE Presence Sensor (Tile Mate)

Only if you carry a beacon around with you. You could use your phone as a beacon but again, you would always have to have it with you. I tried to get my Android watch to work with this but it would need to be paired with the rpi as it only broadcasts it's MAC when in pairing mode. No idea if that can be done or how to do it. :wink:

Subdermal beacon implant?

2 Likes

I would do it in a heartbeat! My wife and daughter... not so much.

I have been looking into those smart rings though. Could be an (expensive) option.

After looking at the code some, the Rssi is being sent over. Just had to add some code to the driver and send the rssi over to it from the app. :wink:

Screenshot 2020-08-23 at 7.04.32 PM

Ha, I just did the same thing after seeing your suggestion and updated it on github.

1 Like

Is it possible to add a time stamp at the end of this? I know nothing about python programming.

Can you give me an idea of what you want to do with the timestamp? Do you want that to be sent to the device in Hubitat or just print it out at the end of the above?

Just show up at the end of the line like "Brian - HOME - http://192....... 09-02-20 12:29:36"

If it is difficult, don't worry about it.

I just pushed an update with a timestamp at the end. You may want to adjust the timestamp parameters to meet your needs.

1 Like

I feel like I find myself searching the internet rabidly every few weeks trying to find the holy-grail of indoor positioning. This seems to be one of the closest attempts yet. I personally would have no problem purchasing a dozen RPi Zero, to make this work.

The issues I've seen before have been noted already in this thread, where many times devices are not visible. I was trying to play with Tasker on my phone to track each visible wifi network, and then build logic like signal is between 5-6 (a Tasker thing,) but it got me curious to search the web again.

Personally, I carry my phone in the house everywhere I go, despite having a TicWatch3 Pro, and Fossil Gen5 WearOS. I haven't dug deep enough yet, but do we think we could actually do some rudimentary triangulation with the current tech?

For anyone running WearOS, I just wanted to point out that there are already Tasker integrations like AutoWear that allow many aspects to be controlled. You could probably use that to force a BT reconnect, or perhaps force the watch onto WiFi and see what happens. Surely there's something that can be done from the integration to make it visible to the beacons. One example is I made it so my watches go into DND and theater mode when I turn on Sleep As Android on my phone. The possibilities are endless.

If worse comes to worst, I could just pick up a ton of cheap BTLE beacons, pair them to the phone for visibility, then use tasker to push the RSSI values over to HE or perhaps an intermediary running on a VM to do the math, then push the results to HE.

Then again, just setting up a Tasker/AutoTools script to shoot all Wi-Fi RSSI into some automations would probably get me nearly the same results without any additional hardware. Hrmph.

Now I'm looking into golang to build some software to take in this data for triangulation. Not going to be easy, that's for sure. I plan to make it so you can map out each room by walking around with your phone.

I'm an iOS person so I haven't gotten to play with Tasker, but if it meets your needs (and it appears that those on Android have more issues with presence than iOS), I say go for it. I bought a Pi zero W to integrate with this, but haven't gotten around to it.

Left clicking on your mouse also works as [paste] in an SSH terminal. EDIT: Sorry - didn't realise this thread has been up for a while!

@brianwilson good job on making a dedicated driver. I've been running exactly the same thing for about 10 months using maker API from this post which uses the same
python script BLE beacon tracker, sort of (Raspberry Pi needed)

As this will work on pretty much any bluetooth beacon as long as they're BLE 4 I believe, much cheaper options are available than tile mates unless you already have them lying around.

Also what would really be great is that if this can integrate data from multiple pi's around the house so that we can have a form of room presence detection as well based on RSSI. Would this be feasible or does the app already do this?

Same here -- looking to do room-granular detection.

RSSI is already there, and it's exposed as an attribute you can query against. I guess you'd need some strategically placed Pi devices, or Huzza 32, but for cost, Pi Zero's would probably be better. It's a shame the big online Pi resellers limit your ability to load up on these.


image

Thanks!

I was having a look at the driver to learn a bit more about interfacing with external software (I'm not a coder, just wanting to get a bit of a feel) and it seemed to me that your BTLE app uses the same of endpoints as Maker API.

As a test I attempted to link the BTLE driver to the pi python script via maker API (at the moment I use the built in virtual presence sensor device which works) but could not get any presence data passed through. I apologise for taking the thread on a bit of tangent but was hoping for a bit of help to understand why (maybe I'm just oversimplifying the links too much and it simply doesn't work like that!)

Not MakerAPI directly, but it’s an OAuth app and the BTLE python code is making REST calls to that custom OAuth endpoint.

I was trying to see whether your driver would actually work via maker api but for some reason the rssi doesn't get passed across from the python script when the beacon is in range, although when the beacon is not present it is correctly reported by driver (REPEAT_MODE is set in the python script for that beacon). Again, apologies for going off topic.

I'm not sure what you're trying to do with MakerAPI vs just using the integration I built. RSSI is sent over and updated if in REPEAT_MODE. It's the cmd variable.

url=url.replace('PARAM_CMD',str(cmd))
print str(name) + " - " + str(cmd) + " - " + str(url) + " - " + str(timestamp)

And output:

Brian_BMW - -72 - http://192.168.1.xx/apps/api/414/location/?user=Brian_BMW&location=Keys&cmd=-72&access_token=806621fc-6d62-xxx-xxx-xxxxx - 10-10-2020 10:03:27

Learning exercise on maker api for the most part. :smile:

I've got a couple of pi zero's lying around and will using your app/driver to make my setup a bit more robust as there are some spots in the house that are just a bit too far from my single BLE dongle.

1 Like