Since I started using Home Assistant I’ve been looking to create Automations based on room presence. At first, I tried to find an already existing room presence solution and came across a promising couple of them. Unfortunately, neither fit the bill. One used an unofficial Google Home API that was shut down. The other was a bit more promising but at the end of the day only worked as a binary sensor.
For the last couple of days I’ve been working on a DIY proximity based room presence detection solution that works with Home Assistant.
It uses Raspberry Zero W devices to track the proximity of phones, smartwatches, etc. via bluetooth. The relative proximity is determined by querying the RSSI (signal strength) of the tracked device using a combination of rfcomm and hcitool commands executed via a Node.js script.
Once the signal strength is retrieved, a proximity value ranging from 0 (closest proximity) to -100 (undetectable) is calculated and pushed to a MQTT Broker (Mosquitto) running in Home Assistant. From there, you can setup sensors to determine the presence in a room (or relative distance) of a particular user. These sensors can be useful for triggering Automations based on presence (like turning lights on when someone walks into a room, turning an AC off when a room is empty, and more).
You can find the project with through instructions here: https://github.com/jxlarrea/ha-bt-proximity
Hope some of you find this useful!