Product idea: BLE phone sensing occupancy sensor

This is probably an idea someone has already discussed, but…
I really like the idea of occupancy sensors but they always seem to need you to move in the room too much to make them work. Now that all phones have BLE going most of the time it seems like you could use this to sense if someone is in a room or not. This is what I believe Tesla uses to make their phone key work.
The idea is that if a switch could register a MAC address for a device it could sense if that user was within a certain range of the device. Since most switches are close to a doorway, this might help with the trigger for on being close and off being much further away. You could even trigger user specific scenes.
This wouldn’t work for all rooms since the proximity trigger could occur on the other side of a wall from you, but for many rooms it would work pretty well. If you could directionally shield it, that could help too (is that a thing?). This might also require an app on the phone to work, but that wouldn’t be hard to do.

Also an interesting thought would be security. You could sense MAC addresses not registered. If you have a break in you would have the MAC address of the burglar. Not sure the court would admit this evidence though :slight_smile:

1 Like

If you’re DIY inclined:

3 Likes

Additionally Espresense: https://espresense.com/

Though it looks like room-assistant has a bit more to choose from.

3 Likes

These are great! Thank you both. I was completely unaware of these projects. I am running Home Assistant currently, so this is right up my alley.
I still feel that a more consumer focused product would be nice, but this lets me do what I was hoping to now.

I run room assistant and it works reliably well once I got through the insane initial setup time. Took over an hour to get each node set up (someone said I could have bulk done this somehow) but alas. Here is my config if you are interested:

global:
  instanceName: Master Bedroom
  integrations:
    - homeAssistant
    - bluetoothClassic
    - bluetoothLowEnergy
cluster:
  port: 6425
  weight: 99
  peerAddresses:
    - 192.168.xx.xx:6425 #familyroom
homeAssistant:
  mqttUrl: 'mqtt://192.168.xx.xx:1883'
  mqttOptions:
    username: mqttuser
    password: xxxxxxxxx
bluetoothClassic:
  addresses:
    - 'xxxxxxxxxxxx' #Kevin Galaxy Watch3
    - 'xxxxxxxxxxxx' #Kevin Note8
    - 'xxxxxxxxxxxx' #Christiana Pixel 3a
    - 'xxxxxxxxxxxx' #Christiana Vivoactive3
    - 'xxxxxxxxxxxx' #cailyns cell
bluetoothLowEnergy:
  allowlist:
    - 'xxxxxxxxxxxx' #Kevin Galaxy Watch3
    - 'xxxxxxxxxxxx' #Kevin Note8
    - 'xxxxxxxxxxxx' #Christiana Pixel 3a
    - 'xxxxxxxxxxxx' #Christiana Vivoactive3
    - 'xxxxxxxxxxxx' #cailyns cell

A few notes:

  1. Weight allows the closer to wifi node to be a master vs slave.
  2. BLE is faster (sub-second) for changes, while bluetooth is slower as it pings devices every 6 seconds (adjustable).

Works well for me, I can pre-emptively illuminate the bedroom when someone is walking that direction, which is pretty cool. Also great for when you aren’t moving but it knows you are there (watching TV in living room, won’t shut the lights off due to no motion for 30 mins or whatever).

2 Likes

Oh and I used RPi Zero W’s for my installs.

2 Likes

I was just about to ask what hardware you used, thanks for sharing your config! I have a few extra Zero W’s laying around, sounds like I have a new weekend project at some point.

1 Like

I am very happy I posted this! I wouldn’t have gotten all this great info otherwise. Thank you all. The Pi zero w’s are hard to come by right now, but I have one that I will start the testing with.
For anyone that comes across this I also found this helpful YouTube series:

Most of it is super basic, but well covered.

3 Likes

That’s exactly what I followed. I think it’s 3 or 4 parts.

Save at least 2 hours. It’s not plug and play by any means.

2 Likes