This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.

The Homey Community has been moved to

This forum is now read-only for archive purposes.

How-To: presence detection using a Raspberry Pi 3 and a bluetooth phone/tag

You need:
  • Raspberry Pi 3 (or lower with Bluetooth 4.0 usb plug)
  • Phone or Tag with Bluetooth (always on..)
  • Homey with HTTP app
I am assuming you know your way around a Raspberry Pi and don't mind a bit of fooling around ;) For this to work you need to install the latest "bluez" library for the Pi as this handles the low level bluetooth stuff. 
Install bluez:
sudo wget
sudo tar -xJf bluez-5.41.tar.xz
cd bluez-5.41
sudo ./configure --disable-systemd 
sudo make 
sudo make install 

Now you need to install the proper python library:

sudo apt-get install python-bluez python-requests
With that out of the way you will need to find the MAC addresses of the tags/phones you want to track. Run the following python script with your phone bluetooth on visible (this is only needed for finding the MAC).
sudo wget
sudo python
Hopefully you will get the following output:
found 1 device
  XX:XX:XX:XX:XX:XX - Phone

Copy the MAC-address as you need it for the final script.

I am using a modified version of a python tracking board I found on instructables  and you can modify it easily.

As a final step you need to make a flow using the HTTP app. I am using a very simple GET request for presence HOME and AWAY. 

Ofcourse you need to edit the given requests in the and make sure it runs at all times. Good luck!


Sign In or Register to comment.