I added bluetooth ble to my configuration, and as a result Home Assistant added a lot of devices to known_devices.yaml - so all is well and good. However, I have no idea what these devices are. If I do a mac address lookup, most addresses cannot be found. Is there any other way to detect what the devices are?
Other question, more or less related: I also bought some Tiles and added them with the Tiles component. But maybe they can also be detected as bluetooth BLE? And if so, maybe they update their location more often and more correct in the house?
Tiles work really well, but not with the Tile or BLE components
In my experience, the BLE component + Tiles crashes frequently and requires a HA restart and the Tile component is (phone) GPS-based, so useless if you want to use the Tiles for precise presence detection.
What I use is this: [monitor] Reliable, Multi-User, Distributed Bluetooth Occupancy/Presence Detection - on a dedicated Pi (it needs exclusive access to BT), but if you donât do anything else with your BT, you can also use it on whatever youâre currently running HA.
I still have some issues even with this (mainly the script exiting sometimes), but it can run well for days, notifies me when itâs down and doesnât require a HA restart to get going again.
Using this (as a home/not_home device tracker, not a Boolean percentage) and the Tiles, I am recognized instantly upon entering the house and tagged not_home about 4-5 mins after exiting the house, which is perfect, since it doesnât declare me not_home when taking out the trash
Hi johnflorin, thank you for explaining your solution!
I have an Intel NUC, and the BLE componentan sich works, itâs not like all the issues you can have with the Pi. I also so the monitor solution; at first sight it looks pretty hard to setup, but maybe thatâs not true. Still in doubt if I should go that route, or trying to stick to the BLE component and figure out what is what. If you would tell me itâs pretty easy to setup, I might give it a spin.
Meanwhile, I have abandoned the Tile component :-).
I also avoided MQTT for the longest time for fear of its difficulty
Overall it was pretty straightforward, I outlined what I did in post 33 here: Bluetooth LE Tracker issues
BTW, the BT issues I experienced were not on the Pi, but on a VM with an ASUS BT-400 USB dongle, the Pi has been fine BT-wise so far (with Monitor).
john, thanks for the procedure :-). Since Iâm not on Pi, I cannot simply follow it, I assume. Let me first see at home if standard BLE component can show the tiles.
Yep, if standard BLE works without crashing you should be good to go, but I have yet to see someone say that it works well for an extended period of time with Tiles. As for the guide, Iâd say you can definitely follow it, Raspbian or Ubuntu (I assume? on your NUC) is pretty much the same thing for the 3-4 commands needed for the script.
Even after all these years working as an IT-developer, I still hope Iâll be the first person to have a stable configuration out-of-the-box with the ble component #eternallynaive
I have the same problem with tile and given up . but if i recall a reddit post you should put the tile into broadcast mode (the one where it tries to find the app), connect to it and then delete the app or something and it should show up on the system. ive never got it working, which is sad. I think the mac adress for the tile might be hidden and thats why no other device than my phone can find it.
EDIT: also inside the known devices file you can usually find manifacturer and more information than the frontend supplies.
What worked for me was to pair the Tile to the app initially, delete the app from the phone, run the HCI scan from the underlying Linux terminal, find out the MAC (itâs easy to see which one it is, it will be the only one with the name âTileâ besides all the other crap MACs it sees), then use the MAC in the BLE component or Monitor script. I did nothing with the Tile itself besides the initial app pairing, it will always be broadcasting after that if you delete the app.
HCIscan is indeed working!
For future reference: in the Linux console:
sudo hcitool lescan
I found indeed the mac addresses.
For the moment I canât find them in known_devices.yaml though.
Now rebooting etc., see if that helps. The rest I have to test at home.
Thanks @johnflorin!
Ok, 1 succeeded, 3 to go! Something for tonight :-).
@johnflorin I guess you were right. I can indeed detect the tiles with the ble component, but home/away is not reliable. To be continued!
If you look at the HA log after being declared Away, do you also see an âUnexpected error when scanningâ entry?
Are you using the NUCâs BT for any other purpose? If not, it wonât cost you anything to check out the Monitor script, it works very wellâŚ
Well well⌠since you mention it (added debug for device_tracker):
Unexpected error when scanning: Set scan parameters failed: I/O error
13:16 components/device_tracker/bluetooth_le_tracker.py (ERROR)
I now run HA on the NUC, but when I look at the installation instructions for [Monitor], it seems to explain how to do this for a Pi. I wonder (I still have a Pi somewhere): should I install monitor on the Pi as something separate, or will it be better to add it on the NUC? Any ideas about that?
For Monitor, just follow the Pi steps from 7 onwards, because if you have working BT on your NUC youâve already done the other prerequisites.
The steps after 7 are all generic and apply to any Debian Linux installation, on Pi or otherwise.
I am only using the Pi because Iâm using the HA serverâs BT for communication with a Mi Flora sensor and Monitorâs author specifically mentioned not doing other things with BT while his script is running.
I tried to follow your procedure, but still stuck on it (I donât know anything about MQTT sorryâŚ)
This is my config in Mosquitto add-on:
{
"logins": [],
"anonymous": false,
"customize": {
"active": false,
"folder": "mosquitto"
},
"certfile": "fullchain.pem",
"keyfile": "privkey.pem"
}
Discovered MQTT in HA.
Then when I run monitor:
error: required package âmosquitto_pubâ not found. please install âmosquittoâ and âmosquitto-clientsâ.
error: required package âmosquitto_subâ not found. please install âmosquittoâ and âmosquitto-clientsâ.
error: minimum required mosquitto_sub version 1.5+ not found. please update.
error: minimum required mosquitto_pub version 1.5+ not found. please update.
mqtt_preferences:
# IP ADDRESS OR HOSTNAME OF MQTT BROKER
mqtt_address=192.168.0.29 --> should I use my duckdns.org or just the ip-address??
# MQTT BROKER USERNAME
mqtt_user=mosquitto --> where do I create/define this user? I created it in HA itself
# MQTT BROKER PASSWORD
mqtt_password=******
# MQTT PUBLISH TOPIC ROOT
mqtt_topicpath=monitor --> ok?
# PUBLISHER IDENTITY
mqtt_publisher_identity='' -->??
# MQTT PORT
mqtt_port='1883' --> unencrypted, but I disabled this one
# MQTT CERTIFICATE FILE
mqtt_certificate_path='' --> ???
#MQTT VERSION (EXAMPLE: 'mqttv311')
mqtt_version=''
Are you able to help me a little?
Hmm, you installed the MQTT addon in HA, but did you install Mosquitto in the underlying Linux server?
I assume youâre on a NUC, on which you have HA installed in Docker, so you need to login into the server itself (same place where you did the steps to install the Monitor script) and do this:
# get repo key
wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key
#add repo
sudo apt-key add mosquitto-repo.gpg.key
*#download appropriate lists file *
cd /etc/apt/sources.list.d/
sudo wget http://repo.mosquitto.org/debian/mosquitto-stretch.list
*#update caches and install *
apt-cache search mosquitto
sudo apt-get update
sudo apt-get install libmosquitto-dev mosquitto mosquitto-clients
I assumed installing it as addon in HA was indeed enough as installation, but itâs not, so it seems?
I use Linux Mint (=Ubuntu). So the procedure might be slightly different?
Yeah, there are 2 components: the MQTT addon in HA (which is the âMQTT serverâ in this situation) and the Mosquitto package in the underlying Linux install, which is the âMQTT clientâ that Monitor uses in order to be able to communicate with the âMQTT serverâ.
And yes, the user you need should be created in HA itself and its user+pass inputted in mqtt_preferences
Sorry for hijacking this old threadâŚ
Iâve been trying to solve the presence detection puzzle for some time. It would be great if the swing gates start opening when someone is approaching home. With the phoneâs gps, half of chance weâll need to wait 5-10 secs at the gates before they open. Not really ideal. So I followed this thread and purchased a couple of tile pro (2020), which has the longest advertised range (120m).
After paring, deleting the tile app and running âsudo hcitool lescanâ, lots of MAC addresses show up expect the âTileâ. So my guess is either theyâve made some changes on this new model or Iâm doing something wrong? Or does anyone happen to get this 2020 model worked already?
Any help would be appreciated.