Sign inSign up

lucatnt/owntracks-to-db

By lucatnt

Updated over 4 years ago

Python app that receives OwnTracks data from MQTT and saves it into a database.

Image
0

629

lucatnt/owntracks-to-db repository overview

Source is available on Github at LucaTNT/owntracks-to-db.

This thing is supposed connect to MQTT and store the data it gets from the OwnTracks app into a database. Might be useful in conjunction with Grafana to create nice-looking dashboards containing long-term location data.

Usage

Settings are provided through environment variables:

VariableRequiredDefaultMeaning
DB_CONNECTIONNosqlite:///locations.dbThe SQLAlchemy DB connection string.
MQTT_SERVERNolocalhost
MQTT_PORTNo1883
MQTT_AUTHNo0Set to 1 to enable MQTT username and password auth.
MQTT_USERNoMQTT username. Only used if MQTT_AUTH is set to 1.
MQTT_PASSWORDNoMQTT password. Only used if MQTT_AUTH is set to 1.
MQTT_TOPICNoowntracks/#The topic to listen on. Check OwnTracks documentation for more info.
DEBUGNoSet to 1 to enable debug output.

Limitations

For the time being it only supports a single device being tracked.

Docker image

A Docker image is provided, it can be used by running, for example:

docker run -e MQTT_SERVER=mosquitto lucatnt/owntracks-to-db

Configuration is done through the environment variables listed above.

Tag summary

Content type

Image

Digest

Size

53.6 MB

Last updated

over 4 years ago

docker pull lucatnt/owntracks-to-db