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

sendNotification help

  • I want to be able to send a value to to change the time used in a count down timer. Right now I can make the module hide with…


    but I cant seem to do much more, how do I change my sendNotification to include a payload to change the date and time in MMM-EventHorizon. I will have to change the notificationReceived in MMM-EventHorizon to I assume…

  • @jasondreher just add the payload on to the api call like this

    this.sendNotification('HIDE_TIMER', payload);

    ‘payload’ can be anything… a variable (this.variable_name), a literal(‘some literal string’), a dynamically constructed value (‘some value’ + variable_name + ’ right now ')

    the receiving modules sendNotificationReceived(code, payload, sender) function is responsible for ignoring or processing the payload data according to the shared rules of the sender

  • OK so I change my sendNotification to


    and the MMM-EventHorizon notificationReceived to

        notificationReceived: function(notification, payload) {
            if (notification === 'HIDE_TIMER') {
            } else if (notification === 'SHOW_TIMER') {
                this.time = payload //I added this
                this.updateDom();  //I added this

    Thinking the paylaod will update the countdown time but it does nothing… Not sure what I am doing worng. I have tested this quite a few different ways and searched quite a bit…

    I can tell its doing something as it flickers (like it is refreshing with the updateDom) but the countdown does not reflect the new time.

  • @jasondreher you didn’t use the payload. Just hide and show. I don’t know the other module.

    But I would guess u need to start a timer with some elapsed time til the action (from now)

  • @jasondreher said in sendNotification help:

    this.time = payload

    I added “this.time = payload”, this is using the payload correct?

  • @jasondreher said in sendNotification help:

    this.time = payload


    this.config.time = payload

Log in to reply