-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tile Trackers on Raspberry Pi -- Investigating #163
Comments
From @Bit-River here....
from flask import Flask
from bluepy.btle import Scanner, DefaultDelegate
class ScanDelegate(DefaultDelegate):
def __init__(self):
DefaultDelegate.__init__(self)
def handleDiscovery(self, dev, isNewDev, isNewData):
return()
scanner = Scanner().withDelegate(ScanDelegate())
app = Flask(__name__)
@app.route('/api/search/<string:mac_addr>', methods=['GET'])
def device_scan(mac_addr):
scanner = Scanner().withDelegate(ScanDelegate())
devices = scanner.scan(3.0)
for dev in devices:
if dev.addr == mac_addr:
return("true")
return("false")
@app.errorhandler(404)
def not_found(error):
return("Not Found ", error)
if __name__ == '__main__':
app.run(host='0.0.0.0', debug=False) ## Presense / Tiles Sensor via Pi Zero Hassbian
- platform: rest
name: Car Keys
resource: http://192.168.18.143:5000/api/search/a4:e8:27:f4:3e:2a
Have questions for @Bit-River outlined here @Bit-River -- Hey - Thank you so much for this writeup! I think this MIGHT be what I'm looking to use my Tile Trackers for and hope you can help me out with some guidance.. I'm essentially looking to use Tile Bluetooth Trackers to identify if anyone is Before I order a new
If I can install this I believe I need to run Once my Where would I actually place the Thank you so much! I really appreciate any guidance you can provide. You can also reach me on Discord at Thank you! Cheers... |
How to figure out which Tile is which? |
|
|
|
I have read briefly, for me you don't have to do all that with python and flask, just use the bluetooth le tracker and you are ok, as long as you don't pair the tiles to the app ( based on your info ). configuration.yaml
known_devices.yaml
I'm using with my rpi2 + asus bt-400 (12€) and my mi band3. Also I suggest you to check for https://appdaemon.readthedocs.io/en/latest/ , python scripts in hass are very limited... |
https://community.home-assistant.io/t/bluetooth-presence-detection-without-raspberry-pi-3/35558/4?u=brianjking
The text was updated successfully, but these errors were encountered: