Garmin LiveTrack & Slack Integration Instructions

This is a hacky way of doing the thing that Garmin should have supposed to do.

Image for post
Image for post
Garmin and Slack Integration

Disclaimer: Post is intended for developers or tech-savvy people.

As you are here it means you have also encountered a problem with Garmin LiveTrack as it provides 0 integration support and no API for devs.

Let’s jump into it:

What we need:

  • Garmin
  • Gmail
  • Slack
  • Go lang to glue everything together

Enable LiveTrack from Garmin Connect mobile app. Add Email recipient, we can use Gmail aliases as well like

Garmin will send link with the location to that address.

There are two ways to get this mail

  1. Pub/Sub using Google cloud and Gmail API
  2. Crontab to query inbox and get new Garmin mails.

The last one looks easier, so I used it. Pub/Sub was kind of overkill for this simple project.

Create a project on Google Cloud and enable Gmail API

Download GO packages which will help to access Gmail API.

Follow the link and use that script to authorize the application and obtain an access token from Google (later we will modify this script).

Now we need to fetch mails from Gmail which is sent from Garmin and is in unread status. Every mail we check will be marked as read, so unread mails will be the most recent. add those functions to the script from the previous step and invoke accordingly.

and modify scope for Gmail API in main function to :

This will require to obtain an access token again.

Create Slack App : https://api.slack.com/apps

Give permissions: users.profile:write, users:write.

Install to your workspace and copy access token.

this function will update Slack status for the next 3 hours as “Gone Cycling” with the corresponding emoji and set a user presence as “away”. Tune options as you like.

now add this script to Crontab and that's it 🤘

Dummy and easy integration, at least works for me.

Feel free to add as many features as you wish,

here is the full script, just copy & paste :

Written by

Software Engineer with 8 years of experience, specializing in Android development. Chapter Lead @ TBC Bank. Amateur cyclist and runner

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store