Tracking your Android phone with MQTT


Typically shut off the phone when home and last few years have been using VPN to my PFSense box when using the Laptop / Tablet / phone away from home.
Recently installed NextTracks on my current Android 10.X phone.

A tracking app that doesn't compromise privacy.
NextTracks is a fork of OwnTracks which doesn't use Google Play Services.

It allows you to track the locations of your devices.

Supported Protocols: HTTP and MQTT


* You can use your own server.
* Map that shows your markers with your devices in it.
* Set waypoints to get a notification when a device leaves or joins a region (Geofencing).
* Friend List (each friend is a device, can be multiple per person) with their current address.
* Configurable to only publish manually or on significant movements.

So via VPN configured it to connect to my home MQTT broker.

The MQTT message looks like this:


With HA  / NextTracks plugin it creates an overlay of mobile devices over the maps present in HA.


Had an opportunity to test Android application running talking to the MQTT broker on my home network this weekend.  Works well and not using the cloud at all.
Best of all its free and private using VPN.
Found a php page which reads the MQTT messages above but uses Google API. Wondering how to change this to using OpenStreetMaps.