This program allows for associating Tile trackers with Hubitat virtual presence devices corresponding to geofences.
- Can track any number
n
of tiles from a given Tile account. - Can have any number
g
of geofences. This translates ton*g
virtual 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 Presence
device 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.yaml
by following the instructions in the file sudo docker start my_hubitile -i
This will display logging on the command window allowing for rapid troubleshooting.Ctrl-C
to stop the container ifconfig.yaml
is changed- When done testing the config:
sudo docker container rm my_hubitile
sudo 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.git
sudo docker build -t hubitile_image hubitile
cd hubitile
cp template.config.yaml config.yaml
- Edit
config.yaml
by following the instructions in the file - Test run:
sudo docker run --name my_hubitile -v "`pwd`/config.yaml:/app/config.yaml" hubitile_image
This will display logging on the command window allowing for rapid troubleshooting.Ctrl-C
to stop the container ifconfig.yaml
is 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_hubitile
sudo 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.git
cd hubitile
cp template.config.yaml config.yaml
- Edit
config.yaml
by 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-C
if running in interactive mode,kill
the process otherwise.
- Set
main:logverbosity
toDEBUG
inconfig.yaml
to get more details. Note: Hubitat's token is printed in plain text whenmain:logverbosity
isDEBUG
- 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