OwnTracks Integration Guide
for HAUS IoT controllers
OwnTracks is an Open Source project which provides an iOS and an Android app with which your smartphone publishes its current location.
OwnTracks publishes data only to your own selected backend (MQTT Broker) in order to ensure that only you and the people you authorize have access to the data published by the app.
Get OwnTracks for Android: https://play.google.com/store/apps/details?id=org.owntracks.android
Get OwnTracks for iOS: https://itunes.apple.com/us/app/mqttitude/id692424691?mt=8
Below guide reflects OwnTracks for Android’s user interface. The iOS version slightly differs.
Please invoke menu with top-left menu icon, then navigate through the Preferences menu and fill in fields as explained below:
Connection:
Mode: MQTT
Host:
Host: MQTT broker hostname or IP address
Port: MQTT broker port
WebSockets: Leave it disabled.
Identification:
Username: MQTT username on MQTT broker
Password: MQTT password on MQTT broker
Device ID: A name, sent together with location data, this is the name set as "Location beacon's name" in Gatekeeper.
Tracker ID: Short name/id to be displayed on OwnTracks' map.
Security: Enable TLS if MQTT broker supports Transport Layer Security. Go back to Host/Port and set secure port of the broker. You also may leave TLS disabled and communicate with the broker unencrypted.
Parameters: Leave Clean Session disabled and Keepalive empty.
Reporting: Leave it unchanged.
Notifications: Leave it unchanged.
Advanced:
Remote commands: You can leave it unchanged.
Inaccurate locations: Strongly recommended to set this to a reasonable value to filter out unreal locations and location jumps, when there is no GPS coverage and IP-based localization occasionally fails and thinks you are at your ISP’s datacenter. Set this to 100 meters maximum.
Encryption Key: Good for hiding data from fellow users on the same MQTT broker. Not used. Using ACLs on MQTT broker side instead. (See Security Hardening Guide for details.)
Debug log: Leave it disabled.
Autostart: Leave it enabled, so OwnTracks always starts, when you restart your phone. You may also disable it if you wish.
OpenCage API Key: Not used.
If you use a special MQTT broker, imposing limits on topic names, you might not use OwnTracks’ default owntracks/%u/%d topic. It is quite common for free online MQTT brokers, that you are forced to use a certain prefix (usually your username) for your topics.
OwnTracks supports configuring its base topic by pubTopicBase and subTopic parameters.
Go to the Status screen in the OwnTracks app and tap it 3 times. By doing this, you invoke the “expert mode”, and the needed parameters appears as editable.
Set pubTopicBase to <owntracks topic prefix>owntracks/%u/%d
Set subTopic to <owntracks topic prefix>owntracks/+/+
Go to Preferences / Configuration management and check the current values for these parameters. Tap the top right menu icon and select Editor. You can edit any parameter by entering its name as key and typing in the new value.
Set key = pubTopicBase and value = <owntracks topic prefix>owntracks/%u/%d
Set key = subTopic and value = <owntracks topic prefix>owntracks/+/+
This method works for both Android and iOS versions. You need to create a JSON formatted text file on your device (or elsewhere and transferring it to the device) with below content:
{
"_type": "configuration",
"pubTopicBase": "<owntracks topic prefix>owntracks/%u/%d",
"subTopic": "<owntracks topic prefix>owntracks/+/+"
}
Where <owntracks topic prefix> is your free choice prefix. In case of MaQiaTTo broker it will be <your e-mail address>/ (Note the trailing slash!).
Save this file with whatever name and .otrc extension. Then open the file, ad use OwnTracks as the application to open with. OwnTracks then pulls in the defined parameters and save the changes in its own configuration.
You can check the changed configuration: go to Preferences / Configuration management and lookup the parameters in the list.
You can configure one or more regions, so your phone will send events to your devices over MQTT when you enter or leave a region.
Please invoke menu with top-left menu icon, then enter Regions menu and add one or more regions as explained below:
Tap the + sign to add a new region, then fill in fields:
Description: Use Region name set in Device identity menu in HAUS IoT controller, e.g. Home. OwnTracks will notify the HAUS IoT controllers configured with this Region name on entering or leaving the region.
Latitude, Longitude: GPS coordinates of the center of the region.
Radius: Radius of the region in meters. Entering and leaving region will be detected at this distance from the center.
OwnTracks can be put to silent mode or the frequency of location reports can be tuned.
You can use the “play”, “pause” or “stop” icons on the top menubar to switch between modes.
There are 4 modes:
“Stop sign”: Quiet mode: Only manual location reports. (Tap “up arrow” icon on the top menubar to report.)
“Pause sign”: Manual location reports and automated reports with region monitoring.
“Play sign”: Standard tracking mode with automated location reports.
“Play-pause sign”: Move mode: More frequent location reports (but higher battery usage).
For further information please see the official OwnTracks documentation: https://owntracks.org/booklet/
Monitoring modes:
https://owntracks.org/booklet/features/location/
General Restrictions on Android 6 and higher:
https://owntracks.org/booklet/features/android/