[monitor] Reliable, Multi-User, Distributed Bluetooth Occupancy/Presence Detection

Would be cool if perhaps the BT can perform its scans then store the results and send via WiFi with a delay so they are not used at the same time.

I am testing to create a separate ssid for my 2 pis to see if this will help

I use the chromecast ethernet adapter personally. Makes everything a lot easier if you happen to have an ethernet port close by.

Can anyone help me debug why Monitor is now nowwhere near as responsive at detecting arrivals as it was for me six months ago? I had abandoned using this brilliant script because it was causing so much network interference but have recently started using it again with -tdr but otherwise the default settings. I’ve tried completely clean installs of both the beta and the master branch (but I haven’t tried a clean install within the last 10 days).
Basically Monitor is now taking about five minutes to detect my arrival whereas it used to detect me when I was approaching the front door! I was previously using the default settings also. I’m wondering what I could possibly try to find out what’s amiss.
Thank you!

If you don’t mind me asking. What method are you using to communicate with the august lock for lock/unlock commands? Are you using the connect/wifi bridge or some other method with bluetooth? Thank you for any help you provide.

what do your settings say in behavior_preferences? These are mine.

#ARRIVE TRIGGER FILTER(S)
PREF_PASS_FILTER_ADV_FLAGS_ARRIVE=".*"
PREF_PASS_FILTER_MANUFACTURER_ARRIVE=".*"

#ARRIVE TRIGGER NEGATIVE FILTER(S)
PREF_FAIL_FILTER_ADV_FLAGS_ARRIVE="NONE"
PREF_FAIL_FILTER_MANUFACTURER_ARRIVE="Google|August|Microsoft|Samsung"
1 Like

Well… This is where I have had issues with August.

Right now im using the Z-wave integration with my August lock. Unfortunately this method takes between 5-10 ten seconds to open the door after I send the command. I was using the homekit integration and had set up an automation on the homekit side that worked in conjunction with a input boolean in HASS. This worked but my homekit Hub is a tablet and my GF doesnt like her tablet plugged in all the time so I stopped using it this way.

It works for the most part with Z-wave , just a hair slower than I would like.

I have been trying to find a method to connect via Bluetooth. I have the 3rd generation lock that only integrates with purchase of the august hub. Ludicrously expensive thing as it only connects to one lock and no other devices. I have been looking for other methods ,but I am now starting to think I am just going to have to buy it. If I want hassio and the lock to talk.

do you not have a z-wave integration. A z-wave stick is less than the august connect hub. Or do you have an apple tv? you can use that as a homekit hub

No it is the older pill shaped model. It only has Bluetooth connectivity. I was looking for a way to use a Bluetooth transmitter on my server to send a command to unlock/lock without the hub.

oh in that case I would either purchase the August Connect or use the Apple TV / Ipad if you happen to have one.

My Raspberry Pi Zero seems to be unresponsive after a while. Maybe a day or two. I can’t login via SSH and the script doesn’t send any results. Is this a known problem?

1 Like

I want to document my experience with tracking two people with phones that simply do not advertise. I tried every beacon app and found it to be unreliable and clunky. So I’ll share the solution I’m using so far:

  1. The Monitor node is set to depart scan on trigger only.
  2. PIR sensor used to detect presence (will probably move to a robust door sensor, though).
  3. Some Node-Red magic:

The idea is that if the house is empty only arrival scans are needed. If we’re both home, only departures should occur. Otherwise I perform both with delays between them to account for the time we might be just outside the door.

To know if one of us is home and the other isn’t I’m using a template node (Both@Home) with this value:

{{is_state('binary_sensor.areks_presence', 'on') and is_state('binary_sensor.hildr_presence', 'on')}}

Which evaluates to True or False, the good thing about it is that you can modify this to account for more than two people. If you keep adding more sensors and it evaluates to false, you need to perform both scans.

Huge thanks to both @andrewjfreyer and @benjimatt for helping me so much and giving me the idea.

4 Likes

this happened to mine months ago. Not sure if it was my SD card or what but I had to reinstall. Has been successful ever since.

Phones in my house are
“manufacturer”:“Xiaomi Communications Co Ltd”
“manufacturer”:“Apple Inc”

I just put
PREF_PASS_FILTER_MANUFACTURER_ARRIVE=“Apple|Xiaomi”

?

Make sure you’re on the most recent version. If you are, I’ll predict you’re in a high-traffic area and the pi can’t keep up with all the adverts. Try running from the command line to see how many advertisements the pi is seeing and use that information to construct filters appropriate for your devices, per the FAQ.

Yes, the format is generally correct. However, the “manufacturer” reported in the mqtt messages may not be the same as the manufacturer output by btmon, which is what is used for filtering. Check which manufacturers are shown in [filter pass] or [filter fail] log entries.

Other issue (more probably me not configuring well), I see in my mqtt server log, lots of these

1551203374: New client connected from 192.168.1.238 as pioffice10520 (c1, k60).
1551203374: Client pioffice10520 disconnected.

where my PI (192.168.1.238) with monitor name is pioffice and I see connecting many piofficexxxxx and then disconnecting

I don’t have any CMD-RAND filter fail, but I have many filter-pass … and in none of it is coming the Xiaomi phone or or Apple phone, MAC address (all unknown manufacturer)

Sounds like your filters are entirely disabled, which is the default configuration. The Apple device will send an advert with Apple as the manufacturer, but I’m unsure whether the Xiaomi phone would do the same. To test, run monitor from the command line for at least 30 seconds for everything to settle down and for the log to catch up. Then, power cycle bluetooth on the Xiaomi phone and observe the next few advertisements seen. It may well be that they’re all “Unknown” but it’s worth a test.