Here is a little interesting project if you are looking for presence detection to be used in your home automation & security system. Myself, I have since years been using Andrew Freyer's Monitor project.
How I am using it is described here: Use Bluetooth to scan for devices as a presence detector? - #15 by xx_Nexus_xx
This has worked so good & reliable, I was actually not looking for a replacement, but when I found a new variant, said to be a port of Andrew's work, now possible to run on an ESP32, I could not resist at least trying it
Even better, it is a port shared by RoboMagus that works with ESPHome!! (If you haven't tried ESPHome yet, well it is a simple way of using ESP devices for all kind of tasks, I say it is a "more or less no-coding" environment to program ESP devices) https://esphome.io/guides/installing_esphome
The component shared by RoboMagus is not yet merged with the official ESPHome release so some extra simple "things" needs be taken care of, i.e. importing it from github, see the example .yaml below
First thing I recommend you to do is to install or update ESPHome to latest version. I have ESPHome installed in both Windows, Linux and MacOS. Currently I use MacOS most of the time but the others are also working fine. And you need to have python3 installed, yes
New installations, run in command prompt/terminal: pip3 install esphome
Update existinhg: pip3 install esphome -U
Then verify your installation: esphome version
With ESPHome you define your projects functionallity and features in a simple way with a .yaml configuratíon file. So, if you try the one I have attached below, you first check that it is correct from syntax point of view: esphome config btclassic_example.yaml
After you have updated the configuration file with your own access point's ssid, password, prefered ip addresses for the device, your mqtt broker and data about your phone to scan (name and mac address etc), you can go ahead and upload it to your ESP32 device: esphome run btclassic_example.yaml
If everything works as expected, your ESP32 should now start to scan, looking for your configured phones and devices
What is great to see, it recognizes my iPhone correctly when it is in or out of reach. I have not tested the distance it can cover but it is a great concept since you can now have multiple cheap ESP32 devices distributed around to cover the whole area of interest
To integrate with Node-RED via MQTT (what else??) a simple flow like below can be used as a starting point. Number of use cases are just limited by lack of fantasy
Enjoy
Please change extension from .txt to .yaml after download btclassic_example.txt (1.9 KB)