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

automation
mqtt
Tags: #<Tag:0x00007f1b9ac15b80> #<Tag:0x00007f1b9ac159c8>

#728

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


#730

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.


#731

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?


#732

Are you running beta?


#733

Nope! The latest stable


#734

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


#735

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=’’


#736

Format your code properly please.


#737

Is that what you were looking for?


#738

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=''

#739

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.


#740

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.


#741

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


#742

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


#743

Are you on monitor beta?


#744

No im on the normal version


#745

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.


#746

This looks like im already on Beta?

minitor%20beta

Do i edit: PREF_ARRIVE_TRIGGER_FILTER with sudo nano?


#747

Where can i find PREF_ARRIVE_TRIGGER_FILTER??


#748

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