During the course of the pandemic I spent a log of time learning about Bluetooth and implemented a novel
Bluetooth people counter for the Raspberry Pi. It won a $20,000 global health competition and I've continued
to develop it further.
I'm going to expand on this topic but here's a few quick pointers:
Mac Address Randomization
Cellphones are designed to be hard to track, they skip mac addresses at random intervals.
BLUEZ
BlueZ is the Bluetooth stack built into most Linux distributions.
SaltStack
Saltstack is a great way to manage a farm of Raspberry Pi or other Linux computers. I can run the same command
on 20 different Raspberry Pis spread across three countries with ease.
iBeacons
deWalt and Milwaukee make great stick on beacons.
Asset Tracking
I now have asset tracking for tools and dogs around our house or barn.
I've been working on home automation for over 15 years and I'm close to achieving my goal which is a house that understands where everyone is at all times, can predict where you are going next and can control lighting, heating and other systems without you having to do or say anything. That's a true "smart home".
An overview of the many sensors I've experimented with for home automation including my favorite under-floor strain gauge, through all the usual PIR, beam and contact sensors to some more esoteric devices like an 8x8 thermal camera.
Bluetooth sensing for home automation is a great proxy for people counting as it can detect and locate each cellphone in the house. iBeacons attached to tools, cars and pets can provide a 'find my anything' feature too.
Microwave doppler sensors can be found in some alarm sensors but there are also available very cheaply as a separate component. They offer exceptional range but suffer from false triggers requiring a probailistic approach to people sensing.
Optical-beam sensors are reliable and can cover a long-distance such as across a garage or aisle-way. When they include multiple-beams they have good false-trigger rejection.
In a home automation system we often want to convert a measurement into a probability. The ATAN curve is one of my favorite curves for this as it's easy to map overything onto a 0.0-1.0 range.
An if-this-then-that style rules machine is insufficient for lighting control. This state machine accomplishes 90% of the correct behavior for a light that is controlled automatically and manually in a home automation system.