MagicMirror² v2.11.0 is available! For more information about this release, check out this topic.

ALERT: setting the display time individually

  • If there’s a alert, I’d like to be able to tell how long the alert should stay. At present I understand this is a global variable in the config.js (display_time). It would be nice, if this global variable could be overwritten, if I call the function.
    I tried:
    this.sendNotification("SHOW_ALERT", {type: "notification", display_time: "10000", title: "Title", message: "Message"});

    But still, the global display_time was used. Did I miss something?

  • Project Sponsor Module Developer

    @binderth a notification display time cannot be set in a notification itself, it’s up to the user to define the notification time for the alert module.

      module: 'alert',
      config: {
        display_time: 10000

    if you want to set the duration you have to use an alert instead of notification:

    this.sendNotification("SHOW_ALERT", {timer: 10000, title: "Title", message: "Message"});

  • @strawberry-3.141 said in ALERT: setting the display time individually:

    if you want to set the duration you have to use an alert instead of notification:
    this.sendNotification(“SHOW_ALERT”, {timer: 10000, title: “Title”, message: “Message”});

    ok, that did it. The Alerts are now shown as given in the “timer”-argument.
    Nevertheless my usecase would be to have also multiple notifications staying on top like “washing machine ready” and “dryer ready” or something which needs some action done.

    So it would be nice to have either notification also displayed “on event” and not globally or to have notifications smoothed out, if the item action is done. As I can see, the alert-module doesn’t allow fading the notifications on a action?

Log in to reply