A MagicMirror Module for your Strava data.
A MagicMirror Module for displaying your Strava data.
table
mode, which displays a table showing the number of activities, the total distance and (for recent period
only) the number of achievements.chart
mode, which displays the total distance, moving time and elevation gain alongside a chart showing the total distance grouped by
recent
period),ytd
period),all
period).activities
(and the order activities) should be displayed.stats
should be displayed.
count
).distance
).elevation
).moving_time
).elapsed_time
).achievements
) - in table
mode, only available for recent
period).period
to display stats for your activities:
table
mode or current week in chart
mode.chartType
should be used in chart
mode:
firstYear
to group activities by in chart
mode when the period
is "all".auto_rotate
through the different periods, and the updateInterval
between rotations. (only applicable in table
mode).units
(miles/feet or kilometres/metres) used to display the total distance and elevation gain statistics.locale
used for determining the date (day or month) labels in chart
mode and number format in both modes.digits
displayed for the total distance and elevation gain statistics.Stop your MagicMirror and clone the repository into the modules folder
cd ~/MagicMirror/modules
git clone https://github.com/ianperrin/MMM-Strava.git
cd ~/MagicMirror/modules/MMM-Strava
npm install --production
Create a Strava API Application and note the client_id
and client_secret
client_id
and client_secret
Add the module to the config file (~/MagicMirror/config/config.js
) for your mirror.
modules: [
{
module: "MMM-Strava",
position: "top_right",
config: {
client_id: "your_strava_client_id",
client_secret: "your_strava_api_client_secret"
}
}
];
The full list of config options can be found in the configuration options table.
Restart the MagicMirror
pm2 restart mm
Authenticate the module to allow access to the Strava API.
module_4_MMM-Strava
) and click/tap Authorise -The number of the modules will vary depending on your configuration.
View data about your public profile
and View data about your activities
but it's up to you whether you want to allow access to private activities
.
To update the module to the latest version,
Pull the changes from this repository into the MMM-Strava folder:
cd ~/MagicMirror/modules/MMM-Strava
git pull
npm install --production
Update your config file to remove the strava_id
and access_token
options and add the new client_id
and client_secret
options - See steps 2 and 4 in the installation notes.
Please Note Following the changes to Strava’s authentication model, the client_id and client_secret must be included in the config in place of the deprecated strava_id and access_token options.
If you haven't changed the module, this should work without any problems. If you have a problem, you can reset the module using git reset --hard
, after which git pull
should be possible. You may wish to use git status
to see any changes before doing so.
The following properties can be added to the configuration:
Option | Default | Description | Possible Values |
---|---|---|---|
client_id |
Required - The Client ID for your Strava API Application, obtained from your My API Application page. | ||
client_secret |
Required - The Client Secret for your Strava API Application, obtained from your My API Application page. | ||
mode |
table |
Optional - Determines which mode should be used to display activity information. | "table" , "chart" |
chartType |
bar |
Optional - Determines the type of chert which should be displayed in chart . |
"bar" , "radial" |
activities |
["ride", "run", "swim"] |
Optional - Determines which activities to display and in which order they are displayed. Note: - The activities can be listed in any order, and only one is required. However, they must be entered as an array of strings i.e. comma separated values within square brackets. | In table mode: "ride" , "run" , "swim" In chart mode: "alpineski" , "backcountryski" , "canoeing" , "crossfit" , "ebikeride" , "elliptical" , "golf" , "handcycle" , "hike" , "iceskate" , "inlineskate" , "kayaking" , "kitesurf" , "nordicski" , "ride" , "rockclimbing" , "rollerski" , "rowing" , "run" , "sail" , "skateboard" , "snowboard" , "snowshoe" , "soccer" , "stairstepper" , "standuppaddling" , "surfing" , "swim" , "velomobile" , "virtualride" , "virtualrun" , "walk" , "weighttraining" , "wheelchair" , "windsurf" , "workout" , "yoga" |
period |
recent |
Optional - What period should be used to summarise the activities in table and chart mode. |
recent = last 4 weeks in table mode or current week in chart mode, ytd = year to date, all = all time |
stats |
In table mode: ["count", "distance", "achievements"] In chart mode: ["distance", "moving_time", "elevation"] |
Optional - Determines which statistics to display. Note: - The stats can be listed in any order, and only one is required. However, they must be entered as an array of strings i.e. comma separated values within square brackets. |
"count" , "distance" , "elevation" , "moving_time" , "elapsed_time" , "achievements" |
auto_rotate |
false |
Optional - Whether the summary of activities should rotate through the different periods in table mode. |
true = rotates the summary through the different periods, false = displays the specified period only. |
units |
config.units |
Optional - What units to use. Specified by config.js | config.units = Specified by config.js, metric = Kilometres/Metres, imperial = Miles/Feet |
updateInterval |
10000 (10 seconds) |
Optional - How often does the period have to change? (Milliseconds). | 1000 - 86400000 |
reloadInterval |
300000 (5 minutes) |
Optional - How often does the data needs to be reloaded from the API? (Milliseconds). See Strava documentation for API rate limits | 7500 - 86400000 |
animationSpeed |
2500 |
Optional - The speed of the update animation. (Milliseconds) | 0 - 5000 |
locale |
config.language |
Optional - The locale to be used for displaying dates - e.g. the days of the week or months or the year in chart mode. If omitted, the config.language will be used. | e.g. en , en-gb , fr etc |
debug |
false |
Optional - Outputs extended logging to the console/log | true = enables extended logging, false = disables extended logging |
digits |
1 |
Optional - Digits for total distance and elevation gain statistics | 0 - ... |
firstYear |
Five years before the current date. | Optional - The first year activities should be grouped by in chart mode when the period is "all". |
0 - ... |