Module Scheduler Question



  • Recently I build my first MagicMirror. At the moment I’m struggling a bit with the module scheduler. In my config.js I used a standard template from the github page:
    {
    module: ‘MMM-ModuleScheduler’,
    config: {
    notification_schedule: [
    // TURN THE MONITOR/SCREEN ON AT 07:30 EVERY DAY
    {notification: ‘REMOTE_ACTION’, schedule: ‘30 7 * * *’, payload: {action: “MONITORON”}},
    // TURN THE MONITOR/SCREEN OFF AT 22:30 EVERY DAY
    {notification: ‘REMOTE_ACTION’, schedule: ‘30 22 * * *’, payload: {action: “MONITOROFF”}},
    // RESTART THE MAGICMIRROR PROCESS AT 2am EVERY SUNDAY
    {notification: ‘REMOTE_ACTION’, schedule: ‘0 2 * * SUN’, payload: {action: “RESTART”}}
    ]
    }
    },

    When I check the logs I see this:

    Launching application.
    (node:9723) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot read property ‘refs’ of undefined
    (node:9723) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
    MMM-ModuleScheduler is removing all scheduled jobs
    MMM-ModuleScheduler received CREATE_NOTIFICATION_SCHEDULE
    MMM-ModuleScheduler is scheduling REMOTE_ACTION using "30 7 * * *
    MMM-ModuleScheduler has scheduled REMOTE_ACTION
    MMM-ModuleScheduler will next send REMOTE_ACTION at Fri Aug 31 2018 07:30:00 GMT+0200 (CEST)
    MMM-ModuleScheduler is scheduling REMOTE_ACTION using "30 22 * * *
    MMM-ModuleScheduler has scheduled REMOTE_ACTION
    MMM-ModuleScheduler will next send REMOTE_ACTION at Fri Aug 31 2018 22:30:00 GMT+0200 (CEST)
    MMM-ModuleScheduler is scheduling REMOTE_ACTION using "0 2 * * SUN
    MMM-ModuleScheduler has scheduled REMOTE_ACTION
    MMM-ModuleScheduler will next send REMOTE_ACTION at Sun Sep 02 2018 02:00:00 GMT+0200 (CEST)

    As you can see it sends a remote action at friday 31st of august. I want to set a remote action for everyday of the week but somehow this action shifts to next week. I tried to specify a particular day (SAT) but when I do this the same thing happens. It’s going to send a remote action at the 1st of september. Could anyone point me in the right direction? Much appreciated.

    (Disclaimer: I’m no coding expert, I do a lot of reading on this forum and try to figure things out)



  • Silvor,

    As far as I understand it, only the immediate next action is scheduled, once that action has been performed, the schedule will be studied and the following action will be scheduled.
    So it makes sence that you see the first upcoming Monitor On, the first upcoming Monitor Off and the first upcoming Reboot.

    By the way, are the time and date correct by the time mmm-mode scheduler is running?



  • Yesterday was the first time I used it. It was shutting down fine at 22:30. I assumed that this morning it turned back on at 7:30. Then I realized it only has an remote action for the friday according to the logs. Why doesn’t it use the other days of the week? I assumed the first upcoming Monitor On was at 7:30 this saturday morning. So I can’t understand why it moves to next friday.



  • When I use:
    {notification: ‘REMOTE_ACTION’, schedule: ‘30 22 * * *’, payload: {action: “MONITOROFF”}},

    The monitor is suppose to turn off at 22:30 everyday. But when I check the logs I can see the first action is at friday the 31st of august? Is there somebody who can explain why it does this? Why does it not work everyday before the 31st of august? Is it a crontab thing?