Best Presence detection

If your phone is VPN’ed to your home network it should show up as a local device. If you set up OH with EXTERNAL security it will not require user/password for the REST calls.

I wrote it for Linux but there is nothing about it that would prevent it from running on Windows, beyond the generic issues with running Python scripts on Windows in general. I’ve not done so so what if any problems you might face are unknown, but the libraries you need are available for Windows Python. It will print warnings about the lack of some of the other libraries that don’t make sense on Windows like GPIO, but it will still run.

I wish I could quantify that with an answer. I’ve the script running on an old laptop with an embedded BT (BT 3?) and I’ve played around with tuning it and haven’t really come up with settings that reliable detects my and my wife’s iPhone AND detects when the phone goes away (i.e. it will keep “seeing” the phone even after it is gone). I have a BT 2 dongle plugged into a Pi in the basement that has a similar problem only it is even more prone to see phones when they are not really there. The Pi 3, however, and based on reports from the guy who wrote the module and added it to my script, it works really well.

NOTE: The script works by measuring the signal strength the dongle reports between itself and the BT device. It adds a count if the strength indicates it is near and a different count for when it is far or absent. To tune you adjust an if/elit near the bottom of bluetoothScanner.py that compares the far_cound and near_count with each other and a threshold. So you can make it more sensitive to the device being near and less sensitive to the device being far or visa versa.

In practice, even the BT 2 dongle I have reaches at least to the three rooms around the device so it really isn’t great at determining a specific room so much as detecting which floor I’m on (e.g. if the main floor detector and top floor detector is on I’m probably on the main floor). Now you could potentially aggregate the sensor info in one location and which ever dongle in which room has the strongest signal would be a good indicator the device at least is in that room.

Of course that would only work if you keep your phone on you while you are home. This isn’t true for me at least so it would have limited utility though it could be useful to figure out where I left my phone (or the toddler has taken it).

If you want room by room presence detection, and have Android devices (iOS locks down the APIs needed for this program to work), you might be interested in this thread.

1 Like