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

Yes, it doesn’t stop spamming, so that seems to be the problem. Is there currently a workaround?

That depends on your dongle, and I’m not sure how we could go about testing this. I’ll add a flag to not use the BTLE loop at all if you’re running -tad options.

Is btle also used for phones? Isn’t it only used for beacons?

It’s used for arrival detection for phones, yes.

ok, thank you for your assistance. I will buy another dongle or a raspberry pi zero.

Ok, that worked. I have sent you the hcidump and the btmon for good measure. HTH. Else let me know if I need to do anything differently.
Thanks again

1 Like

I’ve updated the beta with an exclusion such that if you are running with a dongle that doesn’t respect the duplicates flag, you can disable btle scanning altogether when you use -tad

Ok, looks like we’re in business. I’m getting iBeacons with UUID now :slight_smile:

Like this

0.1.998 10:56:04 pm [CMD-RSSI]  BEAC FD:5A:BC:7C:DD:F3 RSSI: -165 dBm (stationary)
0.1.998 10:56:04 pm [CMD-BEAC]  FD:5A:BC:7C:DD:F3 EBEFD083-70A2-47C8-9837-E7B5634DF521 31932 62421 Undeterminable
monitor/living_room/EBEFD083-70A2-47C8-9837-E7B5634DF521-31932-62421
 {
    "id":"EBEFD083-70A2-47C8-9837-E7B5634DF521-31932-62421",
    "confidence":"100",
    "name":"Undeterminable",
    "type":"APPLE_IBEACON",
    "rssi":"-165",
    "mac":"FD:5A:BC:7C:DD:F3",
    "report_delay":"0",
    "power":"-53",
    "movement":"stationary",
    "retained":"false",
    "timestamp":"Tue Feb 12 2019 22:56:04 GMT+0100 (CET)",
    "version":"0.1.998"
 }

FWIW, the UUID string looks like it has major and minor values appended as well. I think the docs don’t mention that yet but I guess it’s obvious if you watch the output.

So I’ll now update my MQTT topics and see how I get on!
Thanks again

yes, major and minors are appended at the end of the UUID

Hey guys it’s me again. Check the original post I’m replying to which is also mine to know more details.

Basically it seems monitor is not responding to arrival or depart instructions over MQTT (also tried with restart). I’ve been trying for days now and testing all the new versions with no luck. I’m assuming I’m doing something wrong because otherwise this will be reported by more users. I’ve recorded a video that you can see here https://d.pr/v/W0HLP0

I’m running monitor (v. 0.1.998) directly in terminal with:
sudo bash monitor.sh -Rtad

In the video you will see I’m connected to the broker on the window at the bottom and publishing messages using MQTT home assistant section. No luck at all!

I have 2 devices that are away and 2 devices that are home so I should be able to trigger both depart and arrival. It’s not even responding to restart or status command over MQTT. However I’m getting RSSI messages on the broker that monitor is sending, so connection details should be fine.

Anyone got new ideas? Thanks a lot!

There have been a few changes in the past day related to users who only use -tad - update the most recent beta and see if you’re still not seeing mqtt messages

I’m on latest one I believe, unless you just released a new one!

Hallo! Thank you to @andrewjfreyer I now seem to have (fingers crossed) an implementation of Monitor on my RaPiZeroW which doesn’t knock my more fragile WiFi 2.4Ghz devices offlne every few minutes. I’m using the beta branch and -tdr.

I am quite prepared to leave it at this. This is already MUCH better than the state of play last year when I had to abandon Monitor altogether in favour of Life360 etc because my Spark Cores were too sensitive to Monitor.

However…I also have some of those Bluetooth keyfob things which I was using with Monitor last year. My primary reason for using them is that they were a backup for in case the phone battery went flat then NOTHING would make presence detection work. Life360, Monitor, Owntracks etc etc - all of it requires the phone being ON to work. So I thought I’d program in a backup which was totally independent of the phone.

Now…if I re-introduce the keyfob to my setup…am I about to unleash havoc on my nice little ecosystem here?? Does anyone know if the keyfobs are MORE trouble than an iPhone in terms of how they interoperate with Monitor?

Huge thanks again to @andrewjfreyer

I often will push small updates under the same number if they’re quick in time - make sure to update with a git pull, regardless of the number version number you see in the logs.

Thanks for your help Andrew! I’ve just made a git pull just to make sure and tried again. Same result as in my previous video https://d.pr/v/W0HLP0

Couldn’t help but notice you typed monitor/scan/arrival instead of /arrive ? Or am I missing something? :slight_smile: (More than possible!)

1 Like

ah yes that’a definitively wrong but still the other are not working or receiving the commands in the log so :(. I wish it was just a typo haha.

@benjimatt,

Maybe its obvious to everyone else & I’m just dense, but why do you do the scan-delay-scan-delay-scan cycle? Why wouldn’t you just do one delay and a scan?

@yang3535 because at different times, we leave our house at different rates. For example, sometimes I get caught in a short conversation with a neighbor right on my stoop. In other cases, I wait on the stoop for an uber or lyft.

If we didn’t use @benjimatt’s technique - which I use and strongly recommend - we might not recognize that someone has left the house since monitor can still detect you when you’re just outside your door.

Personally, I use a node-red flow that looks like this:

3 Likes

Got it. Just seemed a bit brute force. I’ll have to think about it some to see if there’s a better way for my environment. Thanks.