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

what Bluetooth LE device would you recommend please? happy to buy something but I didn’t think you could pair to BLE devices?

I have several iBeacons and you cannot pair with them

Cheers
Mark

Could be very well out of topic, but now that Google Home bluetooth tracking is added, is there a way we could benefit from that into this in any way?

Also I noticed, Google Home bluetooth tracking is giving a rssi value for iphone without pairing.

1 Like

Using an undocumented private api that could change or be removed without warning… leaving that wel alone for a few months

1 Like

The only device I ever paired with was v2.1

I apologize if I missed it but is there a mqtt topic that can be published to to force a status refresh. Since depart and arrive publish status change, they don’t force a refresh if I restart home assistant so I stick at unknown until a status change or restarting the service on the pi(s) Thanks.

Here you go:

alias: Update MQTT sensors on startup
trigger:
  - platform: homeassistant
    event: start
action:
  - service: mqtt.publish
    data:
      topic: "location/scan/restart"
1 Like

Or you can run it with the Retain flag, so it keeps the settings in the MQTT server for you, so HA will always read them on restart too,

monitor -x  retain mqtt status messages

I just wanted to point out that Google home is able to track rssi values from iPhone.
I was just wondering if we can do something to get rssi working on Monitor as well, that way it can also function as a room-presence detection platform.

I’ve been reading this thread for the past hour now and I’m confused about using mosquitto and multiple rpi-zeros and HA. Do I run mosquitto on each pi-zero as well as the instance I have running on the HA server? Or do I just need the one on the HA server? My HA is running on a rpi3b+ with rasbian and HA in venv. Mosquitto also runs on the same pi.

Another question. Can I run monitor on the HA server as a slave? I have a big house that would need a monitor node at both the front and back of the house. Since my HA pi is at the back of the house I wondered if I could run monitor there as the slave.

One mqtt server.

Yes I can’t see why you can’t run as slave

Thanks for the quick reply/answer.

One more question if I may. What type of range are people seeing with the pi-zero? I know walls and such limit the range but I would like to detect presence when my wife or I pull up to the house.

Maybe a stupid question, but would Monitor create any wifi interference during scans? Is it purely passive? Asking because I used a similar program like this in the past and wifi in the area of my RPiZeroW suffered, although I’m not sure why.

1 Like

The developer made a lot of effort to program it in such a way that the wifi interference is reduced drastically for such kind of an application

1 Like

This is an awesome project, but unfortunately doesn’t work for me. For whatever reason, it creates a ton of interference like an older Bluetooth tracker project did with Raspberry Pi Zero W’s. Its mostly noticeable on my Harmony remote hubs. Using the basic remote control they give you, anything that is IP controlled is extremely laggy. For example, watching Roku, navigation gets delayed by a few seconds at a time. If I shutdown the RPi running this script (which is in the basement directly below the area I’m in), response time immediately gets better. Previously, I had one RPi in my detached garage and had similar degraded performance for two Ring cameras located out there. There is really no other good setup for this in my house to make this work and avoid the interference. I really do appreciate the hard work put into this project though.

EDIT: Just for clarification, I loaded a fresh version of Raspian Lite and installed this script per the instructions provided on the GitHub page. I placed it at least 15 feet from any wifi device too, facing out toward my driveway. Running an Ubiquiti EdgeRouter4 with 3 different UAP’s (1 on each of the house and 1 in the garage).

1 Like

im using a onePlus 3 and my phone has worked with this project without having to pair anything

really? I have a harmony hub and I am currently using 2 Pi’s and my remote seems to work just fine.

What settings are you using? Maybe there are too many bluetooth advertisements around you. I things @andrewjfreyer added a way to blacklist some macs that may be in your environment that do not need to be detected.

Basically default settings other than MQTT server and a few phones in the known devices file. I had the same exact issue before with another python script that did the same thing (not nearly as involved though). I can ‘sudo systemctl stop monitor’ and see my responsiveness come back immediately on my Harmony. I have another that is within eye sight (downstairs, fairly close to the RPi) and when I run monitor (or equivalent), I can even see the light going green to red to green etc. as if its losing wifi temporarily. I have a lot of Google Homes, 3 phones (1 per person), and some laptops and tablets. I wouldn’t say I’m an out of ordinary use case. I live in a single family home on 1/2 acre in a somewhat private street. House was built in the 60’s, so older, but no metal walls or anything crazy. My Unifi wifi is all upstairs away from the RPi’s as well. Its very reproducible in my house, but could be related to the environment.

This thread (yes it is long!) has a number of other people saying the wifi interference is a real problem, others say not so much. It is hard to discern any pattern, but I haven’t paid as much attention as some others have. A read of the whole thread might prove useful. It’s a bit of a slog though.

Is there anything you think that could be making a difference? Could it be the rpi zero malfunctioning? Mine on default settings doesn’t seem to catch any random advertisements…