Bluetooth presence detection using a PI zero

anyone played with this? pretty straight forward cheap solution

1 Like

I don’t know if you’ve seen this, but @iharyadi has made incredible progress in pulling Bluetooth tracking beacons (and other things) into Hubitat via his zigbee modules.

seems cool. i have some pi zeros laying around. how would HE know about it though?

MQTT integration until maybe I get motivated and write my first HE device driver :slight_smile:

here is the write up

Are you set on using Bluetooth or also looking into WiFi? I personally use [UPDATED] iPhone WiFi Presence Sensor to trigger certain actions based on if devices are present on the network or not

This driver works really well. The difference between the two though is you could put a Bluetooth sensor in all the rooms of your house. Then trigger events based off who is in what rooms. Lights and music can follow you and be set to your preference.


This exactly.

@dadarkgtprince - recommend watching @iharyadi’s latest video (linked to in my post above). He demonstrates how Bluetooth presence detection can distinguish between two locations that are about 1-2 feet apart. And his hardware lets him pull that data directly into HE.

I’m probably wrong because i haven’t been keeping track of the various MQTT developments on HE, but i thought that all of them were mqtt clients? And that there is no broker for HE. Is that understanding incorrect?

you may be right but even if thats the case then you could use node red to connect right?

1 Like

Or one of the MQTT clients for Hubitat. I'm just saying there's still a need for an MQTT broker. Not that your idea won't work - in contrast, it definitely will!

I'll have to check it out. I'm used to my Bluetooth being able to connect to a speaker across the house so I was thinking it would be the same, but I'll definitely check it out later to get a better idea of the capabilities

1 Like

He uses BTLE gateways that tunnel information through his zigbee environmental sensors. And BTLE tracking beacons.

Has anyone tried to get this working? I left a beacon sitting at home all day today and this is a virtual device responding to changes based on messages from the Bluetooth monitoring software via Node Red.

With this many times switching from present to not present and back when the device never moves in the house, the device is unusable for anything. I hope there is some setting I missed. When I got home, I did change the Max Retry Attempts from 1 to 3 in the behavior_preferences file. I can't tell if that did anything.

How far is the beacon from your pi? Depending on the type of beacon and obstacles between it and the pi the range may not be as far as you might expect and cause presence detection to fluctuate. I put together this last year and it's been working fairly well using cheap keyring style NRF51822 beacons.

I will try that other option. Thank you.

The beacon is probably 15ft from the Pi Zero W thru a single interior wall. The beacon I bought has adjustable Tx Power and is currently set to have a range of 25m (-4dBm) according to app.

Additionally, the file doesn't consistently stay running and will hit an error and stop.

I definitely need to go a different direction to get a reliable solution. I want a safe way to open garage door on arrival and don't trust the reliability of using my wifi. So far, BT is MUCH worse.

I can't get much further than about that (through 2 brick walls though) but its sufficient to detect leaving the house (provided we don't move the beacons too much around the house, in which case I'd probably need to have an extra detector). I also use an outboard dongle which appears to work better than the pi's internal BT.

So I think I may have solved this using Bluetooth beacons with a BLE gateway I found. Take a look here and let me know what you think: BLE (Beacon) Gateway Manager. I wanted to accurately detect the presence of my vehicles and then provide automations around (like opening/closing the correct garage door).