[Monitor] Reliable, Multi-User, Distributed BT Occupancy/Presence Detection

automation
mqtt
Tags: #<Tag:0x00007f47f786ab00> #<Tag:0x00007f47f786a9c0>

#547

First of all. Thanks @andrewjfreyer for all your effort and selflessly sharing it with us.

That said, I bought a Pi and got it running but apparently monitor can’t “auto detect” either of the known devices. I ended up setting monitor with the -r parameter and although it sometimes takes a quite a while to detect, it works.

How can I fix or improve this? I read the entire topic and saw someone saying something similar about his/her devices not broadcasting anything but ultimately found no solution other than setting up an app emulating a beacon which IMO kinda defeats the purpose of using monitor. Also read about triggers but at the moment I can’t use any ( will definitely work on that as it seems to be the ultimate fix ) but I’m curious why my devices aren’t working as the yours.


#548

Hey there!

I was wondering, living in a 2 story house, how would I go about interference between each node? E.g. Kitchen on ground floor and Living room above on the first floor?

Ideally would like to set up one in each room and can imagine it’ll cause tripping each one … Is there anyway to ‘power down’ the BT radio power for example or limiting the range?

If I strategically place and could potential direct the BT signal in a certain direction, I’d only need 0.5-1 meter range


#549

@daneboom
Did you solve this?


#550

What are your known devices? Note that the -r parameter has been removed from beta. If you want periodic ping, the presence project is much more appropriate.


#551

Two android phones running Android 7 and Android 8. And I’m using -r as a workaround until I (or you guys) figure this out. Or I’ll move to using triggers, so I’d like to stick with monitor as the ultimate solution.


#552

Have you been able to test that the Android phones actually broadcast bluetooth advertisements? I wrote on this earlier in the thread, but basically this:

Turn bluetooth off on the phones.

First ssh session:

sudo hcitool -lescan

Second ssh session:

sudo hcidump -a

You may see several advertisements in the second ssh window. Turn on bluetooth on your devices and you should nearly immediately see a new “random” advertisement. Turn bluetooth off, wait a moment, and try again. Hopefully you’ll see another different bluetooth advertisement when you turn bluetooth on again.

If you don’t see any advertisements, the phones may not be advertising at all.


#553

Will try when I get home. I apologize for not understanding the topic well enough, everything is pretty new to me. Thank you for your time, sir!


#554

Will try this too! Working well for you?


#555

Yup, I changed it to once a day (at night) because I thought it was causing false triggers but I found a different bug so I change it back to restart every six hours.


#556

You’re still on the beta branch, yes? I’ve made some recent updates that have improved stability of the beta for me.


#557

Well. No luck, tried with three different Androids (LG G5, OnePlus 3, Sony XA1 Plus) and none of them sent a packet no matter how many times I turned BT off and on. So am I out of luck?


#558

Hi @andrewjfreyer

My girlfriend just changed from an iphone 6s to a iphone XR and the new phone is not detected.
it does not also return a value when I do a name request : hcitool name (MAC)

Any feedbacks from the new iPhones ?


#559

Yes. Pair it to any Bluetooth device first. A car stereo, speakers, whatever. It worked for two people in this thread.

I wonder if we should do something like a FAQ. This thread has gotten pretty long.


#560

As soon as it connects to something, I get a “hcitool name” reply
But few moments later … I am unable to get an answer


#561

Is there a preference I can set somewhere to have the presence messages have the retain flag set? I’m running monitor via the systemd service.


#562

which is what I have done to my phones and none of them send an advert… I did test using the


#563

As others have mentioned, try pairing with another Bluetooth device first. It appears that iPhones do not enable the Bluetooth radio fully unless and until they have been paired with something else


#564

-x will retain messages


#565

Perhaps the real issue is that these devices need to pair to a Bluetooth LE device, instead of a generic Bluetooth device. To conform to the Bluetooth protocol they will have to advertise.


#566

Try with the --duplicates flag as well. There will be a lot more data, but you may be able to see the device reporting.