I’m thinking of using placing downstream bluetooth devices in multiple rooms to start/stop routines. I know that openhab has a bluetooth binding for the main system but I need secondary devices that reside in each room that can estimate proximity via signal strength and communicate this back to the main system via wifi/zigbee to trigger the routines.
Also looking for a device to place in the garage that will interface with car bluetooth presence for routines (e.g. no bluetooth to bluetooth = gate open and vice versa).
Is this possible? What hardware am I looking for for downstream devices?
Proximity of what devices and what signal type are they producing?
Phones or smart watches. Bluetooth dongles as last resort.
You want OH to detect the proximity of watches or phone via Bluetooth? Bluetooth is designed to be used by pairing 2 devices. I know of no devices that have Bluetooth radios and a Zigbee or Z-Wave one too. Likely Bluetooth & Zigbee could interfere since their frequencies are close together.
I’ve seen examples using multiple rPi’s or ESP32’s to do just as the OP describes. So connected to openHAB via WiFi.
Can’t find links now, but most examples I’ve seen have been outside of openHAB: I’m sure Google will bring up some results.
See reelyActive Smart Spaces Revisited. That thread is kind of old so be sure to look at their website too. But be aware, all modern phones spoof the BT MAC address. Consequently you can know that an iPhone is in a given room (for example) but you can’t tell that a specific iPhone is in the room as the unique identifiers change up frequently.
If you have android devices, FIND2 (maybe they are up to FIND3 by now) is pretty good at determining the location of devices to a room, works with WiFi, and doesn’t require placing a sensor in each room.
I’ve also noticed with Android 11 and iOS (don’t know what version), even the WiFi MAC addresses get spoofed now. So any passive sensor, be it BT or WiFi will not be able to uniquely identify specific devices, unless you turn the spoofing off in the settings.
As with most ideas like this, focus on what you want to achieve and don’t close off potential solutions by pre-selecting the technology (in this case bluetooth). This is often called the XY Problem.
Knowing that A phone is in the room is a good enough start. I would already be able to automate rules for presence of individual like lights.
RA looks like a decent start but I’m looking more for a 1-M type of solution where a central coordinator handles the input from multiple end nodes. I guess I could install multiple Pis with RA and do some backend processing on the OH server if all else fails.
I would suggest to go that way. I have done a similar setup with multiple ESP32s running OpenMQTTGateway, but phones, either iOS or Android, won’t do much good at all, with any recent OS changing the Bluetooth MAC address constantly, to just avoid such scenarios of being tracked (in stores, malls etc.)
The only reasonable solution I found are Bluetooth beacons, which most of them can be set to send out a beacon signal every 0.5 - 10 seconds and can be found in different shapes and sizes (stuck to phones?!?) Or possibly alternatively on a phone, a beacon app.
Each OpenMQTTGateway sends the received signal strength and calculated distance to openHAB via MQTT, so direct room location distance or even triangulation calculations can be made there.
Viewing, or trying to view and follow, the changing phone MAC addresses is immediately very disappointing, following beacons works very well.
I’m guessing you didn’t read up on how reelyActive works. That is exactly what it does. You have a central aggregator that individual nodes feed into to aggregate and interpret the readings.
I must have misunderstood the docs then. It is a little confusing and overwhelming.
I was under the impression that the processing pi-suite gets installed on the Pi as a downstream device. Does that mean that pi-suite is upstream and I would need other downstream devices (like the owl in one) to do the location pinging?
Or am I supposed to place multiple Pis around the house with pi-suite to function as downstream devices? Would be great if I could use ESP32s as the downstream devices as I need quite a handful and having multiple Pis as listeners is not very cost effective.
I’m actually really confused about the infrastructure.
When I ran this, I used an RPi 3 as the “main” device (I think they called this the Barn Owl) and RPi 0Ws as the down stream devices (I think these they call the Barnacles). Note that the “main” device can also be a sensor.
They also sell BT sensors that you can string through the house but they ended up being more expensive than RPi0s and require PoE I think.
They do not appear to support ESP32s for the barnacles.
But once again, if cost is your concern and all you care about is where the phones are, you should consider looking at FIND which requires no additional hardware and has very good accuracy. Though if you have iPhones it won’t work because Apple doesn’t allow apps access to the WiFi SSID names and signal strength required to triangulate the phone’s position.
I don’t have a tight budget, but I do need a good number (at least 5) of these downstream devices. The problem with the Pi0Ws is I can’t obtain them. It’s always this dumb limit of maximum of 1 unit per customer which means I have to pay a shipping charge on each unit. Doesn’t help that I’m not in the US and there are only 2 resellers for my country so the rest of them have to go through forwarders. The cost adds up linearly.
It doesn’t have to be an RPi. There are a number of clones and other alternatives that run Armbian. As long as it has BT onboard (or dongles) and runs a Debian based OS (which Armbian is) it should work with reelyActive. Maybe OrangePi or BananaPi or Pine or one of those will be more available.
I’ve taken a look around, there are so many clones but all with different specs. I’ve looked at those similar to the Pi0W in price but none of them are near the cost effectiveness of Pi0W.
Is there a reason why you stopped using RA? I am currently leaning towards getting a couple of ESP32s and fiddling around with openmqttgateway as those are only about 3USD with free shipping and no need for SD card.
- FIND works better and it’s way cheaper to deploy and use
- the MAC spoofing means I can’t know who is present which is information I really needed
- For knowing when someone is home the Network binding is sufficient and I don’t really have any compelling room specific automations
- I mainly deployed it because I already have RPi 0s and 3s scattered throughout the house to control things and attached to various sensors so even though I didn’t have a compelling use case, it was something I could experiment with without additional cost.
Ultimately the inability to distinguish specific phones was the deal killer. Though I think they may have an app now that could address that problem now.
I’m using a combination of OpenMQTTGateway (on ESP32) for MiFlora devices, the OH Bluetooth binding (on the P3+ which is running OH) and nut tags on key rings for (coarse) presence detection. It works but is a bit clunky - OH doesn’t handle the loss of presence and retains the last RSSI.
I wish the Bluetooth binding was a bit more expanded - it does the hard work of comms but doesn’t get all the data from the devices. I have to run OMG through node-red because OMG doesn’t use JSON very efficiently - it sends parameters separately 1 message for each parameter and OH can’t parse the messages
I’ve actually been using OMG for some days now.
You can apply JSON transformation to extract the RSSI for presence detection.
My problem with OMG is the extremely unusable RSSI values from the ESP32 which can fluctuate ±20dB for a stationary device.
Hopefully someone adds a filter onto the data.
I stopped using OMG for presence detection because of the fluctuations and reverted to the Bluetooth binding for that. I was using roughly 50% signal strength to turn on the outside light when returning home at night. I ended up with disco lights or nothing at all.
How do you use the bluetooth binding across multiple devices? I run the main OH on a VM in the server cabinet which is out of range of most parts of the house.
I have a smallish house so not that much of a problem but I have a second Pi which is also running OH in the shed which catches the back of the house and it’s publishing MQTT messages to the main Pi. I’m not using it for room presence. I keep on trying to get Tasmota to work with Bluetooth and that will be my preferred option – it’s getting close but not quite there yet.