MMM-MicrosoftToDo is a 3rd party module for MagicMirror that shows open tasks from task lists. The tasks are retrieved from Microsoft To Do / Outlook.
The idea of this module is to display a shopping list on your mirror that you can control from your Microsoft To Do app and collaborate on with your family. Originally I used MMM-Wunderlist, though Wunderlist will be shut down and replaced by Microsoft To Do.
- Display open to do list items from a to do list managed by Microsoft To Do
- Update contents every minute
In order to configure this module, you'll need some configuration parameters from Microsoft, which can be obtained as described in this section. All steps are required as the configuration parameters are needed for the installation below.
Register an app at https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredApps (sign-in first if needed)
- Click on "+ New registration"
- Enter as "Name": "Magic Mirror"
- Select as "Supported account types": "Accounts in any organizational directory (Any Azure AD directory - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox)"
- Select as "Redirect URI": "Web"
- Set as "Redirect URI": "https://localhost:1234"
- Click "Register"
- Go to "Overview" and copy the "Application (client) ID" (Client ID), e.g. 4ef19f40-4892-4905-b999-76041e991f53`
- Go to "Certificates & secrets"
- Click "+ New client secret"
- Set as "Description": "Magic Mirror"
- Select as "Expires": "Never"
- Click "Add"
- Copy the "Value", e.g.
1Q25ls?TKEDf4RWBKVUbKjnaVu=ytP.[
, it will be the client secret you need later
Create authorization code by opening the following URL in your browser (but replace the client_id with your value):
https://login.microsoftonline.com/common/oauth2/v2.0/authorize?response_type=code&client_id=4ef19f40-4892-4905-b999-76041e991f53&scope=offline_access%20user.read%20tasks.read&redirect_uri=https://localhost:1234&response_mode=query&state=12345
- Click on "Yes" and wait to be redirected
- Copy the
code
parameter from the URL in the browser, e.g.M30cd0dff-af91-d061-8755-ffb3b328aa03
from
https://localhost:1234/?code=M30cd0dff-af91-d061-8755-ffb3b328aa03&state=12345
Generate refresh token to allow the module to retrieve your task list going forward
- Open Terminal app
- Run the following command with your
client_id
(Client ID),code
(Code) andclient_secret
(Client Secret) parameters
curl -X POST \
https://login.microsoftonline.com/common/oauth2/v2.0/token \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'grant_type=authorization_code&client_id=4ef19f40-4892-4905-b999-76041e991f53&scope=offline_access%20user.read%20tasks.read&code=M30cd0dff-af91-d061-8755-ffb3b328aa03&redirect_uri=https%3A%2F%2Flocalhost%3A1234&client_secret=1Q25ls?TKEDf4RWBKVUbKjnaVu=ytP.['
- Copy the value of the
refresh_token
parameter from the response, e.g.refresh_token
:
MCVDmtyumC8ZdlGxrkMwCdur4FbPh7GHjy1gOaOHEA8*c5tTI4oIcJAHU8AflLZMLmcCRWNEa7nMkag2hbipYbZ3QgL9JB1G6Hc*JZY9oA5j46Cq79b6BDx8mivTVen0r*39h2hw9pngKS7MGXjKc9efwayQ7UhsFoCJ2wdhLJzv5gTR2EozgcsKsxHODj!1fV8a1sqVqJ!sU*CBLTMsm0twI2hZqsCkPoSWaMIS5kKFAq7bCsfNaumS11TZYni3XjVwuyHn4DEqfLGjHuSNo1TYRifcG422MdG6bYt7tBxWiw5dlq2iIEMl6O*N2sLWU7W0Ns2*oQbcXIFxRsZ8cHP*6M9dn*9Axg8WbtERj!*jHTfC!Ax6IILXrHDJkdAXgh01PVH!huztVrgd0UC6E4R4zJSOa4ytOKWfQcL9h0NdA
from the full response
{"token_type":"Bearer","scope":"User.Read Tasks.Read","expires_in":3600,"ext_expires_in":3600,"access_token":"EwBwA8l6BAAUO9chh8cJscQLmU+LSWpbnr0vmwwAAQMC79sEwx4KyeAHQmWi48AYLyFufrOurKrSQRBVaB1CPFwrn/CniDdPAEQYSzb95gEseUsnH3QAjbfi1s5Ya8oW5tLW2atfMG8ttdCnN/Rl8/ZdzfZcFkFQSgJ3kibm33Ov9NGXkKubHBgk0etwhyBsFR25PcDRZgc9hLIgR3dt9OCTF+Ph5lRQqOX8ABQbYy6zm15BHKSOqbHF82QHntrqUZf9u94J7S0ez0reltsOdrFTK0rWcbTMAWjNQfBLoMvdJnqVgTSF++WvkTQCCjTpu+LDEfA7axWBDfAQIXh+KFh2OfLVhST4NKPQNrRgsyI0Mi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3XjVwuyHn4DEqfLGjHuSNo1TYRifcG422MdG6bYt7tBxWiw5dlq2iIEMl6O*N2sLWU7W0Ns2*oQbcXIFxRsZ8cHP*6M9dn*9Axg8WbtERj!*jHTfC!Ax6IILXrHDJkdAXgh01PVH!huztVrgd0UC6E4R4zJSOa4ytOKWfQcL9h0NdA“}
If you don't want to display the default task folder, you'll need need to identify the ID of the task list as follows:
- Go to https://to-do.microsoft.com/tasks/?fromOwa=true and sign-in if necessary
- Select your desired task list
- Copy the task list ID from the URL, e.g.
AQMkADAwATNiZmYAZC1iODgANS1hNGMyLTAwAi0wMAoALgAAA1Lh_i4gMGJMlZDpJ2d8iWwBAB_qpxIEaN5AgOOJ-T1mRJ8AAzJQqfYAAAA=
from
https://to-do.microsoft.com/tasks/AQMkADAwATNiZmYAZC1iODgANS1hNGMyLTAwAi0wMAoALgAAA1Lh_i4gMGJMlZDpJ2d8iWwBAB_qpxIEaN5AgOOJ-T1mRJ8AAzJQqfYAAAA=
- Navigate into your MagicMirror's
modules
folder and executegit clone https://github.com/thobach/MMM-MicrosoftToDo.git
. - In order to load the MMM-MicrosoftToDo module you will need to add the following configuration to your
config/config.js
file. Asoauth2ClientSecret
you need to provide Client Secret from above, asoauth2RefreshToken
you set the Refresh Token, asoauth2ClientId
you set the Client ID and aslistId
you set the Task List ID from above. If you omit thelistId
the default task list will be used.
modules: [
{
module: 'MMM-MicrosoftToDo',
position: 'top_left', // This can be any of the regions. Best results in left or right regions.
header: 'Shopping List', // This is optional
config: {
oauth2ClientSecret: '1Q25ls%3FTKEDf4RWBKVUbKjnaVu%3DytP.%5B',
oauth2RefreshToken: 'MCVDmtyumC8ZdlGxrkMwCdur4FbPh7GHjy1gOaOHEA8*c5tTI4oIcJAHU8AflLZMLmcCRWNEa7nMkag2hbipYbZ3QgL9JB1G6Hc*JZY9oA5j46Cq79b6BDx8mivTVen0r*39h2hw9pngKS7MGXjKc9efwayQ7UhsFoCJ2wdhLJzv5gTR2EozgcsKsxHODj!1fV8a1sqVqJ!sU*CBLTMsm0twI2hZqsCkPoSWaMIS5kKFAq7bCsfNaumS11TZYni3XjVwuyHn4DEqfLGjHuSNo1TYRifcG422MdG6bYt7tBxWiw5dlq2iIEMl6O*N2sLWU7W0Ns2*oQbcXIFxRsZ8cHP*6M9dn*9Axg8WbtERj!*jHTfC!Ax6IILXrHDJkdAXgh01PVH!huztVrgd0UC6E4R4zJSOa4ytOKWfQcL9h0NdA',
oauth2ClientId: '4ef19f40-4892-4905-b999-76041e991f53',
listId: 'AQMkADAwATNiZmYAZC1iODgANS1hNGMyLTAwAi0wMAoALgAAA1Lh_i4gMGJMlZDpJ2d8iWwBAB_qpxIEaN5AgOOJ-T1mRJ8AAzJQqfYAAAA=', // optional parameter: default value is the "Tasks" list
showCheckbox: true, // optional parameter: default value is true and will show a checkbox before each todo list item
hideIfEmpty: false, // optional parameter: default value is false and will show the module also when the todo list is empty
maxWidth: 450, // optional parameter: max width in pixel, default value is 450
itemLimit: 200 // optional parameter: limit on the number of items to show from the list, default value is 200
}
},
]