This program allows for associating Tile trackers with Hubitat virtual presence devices corresponding to geofences.
- Can track any number
nof tiles from a given Tile account. - Can have any number
gof geofences. This translates ton*gvirtual presence sensors in Hubitat. - Geofences can be entered as circles or complex polygons.
- Can have exclusion geofences, meaning areas from where the app will ignore reported positions.
- Freshness of the signal depends both on a device (typically a phone with the Tile app installed) to see the Tile device and on how often this app calls the Tile cloud APIs.
- Accuracy is not always great. The position reported by the Tile APIs is the position of the phone when reported to the Tile backend it was within Bluetooth range of the Tile device, and not of the position of the Tile device itself. For example, any person with the Tile app installed on their phone driving past your house could detect the Tile sensor which would "move" the last Tile device location detected to somewhere on the road. If the Tile app is slow to report the position, then the Tile device will be reported as even further away down the road. Exclusion geofences can help mitigate this case.
- A Hubitat hub.
- A device, capable of running either Docker containers or Python, that is on the same LAN as the hub e.g., Raspbian or Windows.
- Maker API app installed and configured in Hubitat.
- A
Virtual Presencedevice created in Hubitat for each pair of (geofence, tile_sensor) that the app should update. - All of these virtual presence sensors are exported in Maker API.
Choose one of these 3 methods.
touch config.yaml- This will fail due to malformed config.yaml. That's intentional :)
sudo docker run --name my_hubitile -v "`pwd`/config.yaml:/app/config.yaml" vdbg/hubitile sudo docker cp my_hubitile:/app/template.config.yaml config.yaml- Edit
config.yamlby following the instructions in the file sudo docker start my_hubitile -iThis will display logging on the command window allowing for rapid troubleshooting.Ctrl-Cto stop the container ifconfig.yamlis changed- When done testing the config:
sudo docker container rm my_hubitilesudo docker run -d --name my_hubitile -v "`pwd`/config.yaml:/app/config.yaml" --restart=always --memory=100m vdbg/hubitile- To see logs:
sudo docker container logs -f my_hubitile
git clone https://github.com/vdbg/hubitile.gitsudo docker build -t hubitile_image hubitilecd hubitilecp template.config.yaml config.yaml- Edit
config.yamlby following the instructions in the file - Test run:
sudo docker run --name my_hubitile -v "`pwd`/config.yaml:/app/config.yaml" hubitile_imageThis will display logging on the command window allowing for rapid troubleshooting.Ctrl-Cto stop the container ifconfig.yamlis changed - If container needs to be restarted for testing:
sudo docker start my_hubitile -i - When done testing the config:
sudo docker container rm my_hubitilesudo docker run -d --name my_hubitile -v "`pwd`/config.yaml:/app/config.yaml" --restart=always --memory=100m hubitile_image- To see logs:
sudo docker container logs -f my_hubitile
Python 3.9 or later with pip3 required.
To install:
git clone https://github.com/vdbg/hubitile.gitcd hubitilecp template.config.yaml config.yaml- Edit
config.yamlby following the instructions in the file pip3 install -r requirements.txt- Run the program:
- Interactive mode:
python3 main.py - Shorter:
.\main.py(Windows) or./main.py(any other OS). - As a background process (on non-Windows OS):
python3 main.py > log.txt 2>&1 &
- To exit:
Ctrl-Cif running in interactive mode,killthe process otherwise.
- Set
main:logverbositytoDEBUGinconfig.yamlto get more details. Note: Hubitat's token is printed in plain text whenmain:logverbosityisDEBUG - Ensure the device running the Python script can access the Hubitat's Maker API by trying to access the
<hubitat:url>/apps/api/<hubitat:appid>/devices?access_token=<hubitat:token>url from that device (replace placeholders with values from config.yaml)
Style:
- From command line:
pip3 install black, - In VS code: Settings,
- Text Editor, Formatting, Format On Save: checked
- Python, Formatting, Provider:
black - Python, Formatting, Black Args, Add item:
--line-length=200