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

Tags: #<Tag:0x00007fc40bc52f70> #<Tag:0x00007fc40bc52818>

I’ll be upgrading my phone to IOS13 today - i’ll check my monitor tonight and report back

2 Likes

Initial testing suggests no difference. I’ll keep and eye out but i have both an IPhone7+ and IPad upgraded and they seem fine. I am getting lots of prompts on the phone for apps to use Bluetooth though

1 Like

Hi, I keep on getting “Unknown”.
[CMD-MQTT] monitor/pihole/juri_mi3 { ... confidence : 0 ... }
[CMD-NAME] CD:2C:00:00:00:00 juri_mi3 Unknown
The dongle I’m using is pretty old, bluetooth 2.0. Might not this be the reason,though. Somebody knows why it’s Unknown? Thanks! nb. yes the mac is modified

Stupid question - how do I get monitor to run with a specific flag permanently? Does it remember the last used flag on reboot etc?

How is this working for you? I was running -tr on my master and -tad on my slave, but the slave keeps getting stuck with occupancy at 100 even when the master is at 0.

You use -u to update the service

1 Like

Is it possible to set pass filter for MAC address of devices and beacons (Nut)?

If I already have a MQTT server installed, can I piggyback off that and just install the client?

If you have already have a MQTT server installed that is sufficient. Just input the IP address of your MQTT broker in the mqtt_preferences file.

When I’m running the monitor script, I’m seeing several Apple devices (which is good, because I have several Apple devices) but none of the MAC addresses monitor is displaying matches up to the MAC addresses of my Apple devices. The same goes for the bluetooth radios in my vehicles. What am I doing wrong?

Sorry to bump this, but just want to get confirmation before I set up the second node. Thanks!

The MQTT broker is always the address of the MQTT broker itself. If you’re running that on the first node, then yes enter the address of the first node on the second.

Otherwise, yes, other than the flags you’ll most likely want them to be identical.

Thanks :slight_smile: :+1:

I experience quite often that confidence is reported as 0, even though my phone is literarly 1 meter away.

Any idea why?

How are we supposed to populate these values?
In mqtt_preferences, what are we supposed to do with the items that are empty? I already have MQTT running and populated those values below, but what about everything else? The documentation doesn’t really mention those values and if I need to do anything with them.

# IP ADDRESS OR HOSTNAME OF MQTT BROKER
mqtt_address=<ip of mqtt server>

# MQTT BROKER USERNAME
mqtt_user=<mqtt user>

# MQTT BROKER PASSWORD
mqtt_password=<mqtt password>

# MQTT PUBLISH TOPIC ROOT
mqtt_topicpath=monitor

# PUBLISHER IDENTITY
mqtt_publisher_identity=''

# MQTT PORT
mqtt_port='1883'

# MQTT CERTIFICATE FILE
mqtt_certificate_path=''

#MQTT VERSION (EXAMPLE: 'mqttv311')
mqtt_version=''

Your phone for some reason stops responding on time to the name requests. Read this: https://github.com/andrewjfreyer/monitor

In the “Advanced Configuration Options & Fine Tuning” section, take a look at Standard configuration options: And set PREF_DEPART_SCAN_ATTEMPTS to a higher value. That’s basically the number of times monitor will try to talk to your device before marking it as away.

1 Like

When I run sudo bash monitor.sh -b none of my iOS devices are showing up in the scans, though several items say they are are apple devices. I ran the following using my iPad MAC address

hcitool name 88:AE:07:79:FF:A0

And it returned iPad. I suppose I should add my devices to known devices, but why isn’t this and my other devices showing up with the monitor command? Where are the MAC addresses that are showing up in -b coming from?

Wanted to share one more use case / implementation that I put together with Monitor yesterday.

My wife likes to put her phone on airplane mode when she goes to bed which kills all of my automations as she flips to not_home. Middle of the night she may wake up and turns off airplane mode, phone connects to network, routines kick on, etc. My fix is going to be to build some more complex if/then statements to also include whether her car is home or not, which got me down the path of figuring out how to track car presense.

Both cars don’t have always-on power on any USB port, but they do on the OBD2 sensor. Picked up one of these for each car and added it to my Monitor configuration. Now I have a similar presence detection for cars as I do people (https://philhawthorne.com/making-home-assistants-presence-detection-not-so-binary/).

2 Likes

Hi Andrew. First of all thanks for a great project!

With the concept of MQTT trigger only depart scan, (wasp in a box), could you explain how you can use that to for example unlock your door upon your arrival etc?

is there a for dummies guide with node-red and explanation on how to set the flags? Is the done in the /ETC/ folder or can it be done through sudo bash monitor.sh -d -u for example?

Do your cars have Bluetooth for connecting to your phones?