MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord

    UNSOLVED Help with MMM-ModuleSchedule to turn off monitor

    Troubleshooting
    3
    4
    673
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      mlm198 last edited by

      Hi All,

      I want to use MMM-ModuleSchedule and MMM-Remote switch off the monitor. I know remote is working as I can connect to it using my phone but when I get an error message when I start to use the schedule which is just a cut and paste job. Not sure what I am doing wrong but below is the code for the two modules along with the error message when starting MM.

      Thanks for any help.

      Matthew

      {
              module: 'MMM-ModuleScheduler',
              config: {
                  notification_schedule: [
                      // TURN THE MONITOR/SCREEN ON AT 07:30 EVERY DAY
                      {notification: 'REMOTE_ACTION', schedule: '30 6 * * *', payload: {action: "MONITORON"}},
                      // TURN THE MONITOR/SCREEN OFF AT 22:30 EVERY DAY
                      {notification: 'REMOTE_ACTION', schedule: '30 8 * * *', payload: {action: "MONITOROFF"}},
                      {notification: 'REMOTE_ACTION', schedule: '00 16 * * *', payload: {action: "MONITORON"}},
      				{notification: 'REMOTE_ACTION', schedule: '00 21 * * *', payload: {action: "MONITOROFF"}},
                      
                      // RESTART THE MAGICMIRROR PROCESS AT 2am EVERY SUNDAY
                      {notification: 'REMOTE_ACTION', schedule: '0 2 * * SUN', payload: {action: "RESTART"}}
                  ]
              }
          },
      
      {
              module: 'MMM-Remote-Control',
              // uncomment the following line to show the URL of the remote control on the mirror
              // position: 'top_right',
              // you can hide this module afterwards from the remote control itself
              config: {
                  apiKey: ''
              }
          },
      

      This is the error message:
      16:43:32.896] [ERROR] { Error: Cannot find module ‘cron’
      at Module._resolveFilename (internal/modules/cjs/loader.js:602:15)
      at Function.Module._resolveFilename (/home/pi/MagicMirror/node_modules/electron/dist/resources/electron.asar/common/reset-search-paths.js:35:12)
      at Function.Module._resolveFilename (/home/pi/MagicMirror/node_modules/module-alias/index.js:49:29)
      at Function.Module._load (internal/modules/cjs/loader.js:528:25)
      at Module.require (internal/modules/cjs/loader.js:658:17)
      at require (internal/modules/cjs/helpers.js:20:18)
      at Object. (/home/pi/MagicMirror/modules/MMM-ModuleScheduler/node_helper.js:11:15)
      at Object. (/home/pi/MagicMirror/modules/MMM-ModuleScheduler/node_helper.js:327:3)
      at Module._compile (internal/modules/cjs/loader.js:711:30)
      at Object.Module._extensions…js (internal/modules/cjs/loader.js:722:10) code: ‘MODULE_NOT_FOUND’ }

      S 1 Reply Last reply Reply Quote 0
      • S
        sdetweil @mlm198 last edited by

        @mlm198 cd to that module folder, and do

        npm install -save cron
        

        Looks like the module package.json doesn’t list that drpendency

        Sam

        Create a working config
        How to add modules

        M 1 Reply Last reply Reply Quote 0
        • M
          mlm198 @sdetweil last edited by

          @sdetweil thanks for the response and forgive my lack of knowledge but which of the folders listed?

          Matthew

          1 Reply Last reply Reply Quote 0
          • F
            fribse last edited by

            go to you ‘magicmirror’ folder, then to modules, and then to the MMM-Remote-Control folder and run ‘npm install’, I think you forgot that.

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post
            Enjoying MagicMirror? Please consider a donation!
            MagicMirror created by Michael Teeuw.
            Forum managed by Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
            This forum is using NodeBB as its core | Contributors
            Contact | Privacy Policy