Read the statement by Michael Teeuw here.
MMM-Strava
-
@ianperrin thanks for your help, changed back and now it`s working fine. Just one Question left. Is there a way to “isolate” the virtual rides? To show them separately in the charts?
-
HEy @ianperrin, since Strava changed their API- Refreshing, i need to put in the Access Token manually every 6 hours. Can you change this in your module? Here is the API Handbook from Strava. I have no idea how this wors, so maybe you can fix it. https://developers.strava.com/docs/authentication/#Refresh expired
Thanks in advance.
-
@zerodegree79 I temporarily solved the problem with an external python script found at https://github.com/hozn/stravalib . The script retrieves a newly generated access token every 4-5h and find/replaces it in the config.js file. I then have a crontab that recycles the Magic Mirror.
There must be a better way, but I can’t complain for now…
-
@ctatos could you send me a pm with details of the script and cron setup you are using?
-
@ctatos said in MMM-Strava:
@zerodegree79 I temporarily solved the problem with an external python script found at https://github.com/hozn/stravalib . The script retrieves a newly generated access token every 4-5h and find/replaces it in the config.js file. I then have a crontab that recycles the Magic Mirror.
There must be a better way, but I can’t complain for now…
That’s way over my head, but great effort. Maybe @ianperrin can implement this.
-
@zerodegree79 Any news about New Strava API integration ?
-
@val07300 no, waiting for @ianperrin and @ctatos giving a response
-
Not as yet I’m afraid.
Hoping to work on it in the coming weeks - work and other commitments permitting.
PRs welcome from those who might have the know how 😉
-
@ianperrin said in MMM-Strava:
No as yet I’m afraid.
Hoping to work on it in the coming weeks - work and other commitments permitting.
PRs welcome from those who might have the know how 😉
No worries, take your time. Meanwhile i just update manually
-
@zerodegree79 , @Val07300, @ctatos (and others I may have missed).
A new (beta) version of the module with support for Strava’s new authentication flow is available.
Much of the code for the module has been re-written/re-factored and includes a number of changes to the original module including
- Support for multiple instances of the module
- The table and chart and now generated via templates (rather than javascript)
- A helper is included to simplify the initial authentication with Strava
chart
mode now supports either therecent
andytd
values in theperiod
option- The stats displayed in
table
mode are configurable via thestats
option - To support the new authentication flow, the
client_id
andclient_secret
must be included in the config in place of the deprecatedstrava_id
andaccess_token
options. The legacy options can still be used, but will trigger an alert on the mirror when the module is loaded and it is recommended they are removed.
Please note - the module no longer supports multiple athlete id’s in one module instance. Multiple instances can be added to the config file to achieve similar results.
Notes for beta testers
This functionality is only available in the develop branch of the github repository at this time. Once any issues have been fixed, the master branch will be updated.
To test the refresh token functionality and the new authentication flow in the Magic Mirror, you need to update the module using the following steps:
- stop the Magic Mirror
- switch to the develop branch and install the new dependencies
cd ~/MagicMirror/modules/MMM-Strava git checkout develop && git pull npm install --production
- edit the MMM-Strava configuration in config.js and
- remove
strava_id
andaccess_token
options - add
client_id
andclient_secret
options. The values for these options should be copied from the My API Application page in your Strava profile
- remove
- restart the Magic Mirror
When updated correctly, the module should display a Client id unauthorised message. The module can be authorised using the following steps:
- Browse to http://localhost:8080/MMM-Strava/auth/ on the Magic Mirror. This can be done remotely if you have setup the
ipWhitelist
in the Magic Mirror - Select module and click Authorise
- If prompted, log in to Strava
- On the Strava Authorisation page, click Authorize
- Once the successful authorisation message appears, restart your Magic Mirror.