Bringing up an old question, but I found the answer.
From the forums, it seems like the way Google Home works is by scanning for BLE broadcasts. BLE broadcasts give you rssi values.
However BLE broadcast only works on phones when they’re actively searching for devices, unlike beacons which transmit BLE advertisements every second generally.
The way [Monitor] works is by waiting for random (phones keep changing this) bluetooth advertisements from a phone which occur frequently from the phone. Once it sees any random advertisements. It then starts a name search asking specifically if there’s a “xyz” iphone out there transmitting random advertisements (by using the pre-entered MAC address) (Unfortunately this is a yes/no protocol rather than giving the exact rssi value.)
I hope it helps anyone else out there.
Just wanted to put it out there. As after a lot of reading online, Monitor seems to be one of the easiest to setup solution possible with a phone for presence detection.
I don’t think this means that they are out of range.
It just checked if they’re out, and they weren’t.
If you’re trying to test by turning off bluetooth then make sure you turn off bluetooth from the settings app not the control center. (Control center just turns off connecting to devices however transmission of bluetooth advertisements still takes place. Learnt it the hard way.)
After experimenting with other alternatives it seems like I am going to reset my pi zero to run Monitor.
However considering the cost, I would love to be able to use the same pi to add a Temperature and PIR motion sensor to the same pi zero w. Is that possible?
Sorry if this sounds pretty stupid, really new to this stuff. However I have definitely learned a lot.
I just came across this script and I’m very interested in tracking who is home and away.
First, does Apple Watch work well? If I’m awake, I have the watch on so it’d be a perfect tracking agent.
Second, can/does the script monitor signal level from any given phone/watch? If so, it shouldn’t be too hard to track a location within the house. (do a measuring run by wandering to each room and get general signal levels from various monitor units)
Third, does monitor.sh work only with Pi Zero W? I can only buy single units (for $12) and then pay another $12 for shipping.
I think that’s it for now, I’m sure lots more questions to come.
Yes, monitor works fine with an Apple Watch (tested with my Series 0 and my Series 4), although some users have reported issues. I use my phone primarily.
For some devices, an RSSI is reported yes. However, the error in the signal varies so much with environment that distance/triangulation measurements are not at all reliable. Disappointing, but true.
I’ve written monitor to require as few dependencies as possible. Anything that has bluetooth hardware that can also run btmon and/or bluez should work just fine. This is most *nix boxes.
@andrewjfreyer I just wanted to say thanks for all the massive amount of work you and other must have put into this project. Also thanks for the step by step instructions which I was able to follow without too much trouble. I now have monitor setup in a pi zero next to my front door. Using my phone for tracking and hoping this will trigger home more quickly than my previous setup which has been just using the bluetooth device tracker on my main raspberrypi running hassio. I’m also wondering if you would suggest running monitor on the pi running hassio to? is that possible? I have very limited understanding of the hassio setup and Docker so wouldn’t know where to begin. I also have a fairly small house and suspect its unnecessary.
I currently have no door sensor to send the depart message. but I assume that monitor sends depart after the timeout? as I see the confidence dropping over several mqtt messages once I turn off bluetooth. Although it takes quite some time to finally drop to 0. Is it possible to reduce this time?
Also I’m running with the default settings, which i assume is best for my setup?
What have you done to make it work with your Apple Watch 4?
I have tried to add the MAC address for the watch but also by scanning with sudo bash monitor.sh -b -g but none will work.
If I am using this address (monitor/raspberrypi/38:53:9C:XX:XX:XX) to track my device, would I need to change the “location/scan/restart” topic in your restart action to “monitor/raspberrypi/scan/restart” in my case?
I’m at my wits end trying to get Monitor to communicate with my mosquito broker. I keep getting “connection refused” in the Monitor logs (repeatedly) and in my hass.io mosquito broker I get “socket error on client ”. I’m running Monitor on a RPI3 B+ with Stretch and Hass.io on a separate RPI3 B. On my hass.io I have smartthings-mqtt-bridge communicating just fine with mosquito, so I know my broker is working just fine. I’m at a loss.
1545366772: New connection from 192.168.1.63 on port 1883.
1545366772: Socket error on client <unknown>, disconnecting.
1545366773: New connection from 192.168.1.63 on port 1883.
1545366773: Socket error on client <unknown>, disconnecting.
1545366773: New connection from 192.168.1.63 on port 1883.
1545366773: Socket error on client <unknown>, disconnecting.