[RELEASE] BTLE Presence Sensor (Tile Mate)

I purchased a few new Tile Mate tags and was trying to figure out how to use them to tie in to Hubitat presence. I did some looking and someone had something similar with Domoticz, so I took this and adapted it to Hubitat, and re-used most of a presence app I wrote for Geofency.

I have a bunch of these lying around that have expired batteries; so I've popped them open, put batteries in them, and printed new cases from Thingiverse. Drop one in your kids bookbag, in your car (assuming you have a pi zero nearby to sense it).

I consider this beta for now, and it requires a Linux system with a BTLE device, and that Linux system has to be within range of the devices you wish to track. Worst case, you invest in a Pi Zero W for each area you want to track access.

NOTE: If you follow instructions for Domoticz, make sure you use the scripts from my repo as they have been tweaked to this implementation.

15 Likes

Great timing for me! I have been playing with someone's script that uses MQTT then I use Node Red to HE. Anxious to give this a shot.

I'll be playing around with this soon! My grand daughter is here right now... priorities! :thinking:

1 Like

Great - let me know if I can help. I have added a time_threshold for test_beacon.py to help you only see things that beacon at intervals > this threshold. I believe the Tile mate time is around 8-20 seconds.

Depending on how this works for everyone, one enhancement would be to have child apps for each virtual device and let you set RSSI thresholds for each virtual device. You only see RSSI reported if you're in REPEAT_MODE.

Would it be possible to use a BTLE usb device dongle on the HE itself? Obviously we would have to have a driver for it,

I have some other devices which I would like to integrate but can't be bothered with a separate Linux machine for this. I can imagine others users are similar to me.

No idea. I think the closest thing might be to get a Huzzah 32 and power it from that USB port.

2 Likes

Just came across my first problem. Mind you, I know very little about using a rPI. Not sure if I made a mistake somewhere but I had to use 'sudo python test_beacon.py' to run the test script. Found out how to do it with that link you said this was loosely based on. Glad you added that!

Going to try and add a beacon now.... :wink:

Okay, made it a little further and I'm stuck. Trying to get the script to run but getting an error on line 1.

I also ran it like you say to so you can see the error with that too. Again, probably something I'm doing wrong with the install.

Thanks

First line in that file should look like this:

#!/usr/bin/python
#   File : check_beacon_presence

$ sudo python ./check_beacon_presence.py

would also work.

1 Like

Any recommendations for a USB powered beacon? I want to use for presence in my car to open garage door and don't want or need it to be showing presence all the time where it could possibly lose it for a minute and inadvertantly open the garage door. My current battery-powered beacon will randomly lose connection and reconnect within a few minutes using the Bluetooth monitor script i have been testing.

I think I am so close but no dice. I am getting this in the Debug Window:

It looks like I am getting error 401. Does that mean that my token (a portion is blacked out) is wrong? I can't figure out how to cut & paste from HE into Nano when editing the file. I am still new to RPi.

Also, my local URL works but I get this when I use the cloud one:

Yes, 401 is unauthorized.

To paste, use <shift><ctrl>v instead of just <ctrl>v. Took me a while to figure that one out. :wink:

I use RadBeacon for this same purpose and it works great. Plug into your car’s USB port and it powers on with the ignition. Use an app like GeoFency with it.

Okay, got everything up and running and have made some observations. I only have one 'real' beacon to test with. It's not a Tile but It works awesome and fast. Great job!

But.... (isn't there always a but!) what I really was hoping to do is track my watches.

First test was an Andoid (TicWatch E2). I used a BLE scanner to find the MAC id and put in the info. Fired up the py script but it doesn't see it. Bummer.

Second test was with a Fitbit watch. After some Googling, I learned it only sends it MAC id out when not connected. So I turned off the phones Bluetooth, ran the scanner and got the address. Again, put in the info and ran the py script. Found it right away and showed me the RSSI. Great, right!? Nope, lol. Once I turned the Bluetooth on my phone back on, the Fitbit reconnected and stopped showing as present in the BTLE device.

After more Googling, I think the key here is that the watches have to pair to the device in order to keep receiving the data.

I will definitely use this for some key tags but the search is still on for the ultimate watch tracker! :smiley:

2 Likes

anyone know if this would work for CUBE? same concept as TILE, except the battery can be changed without destroying the case

Ok, I think I have it up & running for one battery beacon that I have. Now to let it monitor for a long time to see if check_beacon_presence ever says "not present" for beacon even though beacon is still at home. I do think I will feel safer with a USB-powered version for the long term but this is good to experiment. With the other monitor, it was on a Pi Zero and I am using a Pi4 this time. I don't know if that will help or not.

Thanks. I saw those and had one in my Amazon basket but didn't buy yet because it was 2-3 week shipping time. Such 1st world problems!!!

I set the “away” time to be longer and that helps with the false aways. Agree not 100%.

@brianwilson, would it be possible to get the RSSI value in the HE device? Might be able to do some neat things based on how strong or weak the signal is. Thinking things like Trash cans being in their place vs being on the street.

With that, check_beacon_presence.py running on devices thruout your house, and fancy triangulation calculations, you have room by room presence right? :slightly_smiling_face: