Skip to content

Update Notification ​

The updatenotification module is one of the default modules of the MagicMirror. This will display a message whenever a new version of the MagicMirror application is available.

Using the module ​

To use this module, add it to the modules array in the config/config.js file:

js
    {
      module: "updatenotification",
      position: "top_center", // This can be any of the regions.
      config: {
        // The config property is optional.
        // See 'Configuration options' for more information.
      },
    },

Configuration options ​

The following properties can be configured:

OptionDescription
updateIntervalHow often do you want to check for a new version? This value represents the interval in milliseconds.

Possible values: Any value above 60000 (1 minute)
Default value: 600000 (10 minutes)
ignoreModulesAn array of module names that should not check for update.

Example: ["MMM-ExampleModule1", "MMM-ExampleModule2"].
You can exclude MagicMirror by adding "MagicMirror" to the array.
Default value: [] (empty array, no modules)
sendUpdatesNotificationsAllow to broadcast update with UPDATES notification to other modules.

Default value: false
updatesArray of updates modules commands.
Default value: [] (see bellow)
updateTimeoutMaximum Update duration before cancel it.
Default Value: 120000 (2 minutes)
updateAutorestartRestart automatically MagicMirror² after update is done.
Default Value: false
useModulesFromConfigIf false, iterate over the modules directory instead of using the modules defined in config.js.
Default Value: true

updates Array ​

updates is an array of command for updating 3rd party modules modules

It consists of an object containing the name of the module and the associated update command

Sample:

js
    {
      module: "updatenotification",
      position: "top_center", // This can be any of the regions.
      config: {
        updates: [
          // array of module update commands
          {
            // update of MMM-Test with embed npm script
            "MMM-Test": "node --run update",
          },
          {
            // update of MMM-OtherSample with "complex" process command
            "MMM-OtherSample":
              "rm -rf package-lock.json && git reset --hard && git pull && npm install",
          },
          {
            // update of MMM-OtherSample2 with git pull && npm install command
            "MMM-OtherSample2": "git pull && npm install",
          },
          {
            // update of MMM-OtherSample3 with a simple git pull
            "MMM-OtherSample3": "git pull",
          },
        ],
      },
    },

Note: Don’t hesitate to ask the module developer for the ideal command to update their module.

Developer notes ​

Broadcast notifications (notifications send to modules) ​

NotificationDescriptionRequirement
UPDATESWhen updates are available, an Array of updatable modules is sended.
This is the best way to update your own module! (a guide will be available soon)
Note: It will not include default modules and MagicMirror.

Example: ["MMM-MyOwnModule","MMM-Test"]
sendUpdatesNotifications: true

Received notification (notifications send from modules) ​

NotificationDescription
SCAN_UPDATESAllow force scanning any updates from other modules