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

try
sudo journalctl --since "1 hour ago"
or
journalctl --since=yesterday

1 Like

Thanks almost, I found out. This creates a log.txt in the directory monitor

sudo journalctl --since=yesterday -f -u monitor.service > log.txt

Is it possible to avoid having a ā€œpublisher_identityā€ ? If I leave it blank, it takes the name of my raspberrypi

So instead of : $mqtt_topicpath/$mqtt_publisher_identity/$addr
I would get : $mqtt_topicpath/$addr

No, this is not possible now to support the majority of users that use more than one node of monitor.

Ok thanks I found a way with my MQTT bridge config

FYI I sent you my code modification to make it work with smartthings.

Thanks !

Anyone uses monitor also in garden?

BAsically detection in garden OR detection in house (OR of course none)

@andrewjfreyer, itā€™s been a while since I followed the development of your great script, and perhaps this has already been implemented: In the later Home Assistant versions a new Person entity has appeared. It supports adding a list of device trackers to a Person, and wonder if itā€™s possible to have monitor.sh report into a MQTT Device Tracker or similar ? (e.g. having home/not home support and a device_tracker entity).

Yup! This was implemented shortly after the person component was implemented. See this FAQ.

will this work for multiple monitor instances (and one phone)?

I started using this as a test with two Pi 3. Testing worked great and then went ā€œall-inā€ with three more Pi zero W devices.

The readme warned about 2.4 interference and I wasnā€™t concerned at the time. This morning I happened to load my Unifi console and noticed that many devices were having trouble. Once I stopped the service on all 5 Piā€™s the Unifi reported things were okay again. 5 ghz devices had no issue.

The issue I experienced is documented and caused by hardware limitations. I was wondering if anyone else is having this problem and how they got around it. I canā€™t get rid of all the 2.4 devices installed yet. From what I read a wi-fi dongle can help but donā€™t want to go down that route if it can be helped.

Brilliant news! - Iā€™ll give it a shot!

Thanks!

1 Like

Having finally got off my backside and tried out monitor, can I just say :bowing_man: This script is awesome, I just wish Iā€™d tried it out soonerā€¦

Itā€™s way more reliable than HAā€™s built in Bluetooth trackers, and by removing those from from HA my startup time just reduced by five (yes, five) minutes.

Now all I need to do is find a decent beacon device to drop in the car :smiley:

2 Likes

@Tinkerer Thanks for the kind words!

For your car, if you have a powered USB port, some users have found good luck with a cheap USB beacon. I have one, but havenā€™t had the time to install.

I canned the pi zeroā€™s for anything bluetooth and switched to a wired pi 3b+. Not the answer your looking for I am sure.

@shauder did that fix your interference issues?

I like using this script, works out well but I want something a little more robust than a Pi Zero. Honestly id like to run this with a bluetooth USB 4.0 adapter using a separate VM in ESXI solely for monitor (overkill I know but dont really care). There are much better usb bluetooth adapters out there than the pi zero realistically.
Think this would be possible @andrewjfreyer

@keith-michael
I personally use the chromecast ethernet network adapter. I dont seem to have much problems. I have seen the documented wifi / bluetooth issues that occur from both pi zero an rpi 3.
I really think the best options are

  1. USB Bluetooth adapter
    • disable onboard bluetooth
  2. USB WIFI adapter
    • disable onboard Wifi
  3. ChromeCast Ethernet Adapter
    • disable onboard Wifi

To disable any onboard pi adapter
sudo nano /boot/config.txt

At the bottom add one of the following lines
dtoverlay=pi3-disable-wifi
dtoverlay=pi3-disable-bt

Hi may I know the purpose of the beacon in the car?

Isnā€™t the phone already enough as a beacon when you get back home?

Asking to check if your case applies to mine

1 Like

Whatā€™s wrong with the pi zero?

Like which one?

I had to power them all off since I was using both the wifi and the bluetooth features. It seems using both at the same time will mess with your wifi network - the 2.4 radio. The problem went undetected for a few days since my phone is on 5. To get around this I can either buy a USB wifi adapter or run ethernet to another device like Pi 3b+. Not sure what Iā€™m going to do yet.

I do not experience interference, maybe because I have less monitor scans, or maybe I have less WIfi in my home?

I do have Zigbee and 3 WiFI AP though on same channel (plus 2 WiFi I can see from my neighbour), so not little. You may check your 2,4Mhz spectrum with your devices and those of your neighbour