Whereabouts Clock Simplified
Whereabouts Clock (v6)
When I published the last update to the Whereabouts Clock I knew that I would make another version that simplified the architecture. Apple iOS supports the idea of location regions (home, work, etc.) and can notify an App when the user enters and exits a region. This "presence" feature is utilized in Life360, OwnTracks, and others.
Instead of looking up a user's location from a static database, we can leverage the built-in feature to tell the Arduino clock how to move and when. There's no more polling a web page for updates or maintaining a database of locations.
So how does the whole system work now?
- Devices with OwnTracks send location data (either standard location messages or transition events into/out of a known region) to the MQTT broker (Mosquitto). These messages contain the region information setup on the device (more on that in a minute)
- The Mosquitto MQTT broker broadcasts these messages to its subscribers (other OwnTracks devices and the Arduino clock)
- The Arduino clock is also a MQTT subscriber and parses the messages from OwnTracks looking for region locations that match the name IDs on the clock. Get a message that says a user arrived at "home"? Instantly move the clock hand to "home".
Comments
Post a Comment