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

I think when all your devices are home, there is no need for an arrive scan.

Sure, thatā€™s clear. However Iā€™m testing my setup by turning off bluetooth instead of going out of range all the time. I have door sensors that should trigger the arrive scan when I get home from being away and I want to know if they are triggered within reasonable time, because the preciseness of Monitor over WiFi/nmap is why I chose this solution in the first place.

Woow awesome, i got it working on a rpi zw i can track my phones and it works great when i test with: monitor.sh -td. Mosquitto is on the same Pi als Hassbian, to manually test i use:

Knipsel

When i listen to all topics on the hassbian pi with: mosquitto_sub -v -t '#', the result is: monitor/scan/DEPART (null) is thit correct?

Me and my girlfriend live in a apartment with only 1 entrance, which settings would work best if i only want to trigger the scan when i leave? Ofcourse then checking if my gf is home.

@andrewjfreyer really awesome project, thanks for all your work.

EDIT: extra question, how does the input boolean return to off when the sensor goes below 10?

EDIT2: Everytime i trigger a depart message it restarts the iphone at 100%. Is this normal behavior?

1 Like

Are you running beta?

Nope! The latest stable

Stable version have really been acting up for me lately. Going offline all the time.

Any help for setting this up to connect to my hassio MQTT? Itā€™s on SSL as https://hassio.my.org. Iā€™m getting in my mqtt logs:

1547408857: Socket error on client mosqsub/650-rpizerowliv, disconnecting.
1547408857: ACL denying access to client with dangerous client id ā€œmosqsub/650-rpizerowlivā€

My mqtt_preferences are:
# IP ADDRESS OF MQTT BROKER
mqtt_address=https://hassio.my.org
# MQTT BROKER USERNAME (OR BLANK FOR NONE)
mqtt_user=mqttuser
# MQTT BROKER PASSWORD (OR BLANK FOR NONE)
mqtt_password=mqttpassword
# MQTT PUBLISH TOPIC ROOT
mqtt_topicpath=monitor
# PUBLISHER IDENTITY
mqtt_publisher_identity=ā€˜living_room_bluetooth_monitorā€™
# MQTT PORT
mqtt_port=ā€˜1883ā€™
# MQTT CERTIFICATE FILE (LEAVE BLANK IF NONE)
mqtt_certificate_path=ā€™ā€™

Format your code properly please.

Is that what you were looking for?

FYI, Iā€™ve also tried the same as what I have setup for all the Sonoff switches I have connected successfully to my hassio MQTT broker/server with no change, still the same error in the MQTT log:

# IP ADDRESS OF MQTT BROKER
mqtt_address=192.168.1.100
# MQTT BROKER USERNAME (OR BLANK FOR NONE)
mqtt_user=mqttuser
# MQTT BROKER PASSWORD (OR BLANK FOR NONE)
mqtt_password=mqttpassword
# MQTT PUBLISH TOPIC ROOT 
mqtt_topicpath=monitor
# PUBLISHER IDENTITY 
mqtt_publisher_identity='living_room_bluetooth_monitor'
# MQTT PORT 
mqtt_port='1883'
# MQTT CERTIFICATE FILE (LEAVE BLANK IF NONE)
mqtt_certificate_path=''

Thanks for the better formatting!

I have seen this error message a lot in recent reports. No solution though.

BTW your first address https://hassio.my.org was wrong, hassio.my.org might have worked, the https:// is not part of an hostname or IP address.

As I say I have not been able to find anything on that ACL error.

Encountered this bug todayā€¦ A monitor process was using 100% cpu, so I restarted the service, then it ended up spawning hundreds of processes a few minutes later. Brought my poor RPi 3 to its knees! (using beta 0.1.816)

Thanks for all your hard work @andrewjfreyer, monitor is awesome.

Can you file a report on github with your configuration details?

Hi @andrewjfreyer ,

Im encountering some sort of Bug (i think). I have three phones registered trough:
known_static_addresses. My Iphone Xs (privet), my Galaxy S9 (work), and my girlfriends Iphone Xr.

I use monitor.sh -d and added the sensors trough your GitHub steps in HA.

When I restart monitor at night (to reset after this issue) and go to sleep i wake up with 100% occupancy on all three of the phones (perfect!), I work home a lot and when my girlfriend leaves, within 2 minutes her occupancy decreases to 0% (perfect!). The whole day goes by and even when i go out to get some food with only my Iphone I return home and the Iphone shows i have been away for 30 min and the Galaxy has been home.

That all works great and how its supposed to, but now comes the issue: As soon as my girlfriend arrives home, her Iphone is not found immediately or even after waiting It doesnā€™t. Then after a couple hours having diner etc I open up HA and see her phone on 100% and the Galaxy on 0%, while the Galaxy hasnā€™t moved since before her arrival.

Even when I turn off BT on the Galaxy or even shutdown the phone and restart, it doesnā€™t go to 100%.

In the future I only want to trigger monitor trough my front door sensor but its in order so i donā€™t have a alternative solution right now.

Do you have any solution for this? If you need more info let me knowā€¦

Extra information:
Rpi 3 - Hasbian 0.84.6
Pi Zero W - Monitor latest version

Are you on monitor beta?

1 Like

No im on the normal version

1 Like

Iā€™d suggest you try the beta. There have been a huge number of updates since the last ā€œmasterā€ release. The beta is very stable and Iā€™m likely to merge with the master branch shortly. One thing that is dramatically improved in the beta is arrival detection for a large number of tracked devices.

One thing to note, however, is that you should change the PREF_ARRIVE_TRIGGER_FILTER variable in the settings to something like: 0x1a|Apple|Samsung

This is undocumented right now.

1 Like

This looks like im already on Beta?

minitor%20beta

Do i edit: PREF_ARRIVE_TRIGGER_FILTER with sudo nano?

1 Like

Where can i find PREF_ARRIVE_TRIGGER_FILTER??

1 Like

You can add it to the behavior preferences file, or you can restore default preferences using -d

1 Like