Whereabouts Clock Update
After a few months, Life360 has gone the way of Apple and locked down the API I used to get location data from the phones. This is disappointing, but inevitable.
I found on a forum for Home Assistant that the app OwnTracks might be a suitable alternative. It's a neat little app that will trigger the phone to send its location data via MQTT to a server that you specify. I had to rework the code a bit, but the new operation is as follows:
- OwnTracks on the phone will push location data per its configuration to the MQTT server (Docker container)
- The Mosquitto (MQTT Broker) container will receive the data and forward the data to its subscribers
- The MQTTWarn container is a subscriber and translates the received data and adds it to the MariaDB database
- The Apache web server hosts a Python CGI script that is checked each minute by the Arduino microcontroller. If the data has changed, the hands are moved to the new location.
The only exposed port to the Internet is TCP 1883 for MQTT. I tried to proxy this through a Cloudflare Access tunnel but didn't have any luck. It seemed that they only proxy HTTP/S traffic.
OwnTracks supports notification when a device enters or leaves a defined area. I'm thinking that the next version might do away with the MQTTWarn, MariaDB, and Apache containers altogether if I set the Arduino as an MQTT subscriber directly. Something else for the to-do list.
The updated code is at the Whereabouts repository here:
Comments
Post a Comment