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

MMM-NotificationTrigger


  • Module Developer

    MMM-NotificationTrigger

    This module could relay or convert notifications from some module’s to other module’s.
    Modules have their own incoming and outgoing notifications, but most of them are not compatible with each other. Some modules may have the user-configurable notification name or payload, but most are not. In that case, you should modify the module to make possible to understand or to broadcast other’s notification. Those are normally hardcoded in the modules, it means you should re-edit after upgrading.

    With MMM-NotificationTrigger, you can TRANSLATE one notification from other notification(s). And you can make a CHAIN to activate multi-modules together, even conditionally.

    For example, You might be using MMM-motion-detection and MMM-Remote-Control, but your MMM-motion-detection can emit only motion-detected and motion-stopped notifications unless you modify the module itself.

    Now with MMM-NotificationTrigger,

    1. you can translate motion-detected notification to REMOTE_ACTION {action:"MONITORON"} which is understandable by MMM-Remote-Control module.
    2. At the same time, you can activate another ALERT module for showing greeting message automatically,
    3. And even more, you can change the greeting message by time.(or any condition)

    Ok, this is just an example. I believe you can find more usages for your real purpose by yourself.

    Screenshot

    This module works in background, so there is no screenshot.

    See the details and download

    UPDATE

    2018-10-02

    • exec is added. Now you can execute your external shell command or script by notification.
    {
      module: "MMM-NotificationTrigger",
      config: {
        triggers:[
          {
            trigger: "DOM_OBJECTS_CREATED",
            fires: [
              {
                fire:"MY_COMMAND",
                exec: "sleep 5; ls -l"
              },
            ],
          },
        ]
      }
    },
    

  • Module Developer

    UPDATE

    2018-10-02

    • exec is added. Now you can execute your external shell command or script by notification.
    {
      module: "MMM-NotificationTrigger",
      config: {
        triggers:[
          {
            trigger: "DOM_OBJECTS_CREATED",
            fires: [
              {
                fire:"MY_COMMAND",
                exec: "sleep 5; ls -l"
              },
            ],
          },
        ]
      }
    },