[RELEASE] BTLE Presence Sensor (Tile Mate)

LOL i like the challenge and like you say "befor they are gone" which means ill end up doing this when one breaks anyway"

Plus they are huge! and not easily found in the UK.

installed all the wrong software.... back to the beginning!

I have a pair of those SmartThings Arrival Sensor's. I've converted them both to use a set of AA batteries for longer life and spend their lives inside our cars. However, they fall off more than once a month, each. It's easy enough to get it, us a phone/tablet to put the Hub back into Zigbee Include and press the sensor's button for 6 seconds. They drop right back into their "slot"... but after the 8th cycle of that, it gets old. These are the only Zigbee devices I have that fall off.

My car is in that situation now. The car is in the garage, but it says it's away.

Screen Shot 2021-03-02 at 12.05.08 PM

weird i have two of them and at two houses. the ones with the aa battery never have fallen off me network except when the batteries got bad after about 2 years. where do you have it installed in the car.. i found the best spot was the rear deck. with some velcroe on the botton of the battery case so the windows is right there above the sensor.. my wifes triggers almost 150-200 feet away to open the garage door.. i do have a zigbee repeater in the garage though. and some lightyfy garden spot zigbee lights out in front of the house.

Ive just invested in 4 tiles, so thats the route ive got to take now, but if i had any hair id be pulling it out about now. Ive installed all the software from the Domoticz link instead of hear so, im going to re format and start again.

if i ever get it running and working ill do a youtube vid so other non dev types can get it going more easily.

1 Like

That is probably a contributing factor. I don't have any dedicated to this activity. All my Zigbee repeaters are placed to augment the Hampton Bay Fan Controllers I have. They demand a close repeater, as most of us know. 4 Hampton Bay Fan Controllers == 4 Zigbee wall wart outlets acting as a repeater. They have no other function.. I don't use them as outlets.. well one I do, during christmas tree days. :smiley: I'll have to see if I have a 'spare' Zigbee repeater in my box of junk, I mean box of spares.

Change the threshold in test_beacon.py to be 8 or 10 seconds. Initially it'll show a bunch of entries, but then it should only show things that come back on repeating basis. This is what mine shows and the "Tag" entries here are actually my 3 tags.

$ sudo ./test_beacon.py
2021-03-02 15:25:00,182 - root - DEBUG - Ok hci0 interface Up n running !
2021-03-02 15:25:00,183 - root - DEBUG - Connect to bluetooth device 0
2021-03-02 15:25:00,188 - root - DEBUG - New Beacon d8:e0:e1:3a:xx Detected
2021-03-02 15:25:00,235 - root - DEBUG - New Beacon 5c:b8:43:38:24:xx Detected
2021-03-02 15:25:00,325 - root - DEBUG - New Beacon 4f:b1:4b:aa:83:xx Detected
2021-03-02 15:25:00,352 - root - DEBUG - New Beacon d0:d2:b0:7c:98:xx Detected
2021-03-02 15:25:00,355 - root - DEBUG - New Beacon e1:3e:8d:83:55:xx Detected
2021-03-02 15:25:00,366 - root - DEBUG - New Beacon 17:9c:cc:8d:d8:xx Detected
2021-03-02 15:25:00,393 - root - DEBUG - New Beacon 77:de:9a:ba:1e:xx Detected
2021-03-02 15:25:00,403 - root - DEBUG - New Beacon 4c:33:6e:39:c7:xx Detected
2021-03-02 15:25:00,523 - root - DEBUG - New Beacon 23:8c:05:d8:93:xx Detected
2021-03-02 15:25:00,633 - root - DEBUG - New Beacon 16:ac:02:c0:c9:xx Detected
2021-03-02 15:25:05,338 - root - DEBUG - New Beacon fe:31:0b:b0:c6:xx Detected
2021-03-02 15:25:12,150 - root - DEBUG - New Beacon c8:ae:c6:e0:dc:xx Detected
2021-03-02 15:25:17,365 - root - DEBUG - Tag fe:31:0b:b0:c6:xx is back after 12 sec. (Max 12). RSSI -72. DATA (101,)
2021-03-02 15:25:20,392 - root - DEBUG - Tag e1:3e:8d:83:55:xx is back after 8 sec. (Max 8). RSSI -73. DATA (60,)
2021-03-02 15:25:28,165 - root - DEBUG - Tag c8:ae:c6:e0:dc:xx is back after 16 sec. (Max 16). RSSI -76. DATA (-13,)
2021-03-02 15:25:41,069 - root - DEBUG - Tag fe:31:0b:b0:c6:xx is back after 23 sec. (Max 23). RSSI -71. DATA (101,)
2021-03-02 15:25:56,183 - root - DEBUG - Tag c8:ae:c6:e0:dc:xx is back after 16 sec. (Max 16). RSSI -76. DATA (-13,)
2021-03-02 15:26:40,254 - root - DEBUG - Tag c8:ae:c6:e0:dc:xx is back after 28 sec. (Max 28). RSSI -75. DATA (-13,)

Wrap the ones you're not testing with in tin foil and put them away from the Pi.

Hi Brian.

Ive been using the wrong software, i use domotics stuff instead of yours by mistake. so i was unable to alter the thresholds.

im starting again but i already have the mac addresses, would appreciate some guidance on the other questions though. :wink:

Network ID's don't matter at all. The only thing that matters is the name. All Network ID's will need to be unique. Home-Mark name implies that when the url is called using configuration above, it would trigger. Just make sure the endpoint URL gets updated as well. If you change your TAG_DATA names & location, the virtual device names also need to change.

Sorry, im struggling with this, i dont understand how it works.
do i install the stuff from domotics first, get the bluetooth working and then install your scripts?

Nope, I didn't do that. Go to the "Pi Installation" section

 sudo apt-get update
 sudo apt-get install -y libusb-dev libdbus-1-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev python-bluez python-requests

thanks, yes i got that far but and completed those 2 steps and i got to here.

ill re flash the card and start again.

im sorry im taking so much of your time Brian

My Bad, im getting this so i need to install more software, that when i installed the stuff from domotics

you have a 'common error' in your copy/paste of the check_beacon_presence.py code.

Verify the very 1st line begins with a #

!/usr/bin/python <-- wrong
#!/usr/bin/python <-- correct

for the test_beacon situation.. is the file there?? When I list out the directory, I get:

$ ls
check_beacon_presence  check_beacon_presence.log  check_beacon_presence.py  check_beacon_presence.service  test_beacon.py

Hi, i have some of it i think, problem is i know nothing about pi OS or how to load files. ive done what ive don so far from looking at how commands are done in the domoticts page and use sudo wget followed by the url of brians work. the url in his script dont seem to work so i tried the browser one instead.

This is what ive got so far.

this command in Brians instructions mentions bluez so i installed it from domotics, but your directory doesnt have it.

sudo apt-get install -y libusb-dev libdbus-1-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev python-bluez python-requests

You know about history, right?? You type in "history" and get a list of every command you've every typed.

Here's my history from just after I finished the initial build of this pi zero w:

hciconfig
lsusb
sudo apt-get install -y libusb-dev libdbus-1-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev python-bluez python-requests
ls
nano test_beacon.py
sudo python ./test_beacon.py
nano check_beacon_presence.py
sudo python ./check_beacon_presence.py
sudo python ./test_beacon.py
nano check_beacon_presence.py
sudo python ./check_beacon_presence.py

You don't get to see the results, but you can clearly see "my thinking" :slight_smile:

1 Like

thanks, i now have both of those parts working. i was getting a syntax error but i think ive sorted it

im getting tired now, ive been trying to get this done for 15 hrs, and thanks to you guys im almost there.

do i need to install this? check_beacon_presence
i know i need to do the service file but ill do that tomorrow.

now i know how to load the files it helps!

You can run it from where it is now. Just make sure the service file is updated appropriately to point to the correct path/file location.

I'm also not sure if a user with a Space in it will work "Guest 1" - you can try, but if that one doesn't work, try renaming to Guest1

Hi Brian.

THANKS FOR THIS ITS FANTASTIC!

so far its working like a charm, ive ordered another 2 Pi's for other areas and when i set them up ill make a youtube video for it.

Although now i know how to do it it very quick and easy to set up, if your new to pi and HE like me then its virtually impossible and would have taken me even longer to do without the support from you guys. A step by step vid will be useful for other newbies and let you have some peace!

This is working fine as far as i can see ill keep you posted on it.

I take it that the check_beacon_presence file manages the location of the python file and allows the service file to run it from a specified directory location? if so ill install it as you intended it to work, its one less thing to worry about and if ive installed in a standard way, its easier for help if trouble shooting. is this correct?

The service file is expecting that the files be stored in: /home/pi/git/BTLE-Presence, so just make sure that's where all the files are, or adjust these two items in the service file,

WorkingDirectory=/home/pi/git/BTLE-Presence
ExecStart=/home/pi/git/BTLE-Presence/check_beacon_presence.py

THEN follow these instructions:

sudo cp check_beacon_presence.service /lib/systemd/system/
sudo chmod 644 /lib/systemd/system/check_beacon_presence.service
sudo systemctl daemon-reload
sudo systemctl enable check_beacon_presence.service
sudo systemctl start check_beacon_presence.service