OwnTracks is a free and open source application for iOS and Android that allow you to track your location and send it directly to Home Assistant. It can be set up via the integrations panel in the configuration screen.
By default the integration will listen for incoming messages from OwnTracks via HTTP. It will also listen for MQTT messages if Home Assistant is configured to use MQTT.
- Open the Home Assistant frontend
- Open Settings -> integrations
- If you see an Owntracks component under ‘Configured’, delete it.
- Click on it.
- Click on the trashcan icon in the upper right corner.
- Now, look for Owntracks in ‘Setup new integration’ and click on CONFIGURE.
- The login credentials and configuration for owntracks will be presented to you. in a popup window. You will need these in the configuration for the app as mentioned below.
- Save these credentials somewhere, as there is no way to get it back at a later point in time if it is lost, besides repeating step 1-5
In the OwnTracks app, open sidebar and click on preferences, then on connection. Change the following settings:
- Mode: Private HTTP
<url given to you when setting up the integration above>
- Password: Can be left blank.
- Device ID: `
- Tracker ID:
Two character tracker ID. (can be left blank)
Your tracker device will be known in home assistant as
In the OwnTracks app, tap the (i) in the top left and click on settings. Change the following settings:
- Mode: HTTP
<url given to you when setting up the integration>
- Turn on authentication
- User ID:
OwnTracks allows the user to set advanced configuration by adding a section to your
# Example configuration.yaml entry owntracks:
(integer)(Optional)Sometimes Owntracks can report GPS location with a very low accuracy (few kilometers). That can trigger false zoning in your Home Assistant installation. With the parameter, you can filter these GPS reports. The number has to be in meter. For example, if you put 200 only GPS report with an accuracy under 200 will be take in account.
(boolean)(Optional)Owntracks users can define waypoints (a.k.a regions) which are similar in spirit to Home Assistant zones. If this configuration variable is
true, the Owntracks users who are in
waypoint_whitelistcan export waypoints from the device and Home Assistant will import them as zone definitions.
Default value: true
(list)(Optional)A list of user names (as defined for Owntracks) who can export their waypoints from Owntracks to Home Assistant. This would be the
usernameportion of the Base Topic Name, (e.g., owntracks/username/iPhone)
Default value: All users who are connected to Home Assistant via Owntracks.
(string)(Optional)Payload encryption key. This is usable when communicating with a third-party untrusted server or a public server (where anybody can subscribe to any topic). By default the payload is assumed to be unencrypted (although the communication between Home Assistant and the server might still be encrypted). This feature requires the
libsodiumlibrary to be present.
(string)(Optional)The topic to subscribe for Owntracks updates on your MQTT instance.
Default value: owntracks/#
(boolean)(Optional)Home Assistant will ignore all location updates and rely solely on geofence enter/leave events.
(list)(Optional)Dictionary to remap names of regions as configured in the Owntracks app to Home Assistant zones. Use this if you have multiple homes or Home Assistant instances and want to map a different label to ‘home’.
key: valuemaps Owntracks region
keyto Home Assistant zone
A full sample configuration for the
owntracks platform is shown below:
# Example configuration.yaml entry owntracks: max_gps_accuracy: 200 waypoints: true mqtt_topic: "owntracks/#" events_only: true waypoint_whitelist: - jon - ram region_mapping: cabin: home office: work
Owntracks can track regions, and send region entry and exit information to Home Assistant (HA). You set up a region in the Owntracks app which you should name the same as your HA Zone, and then make sure to turn on the
share option for the region in the owntracks app. Please see the owntracks documentation.
Home Assistant will use the enter and leave messages to set your zone location. Your location will be set to the center of zone when you enter. Location updates from OwnTracks will be ignored while you are inside a zone.
When you exit a zone, Home Assistant will start using location updates to track you again. To make sure that Home Assistant correctly exits a zone (which it calculates based on your GPS coordinates), you may want to set your Zone radius in HA to be slightly smaller that the Owntracks region radius.
Owntracks v2.0.0 removes support for iBeacons on Android.
When run in the usual significant changes mode (which is kind to your phone battery), Owntracks sometimes doesn’t update your location as quickly as you’d like when you arrive at a zone. This can be annoying if you want to trigger an automation when you get home. You can improve the situation using iBeacons.
iBeacons are simple Bluetooth devices that send out an “I’m here” message. They are supported by IOS and some Android devices. Owntracks explain more here.
When you enter an iBeacon region, Owntracks will send a
region enter message to HA as described above. So if you want to have an event triggered when you arrive home, you can put an iBeacon outside your front door. If you set up an OwnTracks iBeacon region called
home then getting close to the beacon will trigger an update to HA that will set your zone to be
When you exit an iBeacon region HA will switch back to using GPS to determine your location. Depending on the size of your zone, and the accuracy of your GPS location this may change your HA zone.
Sometimes Owntracks will lose connection with an iBeacon for a few seconds. If you name your beacon starting with
- Owntracks will wait longer before deciding it has exited the beacon zone. HA will ignore the
- when it matches the Owntracks region with Zones. So if you call your Owntracks region
-home then HA will recognize it as
home, but you will have a more stable iBeacon connection.
iBeacons don’t need to be stationary. You could put one on your key ring, or in your car.
When your phone sees a mobile iBeacon that it knows about, it will tell HA the location of that iBeacon. If your phone moves while you are connected to the iBeacon, HA will update the location of the iBeacon. But when your phone loses the connection, HA will stop updating the iBeacon location.
To use mobile iBeacons with HA, you just set up a region that doesn’t match your Zone names. If HA sees an entry event for an iBeacon region that doesn’t match a Zone name (say
keys) - it will start tracking it, calling the device
This allows you to write zone automations for devices that can’t track themselves (for example alert me if I leave the house and my keys are still at home). Another example would be open the gates if my car arrives home.
You can use iBeacons of both types together, so if you have a Zone
drive with an iBeacon region called
-drive and you arrive home with a mobile iBeacon called
device_tracker.beacon_car will be set to a state of
By default, any Owntracks user connected to Home Assistant can export their waypoint definitions (from the Export - Export to Endpoint menu item) which will then be translated to zone definitions in Home Assistant. The zones will be named
<user>-<device> - <waypoint name>. This functionality can be controlled in 2 ways:
- The configuration variable
waypointscan be set to
falsewhich will disable importing waypoints for all users.
- The configuration variable
waypoint_whitelistcan contain a list of users who are allowed to import waypoints.
Owntracks can also be used with other device trackers, such as Nmap or Netgear. To do this, fill in the
mac field to the Owntracks entry in
known_devices.yaml with the MAC address of the device you want to track. This way the state of the device will be determined by the source that reported last. The naming convention for known device list is
<username>_<device-id> and could be set in app configuration. More details about this config can found in device tracker.
An example showing the inclusion of the
mac field for multiple component tracking. The
mac field will need to be added to the
owntracks device and will enable tracking by all components that track via the
USERNAME_DEVICE_ID: name: Friendly Name mac: EA:AA:55:E7:C6:94 picture: https://www.home-assistant.io/images/favicon-192x192.png gravatar: email@example.com track: true hide_if_away: false