Either restart the pi, or simply take the interface offline and bring it back. I would also recommend changing the name_timeout to something larger than 5 seconds, effectively disabling the feature.
To refresh the bluetooth interface:
sudo hciconfig hci0 down && sudo hciconfig hci0 up
Hi @DamianFlynn - I think I have a workable solution for this feature that pairs in neatly with other needed improvements. My alpha version right now is able to detect anyone approaching our house that has a bluetooth LE device (phone, fob, etc). That said, these will be anonymous; BTLE only advertises with anonymous addresses. Working on making these more useful, but right now they’re a great trigger to search for new devices.
I had this working nicely… but started to get all sorts of problems with HASS - components not being found, HASS going down completely and requiring re-powering the pi.
Gone once I stopped the mqtt beacons. Anyone else have this?
Thanks Andrew, it’s a brilliant script you’ve done.
I currently have a setup where I use the presence.sh script for detecting iPhones and Apple Watches, works well. On the sideI have a Room Assistant running for iBeacons (placed in the kids school bags). I consider using presence.sh for the iBeacons as well, any thoughts on how RA and presence.sh compares ?
Thanks for the kind words! The good news is that the next version of the presence script will include full support for iBeacons and other BTLE sensors. Room Assistant is great software, and was an inspiration for the script. I found, however, that since it was limited to BTLE devices, accurate presence detection was difficult to achieve.
Hi, thanks for the ideas. I had restarted the pi several times without success already. I also have an Intel NUC which I got to work after removing behavior_preferences files and get it created from scratch. Will try the same with the Pi tomorrow.
Thanks, I’ve pushed the numbers up and it seems to be OK now. Great to hear that you have a fix on the way, would love to be able to put those numbers back down and speed up the presence detection. I’m going to test with -t1 and -t2 on my door reed and motion sensors, hopefully I can speed detection up that way.
Struggling with an MQTT problem while setting this up. My broker is locally hosted Mosquitto running within my Hassio instance. It accepts anonymous connections, but I have put a username and password on it for Presence to connect to. I have other devices working happily with it at the moment - a cloudMQTT bridge and an ESP device.
If i SSH into my pi zero I can see the following:
xyz@raspberrypi:~ $ journalctl -u presence.service
-- Logs begin at Thu 2018-05-10 00:02:19 UTC, end at Thu 2018-05-10 00:03:07 UTC. --
May 10 00:02:27 raspberrypi systemd[1]: Started Presence service.
May 10 00:02:29 raspberrypi bash[211]: Error: Network is unreachable
May 10 00:02:30 raspberrypi bash[211]: Error: Network is unreachable
And my Mosquitto log repeats the following lines repeatedly:
1525910591: New connection from 192.168.1.123 on port 1883.
1525910591: New client connected from 192.168.1.123 as mosqpub|540-raspberrypi (c1, k60, u'xyz').
1525910591: Client mosqpub|540-raspberrypi disconnected.
Hi ! Awesome work !
Got it working and commented out the line calling mosquito as I don’t need MQTT
Did you think about implemeting it on SmartThings ? I would like to push notifications to a virtual device on Smartthings. Would you guide me on what I need to do ?
This is mentioned in the first few paragraphs of the original post, but the gist is that room-assistant does not detect phones (since phones do not broadcast non-random beacon packets) and is reliant on BTLE beacons, which were not reliable or fast in my experience.