All Projects → araa47 → hass_bletracker

araa47 / hass_bletracker

Licence: other
Custom python3 script for better location tracking on HASS. Also enables using iTag bluetooth device as a tracker + smart home button

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to hass bletracker

charger-card
A lovelace card for electrical vehicle (EV) home chargers and charging robots.
Stars: ✭ 57 (+119.23%)
Mutual labels:  hass
app-xyo-nodejs
XYO Archivist/Diviner CLI
Stars: ✭ 41 (+57.69%)
Mutual labels:  bluetooth
Aranet4-Python
Aranet4 Python client
Stars: ✭ 122 (+369.23%)
Mutual labels:  bluetooth
coBlue
Use Bluetooth Low Energy for remote commands, file transfer, Based on bluez Bluetooth protocol stack (BLE Terminal)
Stars: ✭ 41 (+57.69%)
Mutual labels:  bluetooth
spotifypiHome
"Install and go" multiroom music playback solution, with support for spotify, airplay and bluetooth.
Stars: ✭ 32 (+23.08%)
Mutual labels:  bluetooth
ansible-playbook-volumio-bluetooth
Pair your phone and stream audio to a Raspberry Pi running Volumio
Stars: ✭ 13 (-50%)
Mutual labels:  bluetooth
ESP32 Thing Plus
ESP32 Thing-compatible board using the WROOM module and a QWIIC connector.
Stars: ✭ 18 (-30.77%)
Mutual labels:  bluetooth
unijoysticle2
Bluetooth gamepad support for the Commodore 64 / Atari / Amiga, etc. (mirror)
Stars: ✭ 26 (+0%)
Mutual labels:  bluetooth
hassio-vagrant
Vagrant box running Hass.io / Home Assistant
Stars: ✭ 42 (+61.54%)
Mutual labels:  hass
ioBroker.ble
Monitor Bluetooth Low Energy beacons
Stars: ✭ 39 (+50%)
Mutual labels:  bluetooth
ionic-escpos-bluetooth-printer-sample
Sample use of ionic 3 with a bluetooth esc/pos thermal printer
Stars: ✭ 40 (+53.85%)
Mutual labels:  bluetooth
lhctrl
Power management of Valve v1 lighthouses over Bluetooth LE
Stars: ✭ 28 (+7.69%)
Mutual labels:  bluetooth
joyconpi
An attempt at emulating a Nintendo Switch Joy-Con controller with a Raspberry Pi
Stars: ✭ 24 (-7.69%)
Mutual labels:  bluetooth
rpi3-wifi-conf
A simple Python script to configure wifi over bluetooth for a Raspberry Pi 3
Stars: ✭ 112 (+330.77%)
Mutual labels:  bluetooth
react-native-bluetooth-state
📶 Answering the question of "Is my bluetooth on?" in React Native
Stars: ✭ 72 (+176.92%)
Mutual labels:  bluetooth
esp32 bluetooth classic sniffer
Active Bluetooth BR/EDR Sniffer/Injector as cheap as any ESP32 board can get. Works with Scapy ;-)
Stars: ✭ 347 (+1234.62%)
Mutual labels:  bluetooth
libopenaptx
Open Source implementation of Audio Processing Technology codec (aptX)
Stars: ✭ 106 (+307.69%)
Mutual labels:  bluetooth
Kaput
Kişisel araç takip yazılımı
Stars: ✭ 69 (+165.38%)
Mutual labels:  bluetooth
hass-addons
Hass.io Addon Repository
Stars: ✭ 16 (-38.46%)
Mutual labels:  hass
homeassistant-midea-air-appliances-lan
This Home Assistant custom component adding support for controlling Midea air conditioners and dehumidifiers on local network.
Stars: ✭ 101 (+288.46%)
Mutual labels:  hass

Home Assistant Custom Bluteooth Tracker

Introduction

The following repo is a simple python3 script that works as a bluetooth tracker on home assistant. This was made since I wasn't able to find a reliable platform that was able to get me location tracking and let my home assistant know when i was home or away without any false triggers. This script is optimezed to know exactly when you are home and away, and can be tuned to avoid any false away notifcations.

What the script does is it initializes a thread that keeps track of your bluetooth device. If there are any false scans that don't discover the device, it will wait for a period of attempts before marking your device as away. You can simply modify the variables in the config files to suit your needs, but the current values should already be good enough.

The script should work with any bluetooth device.

In addition to tracking whether the device is available when a bluetooth scan is made from a raspberry pi, this script can also can connect to some bluetooth trackers. Currently I use the itag device which is a cheap bluetooth tracker that can be bought online for next to nothing. An image of the device is attached below.

alt text

This itag device is a cheap tracker that you do not need to charge for a few months, and in addition to help with location tracking it comes with a toggle button. The extra feature is the ability to customize what this button does, with any action on your home assistant.

Currently the script only tracks one particular device, however if the ability to track more devices are needed, feel free to create an ISSUE and I can build it out when I find some time

What You Need

  1. You will require a raspberry pi with bluetooth. I currently use the same pi running home assistant in a python virtual environment.

  2. You will also need to run this as root or modify permissions to be able to use the bluetooth as any user on the pi

I am Running HASSIO

If you are running hassio, I currently havent figured out how to make this an add-on due to some permission issues with the bluetooth driver in hassio. A current method of still being able to implement this would be installing this on a raspberry pi w , and when you reach step 9, simply change the config of your hassio and point it to your raspberry pi w's ip address

Installation:

  1. sudo apt install bluetooth libbluetooth-dev pkg-config libboost-python-dev libboost-thread-dev libglib2.0-dev python-dev

  2. git clone https://github.com/araa47/hass_bletracker.git

  3. pip3 install flask bluepy requests

  4. Identify the mac address of the device you want to track, you can run hcitool scan

  5. Now you can modify the config.py file and set the mac address of your device in that file. You can also modify threshold and scan_sleep_time, but this can be tuned later on if you have issues with the current values. If you are using a normal bluetooth device skip to step 7.

  6. If you are using an itag device you may want to enable itag to True, and also set the require home assistant url, password, and entity_id if you want to toggle your smart devices using the button on the itag.

  7. Run the program by typing in sudo python3 app.py

  8. This should start an api on port 5000 of your device. You can simply send requests to the following url to check whether the program is working pi_ip:5000/api/search/mac_addr , where pi_ip is the ip of your raspberry pi and mac_addr is the mac address of the device in the config file you are tracking.

  9. Now that the tracker is active, simple add the lines in the configuration.yaml file attached in this repo.

  10. Your device should show up on home assistant, enjoy!

Notes

If you are using the itag device and enabled pairing, when you walk out of range from the pi with the itag tacker, it will start beeping. This is pretty annoying right now, but seems to be a firmware feature on the itag so I havent been enable to disable this. If you are annoyed by this noise, you could aways open up the device and disconnect the buzzer.

Future Updates

Currently this script only supports tracking a single device, but it shouldn't be too difficult to add multiple device support. Will be adding this in once I get some more time.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].