I want to swap around the ‘usual’ way of device tracking with beacons where there must be an app on the device that pick up the beacon and report back by MQTT.
Anybody tried a solution where there is a “beacon”/device in a room that pick up any passing BT device (like phones) and report their MAC address by WiFi to HA/MQTT server?
Then I could make a set of rules where I link the MAC to known devices.
Why?
I can’t run around to everybody using the rooms and install apps on their phones, but would love to know if and when they passed a tracker.
Monitor can do this on a Pi Zero W to find bluetooth devices. I limited it to known MAC addresses, but before that it was picking up visitors and the neighbour’s phones. The only down-side is it seems to be pretty good at causing 2.4GHz Wifi interference. The link has documentation on the magic used to see devices without pairing.
@tom_l that will assume the devices are connected to the local WiFi, but for instance guests of the house are connected to only a single WiFi SSID on one router (guest network).
I have it working on a 3B+ as well as two Zero Ws. I had to faff around a bit with the 3B+ because I’m also running Hassio on it. The author doesn’t really support it on anything other than the Zero, but I haven’t had problems (other than the mentioned wifi interference which may be upsetting my Hue bulbs and TP-Link switches for a few seconds every time it runs).
Do you mean the known_devices.yaml that HA uses? I would say no - as far as I can tell, monitor is completely independent of HA. You would need to subscribe to the MQTT messages that monitor sends and do something with them. I’m subscribing from Node Red and doing all the logic there to decide who is home; then I send that info to HA. The website has examples of connecting HA to monitor, but I haven’t done that, so I have no experience with it.
Having problems making HA subscribe to the messages. I can see them in MQTT but not from HA.
They are posted to topic ‘location/office’ and as I said I can see them in MQTT using MQTT Explorer, but if I try to use mosquitto_sub and location/office - I get nothing.
Changing to mosquitto_sub and location/# I get results in SSH…
It might be worthwhile posting a general question on receiving MQTT messages in HA and the problems you’re having - it doesn’t look specific to monitor, especially considering you can see them in MQTT Explorer. I’ve never done it, and personally find Node Red easier to get my head around.