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

I’m using two of these but wondered how everyone is dealing with the assumed state of the input boolean on HA restarts? You ideally don’t want it off or on after restart but to be ‘in limbo’ until it determines the actual states from the device. Any feedback on that appreciated.

[UPDATE]. I’ve enabled the Recorder function and am now using the https://www.home-assistant.io/components/recorder/#restore-state feature to restore the input boolean to the last known state on restart. That should work.

2 Likes

Well, yes. This will be much slower than a PIR. The point is accuracy for specific individuals, not overall speed.

Thanks for replying, this means that I have installed successfully?
Showing 100% at home, 100% at home far away, 0% only when away from home, and home range is small. A zero w is satisfied, can not achieve a zero w per room!

Sounds like you don’t need any more than one Pi. And it sounds like all is working!

Front up, thanks @andrewjfreyer for your effort and time you put into this project. I just received a rPi zero w today and was up and running in almost no time. Everything is well documented.

Now to my actual question. I have a bunch of Chipolo trackers which are ‘paired’ to my iPhone and are working as they should. I added their mac addresses to the owner_devices and as long as I turn off my iPhone’s bluetooth they are detected just fine. As soon as I turn the iPhone’s bluetooth back on they are gone.

Does anyone have an explanation for this behaviour? Can BLE trackers only be used with one devices (my iPhone in this case)?

I just noticed that the same is true for my wife’s Nokia steel HR watch.

Detecting the iPhone(s) works perfectly fine though.

When they are paired they will only talk to the paired device, so you would need to unpair them. At least that’s how I believe they work.

That is my impression too. But unpairing them contradicts their original purpose. So they can’t really be used for presence detection in my opinion. Very unfortunate. Same goes for watches and fitness trackers I assume.

They don’t need to be paired to your phone for presence tracking just on you or your keys or wallet or however you wish to implement them. They will continue to send out a beacon and if they are within range of your ble tracker it will detect them and assign them as home or not_home

In my experience, many devices will advertise only when they are not paired to a previously paired device.

Right now, presence BTLE tracking is not fantastic. The next iteration dramatically improves it, but it is a challenge to rewrite the entire script :slight_smile:

Still working on it!

2 Likes

Thank you for your pay, thank you! you are awesome!

1 Like

Great to hear that and thanks for your effort. As I am still only playing with it and not using it let me know if you need alpha/beta testing.

1 Like

Same here! :slight_smile:

@cgtobi & @Samuel - if either of you would like to see the progress, look for the ‘monitor’ project on my github. This is very alpha, and when I’m active I’m making 20 - 30 commits at a time, but you’ll get a feel for the difference of how it works. Tons of tweaking and option-adding still to do, but the general structure is in place.

I’d still consider that project pre-alpha. It is a complete rewrite.

1 Like

@andrewjfreyer thank you for this project. Have just implemented it on the Pi I have HA on, and a pi zero. Think I am going to need another zero to just completely cover my house, but it seems to be exactly what I am after to trigger some automation’s as soon as I arrive home, and to double check if I am away or not, as the annoying bug in the Unifi wifi and iOS is still there. Thank you again.

Hi,`

I installed according to instructions, I am not getting any readings when subscribing to topic on mosquito as follows: mlsquitto_sub -u xxxx -P xxxx -p 22 -t location/owner/garage/14:XX:XX:XX:XX:XX -C 3, the mqtt settings on the new RPIZ-W point to an existing mosquitto-stretc broker in the same network, what is the best way to check if the install worked, the xxxx and XX show redacted items

Gave it another try but as soon as I start the service it messes up my network: wifi connections dropped, Hue lights unavailable etc.

Try with mosquitto_sub -u xxxx -P xxxx -t 'location/#' -v to receive all messages with a topic starting with location.

-p 22?

That’s an unusual port to run a mosquito broker on. Are you sure that’s correct?

1 Like

Its actually 1883, I tried that one as well, 22 is the SSH port

Thanks, not receiving messages on location/# but something on stat/# , i did stat/# just to check