Read the statement by Michael Teeuw here.
Notifications help
-
Trying to capture notifications for a module, can anyone tell me what’s wrong with this mai js, my objective for now is to capture the SHOW_ALERT notification and print it in the console log. Here is the mainjs
Module.register("MMM-11-TTS", { start: function() { console.log(`Starting module: ${this.name}`); }, notificationReceived: function(notification, payload) { if (notification === 'SHOW_ALERT') { console.log(`Received notification: ${notification}`); console.log(`Payload: ${payload}`); } } });
-
@sdetweil
Got it thanks -
@sdmydbr9 module name = module folder name = module_name.js = register name
all must match exactly, case matters
@sdmydbr9 said in Notifications help:
MMM-11-TTS
, right?
only displayed in the dev console log unless u install mmm-logging
-
@sdmydbr9 In my case, it helped me tremendously to have MMM-ViewNotifications installed on my test system, so I could eliminate if it was my code or the notification.
-
@sdetweil well they match, the folder, the module name and module.js.
The folder is MMM-11-TTS under the modules directory.
Under that directory is MMM-11-TTS.js module. I have also specified the config.js to consider this module.
The contents of the MMM-11-TTS.js posted earlier, is that correct or if there is anything missing, can you please provide me the updated code. -
@BKeyport I did that and it’s definitely my code, I can see the notification is being sent by the SHOW_ALERT but my module is not able to capture them, I tried different codes and hit mental block now.
-
@sdmydbr9 I replied on discord
-
@sdetweil
Got it thanks