I’m working on my presence detection rules and currently have things rolling along quite nicely with but presence detection for me and my wife via owntracks and hping3, thanks to the excellent tutorials on here but am looking to expand this to include guests, (parents, cleaner etc)…
Everyone has different phones and I don’t want to have to keep up with them changing phones etc and I can’t ask them to install an app to track them, (not sure the cleaner would be interested for a start!). Plus not everyone in the house will be on my wifi, (cleaner), so I can’t use that for detection.
I also don’t like the idea of the generic motion detected / door opened etc = someone at home as that might not be someone I want in the house.
So, I’m rolling down the idea of giving people key fobs. Everyone that I want in the house will have a set of keys so a fob on there isn’t too much of an issue to them. I’m preferring Bluetooth over RFID as I really just want things to happen without user intervention - ie having to tap the fob somewhere on entry as in RFID.
I’ve trawled the community forums and seen lots of attempts and plans to do this but nothing concrete so before I go gung ho into this, does anyone have any experience in trying and reasons not to do it / experienced problems along the way.
I’ve got a RaspPi 3 so it has it’s own bluetooth and I’ve found these on ebay which should do the job
and then will add the Bluetooth binding and go from there, sure there will be a little bit of setting up, (I’ve obviously simplified the process here for ease of reading) and controlling but the principle seems to easy and makes me wonder why it hasn’t already been done!
I’m hoping that a tag will remove all the issues people seem to be having with different mobiles as it should just be a ‘dumb’ device and all I’m looking for is a fob id and present / not present and then I can get OH to do the rest.
If you are running on an RPi 3, I’ve found that the on board BT interferes with the on board WiFi so you might not want to run this detection on the same RPi as OH unless that RPi is wired or you have a BT or WiFi dongle instead of the on board ones. If you are not running OH on an RPi 3 then no problem with the BT bindings.
I think you either under estimate your skills or overestimate mine!
I’ll have a closer look at rA in the morning and see if I can make more sense of it. If it’s a relatively easy install then it’s worth a try before I go and mess around with some undocumented Bluetooth options…
I have been using ESP32 boards (£6 each) around the house listening for the key fob BLE signals, these are then reported to OH via MQTT.
I added a rule to determine the location of the key fob but this is similar to the rA rule.
A few things to be aware of:
Don’t register the key fob with OH as it will send an alarm when out of range.
The key fobs have a button on the outside and this gets knocked and turns off easily.
The key fob battery compartment can come loose.
The fob may be picked up in multiple rooms so you need to pick the highest signal.
Batteries go flat in a few months so keep a few spare.
Use the expire binding so that OH knows the fob is out of range.
There is a delay between entering the room and the fob being detected (5s to 2mins) although clicking the button on the fob sends a signal immediately.
I also use the iphone binding for location and combine this with the fob data so you know when you are in the area and then in a room, this is a good check and I also can check who left their keys at home (iphone location >100m away from home but fob in a room).
I have linked this to the Alexa binding for music when someone arrives home, welcome to each room and photos change on the screens (Echo show and spot) specific to each fob preference. I plan to add a drop down menu in OH for easy selection of preferences for each fob.
The ESP32 boards can be linked to multiple sensors in the room and also report this back to OH. I have temperature and humidity running (if >40C there may be a fire in the room). This could also be door/window or light sensors.
the ESP32 software detects the Bluetooth from the iPhone but the iPhone changes the mac address for Bluetooth all the time so cant be used to detect a specific phone.
With the iCloud binding it shows the location of iPhone and Apple watch but the accuracy is within 100m so not useful for room detection but it can be used to detect when you are home.
If you want to have presence detection without a key fob there is a project for face detection ESP32 cam but I am not sure how to integrate it with OH.
You might ask this on the reelyActive site which is a special purpose built system for doing this sort of thing. See reelyActive Smart Spaces Revisited for how to integrate it with OH and some of the experiences and limitations with the system.
In general, the biggest problem with a smart phone is many of them spoof their MAC address so that you can see that and iPhone (for example) is present, but not a specific iPhone is present.
Many thanks Rich fro the quick answer! I’ll dig a bit on reelyActive website!
By the way, here’s a bit of context: the project will operate in schools (elementary to high schools) and will aim at automatically calling roll for the students. I don’t really mind detecting smartphones, even if teachers will probably have one, as the students will be equipped with some kind of wearable for other reasons. These wearables will support BLE communication, so I’ll request the manufacturer to add the proper beacon/advertising function to provide for presence detection.