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

We can work this out via DM so that we don’t add to this already lengthy thread.

Okay, thanks! I’m only tracking 2 devices at the moment.

Updating to the beta and restoring default settings seems to have solved the issues I was having.

I’m also interested in the answer to this issue, as I will soon be getting a door sensor and my situation is the same!

I’ve recently switched from presence to monitor. I have two mac addresses in the known_static_adresses.
I have one Pi zero and it runs everything default. It is places right at my front door.
The problem is that it takes too long to recognize when we arrive home. It can take up to a minute or maybe more.
I’ve tried lowering some numbers in the behaviour_preferences but no noticeable change.
I see some Undiscoverable devices scrolling. Can it be that they slow things down?

1 Like

when you say your situation is the SAME are you talking about needed and Arrival trigger AND a depart trigger??

the Arrive trigger is currently happening with random bluetooth advertisements, OR if you have a camera a fence sensor you could do an arrival scan based on this.

Depart trigger is easy and has already been explained multiple times (by me also) in this threat if this is what you are looking for

Yeah, both an arrival and departure scan when the door sensor is tripped. The same scenario @areks described. I’ve read the docs on Github, just not sure if it’s necessary to trigger an arrival scan or if the random bluetooth advertisement is enough. At the moment, it seems to only notice that I’ve arrived home around a minute after I actually got here :slight_smile:

ok ok I see, ill send you what I sent @areks

technically both scans kind of run at the same time.

The arrive scan is basically turned on once the service is started. once a depart scan trigger is sent it doesnt necessarily stop arrival scan but if it detects a new arrival is will Queue the Name scan of the device when the depart scan has completed.

It sounds like your main issue is arrival scans at all.
I personally have two methods of arrival. For my cases I like this project much more for the known Departure because its the only think that I can find that can truly say if im home or away.

for arrival I do have two instances of monitor running but I also have a VM (using powershell) that once I or my GF has departed the house it does a ping every 5 seconds. Once it has detected anything from a ping it triggers my arrival automations and turns off the service that controls this automation. I could also have it send an arrival scan if I really wanted to.

You could probably use the ping Component too if you want to stay within Hass but I would say not to use it for departs . it will basically go up and down depending on if your device is sleep or not.

2 Likes

Ah, thanks for that. That gives me an idea.

I’m using life360 for GPS location, so I might set up an automation to start arrival scanning periodically once the GPS location is within my home zone. I guess that would work. Either that, or just put a second raspberry pi closer to the door for better range

1 Like

Again, a reminder that the beta is actively testing new features. One of those features is an advertisement filter that is specifically keyed for detecting iPhones. If you have other phones right now, run monitor from the command line and toggle bluetooth on and off on your non-Apple phones. Look for [failed filter] messages and, in particular, note the flags and manufacturer of those messages. If you repeatedly see your phone popping up with a particular manufacturer or a particular flag, add those values to the regex filters in the behavior preferences file.

If you don’t see a repeated pattern, you’ll have to disable each filter by using the value: .*

NOTE: This is a beta feature in active testing and will likely change in a future release.

1 Like

Hello, I have just found this project few days ago, I am having some issue, I use a rpi3B+ to install monitor. It did scan perfectly, but I have 2 problem

  • The mqtt sensor did not updates the confidence when I restarted my Home assistant even the monitor is running.

  • Can’t seems to be have any rssi value publish through to this topic monitor/example/mac_address i only received something like this.

    {
    “id” : “XX:XX:XX:XX:XX”,
    “retained” : “false”,
    “version” : “0.1.675”,
    “confidence” : “100”,
    “name” : "blabla ",
    “timestamp” : “Fri Jan 25 2019 19:16:23 GMT+0800 (+08)”,
    “manufacturer” : “Apple, Inc.”,
    “type” : “KNOWN_MAC”,
    “rssi” : “”
    }

is this normal?

1 Like

Yes, this is normal. RSSI is not reported directly by devices that are scanned. RSSI features are in beta testing right now.

Any possible way to change the client id used for mosquitto_sub?

1 Like

Yes, I could add this. Can you make a feature request on github so I don’t forget? :slight_smile:

Curiosity… For phones that are being connected, I assume they will need to be paired to get any type of rssi reading?

1 Like

same problem. more than 2 minutes in my case (only 1 Pi 3B+).
It seems that only advertisement is not enough.
My solution:
1 new motion sensor and automation to publish mqtt message (…/scan/arrive), the script runs only trigger mode (with arg -tad).
Anyway, this is a handsome project, thanks to andrewjfreyer.

1 Like

Yes. They’ll have to be paired at least once. After pairing once, a maintained connection is not required.

What types of phones are you using? Are you on beta or master?

Just wanted to let you know that the confidence of my ibeacon is always at 100%. Looks like this was a bug back in October that was fixed. Wondering if it’s back. Running the latest beta. I’ll post in the issue that was posted back in october as well. Thanks!

I’ll check this out, see if I can fix this tonight

My monitor is always going offline for some odd reason. Any ideas?

image

  • platform: mqtt
    state_topic: ‘monitor/main/status’
    name: ‘Main Pi Status’
1 Like