MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    MMM-Strava

    Scheduled Pinned Locked Moved Health
    activity trackerhealthstrava
    138 Posts 34 Posters 257.1k Views 35 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • I Offline
      ianperrin
      last edited by ianperrin

      Description:

      MMM-Strava allows you to view your Strava activity data right on your MagicMirror.

      The module currently displays the following information:

      • The number of activities for the period.
      • The total distance for the period.
      • The total number of achievements (recent period only).

      In addition you can configure the following options

      • Which period to display stats for your activities: Recent (last 4 weeks), year to date or all time
      • Which activities (and the order activities) should be displayed.
      • The units (miles/kilometres) used to display the total distance for each activity

      Screenshots:

      Auto-rotating table

      Chart mode

      Download:

      [card:ianperrin/MMM-Strava]


      Change log:

      1.0.0

      • Initial Version

      1.1.0

      • Added option to rotate through the different periods (auto_rotate).
      • Added option to set the interval between rotations (updateInterval).
      • Added chart mode option to display last weeks activity as per Strava profile

      1.1.1

      • Added German translations (thanks @fewieden)
      • Added localisations for chart labels

      1.1.2

      • Added locale option to overide global config.language

      1.1.3

      • Improved bar heights in chart mode
      • Added option to show elevation in table mode (thanks @khassel)
      • Add support for multiple athletes (thanks @khassel)
      • Added Hungarian translation (thanks @peet86)
      • Added Indonesian translation (thanks @slametps)

      1.1.4

      • Internal fixes to improve performance, logging and documentation
      • Support for private activities

      1.1.5

      • Include virtual rides in chart mode

      1.1.6

      • Internal fixes

      1.1.7

      • Show elevation in minor units (metres/feet)

      2.0.0 (BETA)

      See (https://forum.magicmirror.builders/topic/457/mmm-strava/37)

      2.0.0

      • Support for changes to the Strava oAuth model.
      • Statistics displayed in table mode are configurable via the stats option.
      • period option is now supported in chart mode.
      • Multiple instances of the module should now be supported.

      2.0.1

      • Bug fixes for token refresh issues.

      2.1.0

      • Adds a BETA chartType option to toggle between classic bar chart and radial histogram

      2.2.0

      • Adds digits option to control the number of decimal places shown for the distance and elevation stats

      2.3.0

      • Adds support for the stats option in bar chart mode
      • Adds support for additional activities in chart mode

      "Live as if you were to die tomorrow. Learn as if you were to live forever." - Mahatma Gandhi

      1 Reply Last reply Reply Quote 4
      • I Offline
        ianperrin
        last edited by

        An option has been added to determine whether the module should automatically rotate through the different periods (auto_rotate), and the interval between rotations (updateInterval).

        Auto-rotating table

        Note: To add this feature to your mirror, you’ll need to update your module. Follow these instructions.

        "Live as if you were to die tomorrow. Learn as if you were to live forever." - Mahatma Gandhi

        I iMAGiCI 2 Replies Last reply Reply Quote 0
        • I Offline
          ianperrin @ianperrin
          last edited by

          An updated version of the module is now available which includes the option to display your last weeks activity in a more graphical format (similar to how it is displayed on your Strava profile).

          Chart mode

          To enable this feature on your mirror,

          • The MMM-Strava module should be installed (or updated)
          • The mode: "chart" option should be added to your config.js file

          Note if the new mode option is not included (or set if it is not set to chart) the classic table layout will be used.

          "Live as if you were to die tomorrow. Learn as if you were to live forever." - Mahatma Gandhi

          G 1 Reply Last reply Reply Quote 2
          • iMAGiCI Offline
            iMAGiC @ianperrin
            last edited by yawns

            @ianperrin Hi, I add Strava rotate like below, but only this module stopped(blank) after 7 hours running. all modules still running well, but Strava, please suggest a hint to solve this issue, thank you very much.

            iMAGiCJAKE

            {
            		        module: 'MMM-Strava',
            			position: 'top_right',
            			header: 'STRAVA ACTIVITY',
                    		config: {
                        			strava_id: 'xxxxxxx',
                        			access_token: 'xxxxxxxxxx',
            				auto_rotate: true
            			}
                    	},
            

            Choice * Judgment * Values

            I 1 Reply Last reply Reply Quote 0
            • I Offline
              ianperrin @iMAGiC
              last edited by

              @iMAGiC are you able to share the contents of your log at the time the module stopped refreshing?

              "Live as if you were to die tomorrow. Learn as if you were to live forever." - Mahatma Gandhi

              iMAGiCI 2 Replies Last reply Reply Quote 0
              • iMAGiCI Offline
                iMAGiC @ianperrin
                last edited by

                @ianperrin sorry for late reply, it was quite busy this week, I will try it again in this week.
                btw, could this module run and show two people record? for ex. one for me, one for my wife.

                Choice * Judgment * Values

                I 1 Reply Last reply Reply Quote 0
                • I Offline
                  ianperrin @iMAGiC
                  last edited by yawns

                  @iMAGiC said in Strava:

                  @ianperrin sorry for late reply, it was quite busy this week, I will try it again in this week.
                  btw, could this module run and show two people record? for ex. one for me, one for my wife.

                  The module doesn’t currently support multiple people. However you could try adding the module twice to your config.js file.

                  "Live as if you were to die tomorrow. Learn as if you were to live forever." - Mahatma Gandhi

                  iMAGiCI 2 Replies Last reply Reply Quote 0
                  • iMAGiCI Offline
                    iMAGiC @ianperrin
                    last edited by

                    @ianperrin
                    I tried that(add twice), both aren’t show any record.

                    Choice * Judgment * Values

                    1 Reply Last reply Reply Quote 0
                    • iMAGiCI Offline
                      iMAGiC @ianperrin
                      last edited by

                      @ianperrin add twice will cause 2 modules won’t work. and after I tested in an all new Raspbian Jessie installation, it still happen abnormal flashing in rotate mode or stop showing anything after 10 mins or more, but every time happened.
                      in pm2 log won’t show anything error on this module. I will turn it to no rotate mode anyway.

                      Choice * Judgment * Values

                      karsten13K 1 Reply Last reply Reply Quote 0
                      • iMAGiCI Offline
                        iMAGiC @ianperrin
                        last edited by

                        @ianperrin I made a video for saying abnormal flashing in table rotate mode, if like like to see it.
                        https://goo.gl/KNdkk7

                        Choice * Judgment * Values

                        1 Reply Last reply Reply Quote 0
                        • karsten13K Online
                          karsten13 @iMAGiC
                          last edited by

                          @iMAGiC Found this thread today, can reproduce your problems:
                          a) more than 1strava-module don’t work
                          b) flashing problem

                          I already opened an issue here

                          1 Reply Last reply Reply Quote 0
                          • brandongomezB Offline
                            brandongomez
                            last edited by

                            Great module! I tried to implement but my module is stuck at “Loading…”

                            Guessing it has something to do with the API creation. I have my athlete ID that I see when I look at my Strava profile.

                            I ended up with a Client ID, Client Secret and Access Token when I created the API. Guessing I should be using only the Access Token?

                            Also, when I created the API, I had to put in a website and authorization callback domain. Not sure if these have an affect but I used the internal IP for the raspberry pi for both. Is that right? Thanks!

                            G 1 Reply Last reply Reply Quote 0
                            • G Offline
                              GMD @brandongomez
                              last edited by

                              Hi

                              Did you get a resolution to your issue as I seem to have similar issue with module stuck at Loading…

                              When I look at the terminal window I am getting error:

                              Error performing request: Unauthorized. Access Token will be reset.
                              Error while fetching new athlete stats.

                              Look at code this is a 401 error.

                              I am getting confused as I thought the Strava API key was public but from this error it looks as though it wants to authorise API Key.

                              As this is an old post I will create a new post this evening with some more detail.

                              1 Reply Last reply Reply Quote 0
                              • G Offline
                                GMD @ianperrin
                                last edited by

                                @ianperrin

                                Hi Ian

                                Can you help as I think I am getting confused.

                                I carried out the following steps:

                                1. Imported MMM-Strava into my modules folder.
                                2. Logged into my Strava account and navigated ->Settings->My API Application
                                3. Created an application icon
                                4. Completed fields, Application Name = MyData, Category = Other, Website = https://Strava.com, Authorization Callback Domain = 127.0.0.1
                                5. Click update button
                                6. Copied Client ID and Your Access Token (?) (permissions: public)
                                7. Update MagicMirror config.js with Client ID and Your Access Token
                                8. Restarted MagicMirror

                                When MagicMirror displays the Strava modules says Loading… and looking at the terminal window I can see errors:

                                Error performing request: Unauthorized. Access Token will be reset.
                                Error while fetching new athlete stats.

                                Which looks to be a 401 error from code that, access token has not been authorised.

                                Can anybody point me to what I am doing wrong.

                                1 Reply Last reply Reply Quote 0
                                • karsten13K Online
                                  karsten13
                                  last edited by

                                  Hi,

                                  sounds you took the client id from the strava api page as input for strava_id of the module?

                                  Input of strava_id: https://support.strava.com/hc/en-us/articles/216928797-Where-do-i-find-my-Strava-ID-

                                  Karsten.

                                  G 1 Reply Last reply Reply Quote 0
                                  • G Offline
                                    GMD @karsten13
                                    last edited by

                                    @karsten13

                                    Hi

                                    Firstly thank you for your reply.

                                    You are correct I used the client id and when I replaced this with the strava id as your link described all works great.

                                    Thanks again.

                                    1 Reply Last reply Reply Quote 0
                                    • D Offline
                                      Dicous
                                      last edited by

                                      Hello,
                                      I have the problems that with the following config the module is always “loading…”.

                                      Can someone help me?

                                      		{
                                      			module: 'MMM-Strava',
                                      			position: 'top_left',
                                      			config: {
                                      				strava_id: 'xxx1, xxx2',
                                      				access_token: 'xxx1, xxx2',
                                      				activities: 'run',
                                      				athlete_text: 'Tine, Basti',
                                      			    auto_rotate: 'true'
                                      				 }
                                      		},
                                      
                                      karsten13K 1 Reply Last reply Reply Quote 0
                                      • karsten13K Online
                                        karsten13 @Dicous
                                        last edited by

                                        try it with the missing brackets:

                                        		{
                                        			module: 'MMM-Strava',
                                        			position: 'top_left',
                                        			config: {
                                        				strava_id: ['xxx1', 'xxx2'],
                                        				access_token: ['xxx1', 'xxx2'],
                                        				activities: ['run'],
                                        				athlete_text: ['Tine', 'Basti'],
                                        			    auto_rotate: 'true'
                                        				 }
                                        		},
                                        
                                        1 Reply Last reply Reply Quote 0
                                        • D Offline
                                          Dicous
                                          last edited by

                                          Unfortunately, no solution

                                          1 Reply Last reply Reply Quote 0
                                          • karsten13K Online
                                            karsten13
                                            last edited by

                                            your setup works for me, changed only strava_id’s and access_token’s.
                                            Did you put every single strava_id and every single access_token in single quotes as provided in my example? In your post you put 2 things in one single quote …
                                            Other possibilities: Wrong strava data (id/token)? Did you read the documentation how to get strava_id?
                                            Did you take a look in the logs?
                                            If I test it with your testdata xxx I find these lines in the logs:

                                            Error performing request: Unauthorized. Access Token will be reset.
                                            Error while fetching new athlete stats.
                                            
                                            
                                            1 Reply Last reply Reply Quote 0

                                            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                            With your input, this post could be even better 💗

                                            Register Login
                                            • 1
                                            • 2
                                            • 3
                                            • 4
                                            • 5
                                            • 6
                                            • 7
                                            • 1 / 7
                                            • First post
                                              Last post
                                            Enjoying MagicMirror? Please consider a donation!
                                            MagicMirror created by Michael Teeuw.
                                            Forum managed by Sam, technical setup by Karsten.
                                            This forum is using NodeBB as its core | Contributors
                                            Contact | Privacy Policy